Humanloop + Persistent Memory for Prompt Iteration
Free · Open source (MIT) · Works with LangChain, CrewAI, AutoGen · No signup
When iterating on Humanloop prompts, your agents lose all context between runs. Each prompt test starts fresh, making it impossible to build conversational flows or maintain state across iterations. BotWire Memory solves this by giving your Humanloop agents persistent, cross-session memory that survives restarts.
The Problem: Stateless Prompt Iteration
Humanloop excels at prompt versioning and A/B testing, but every agent execution is isolated. Your conversational agent forgets previous interactions, your multi-step workflows restart from scratch, and complex prompt chains lose their context.
Here's what breaks: You're testing a customer service agent that should remember user preferences across conversations. In production, users expect continuity. But during Humanloop prompt iteration, each test run is a blank slate. Your agent can't recall that "John prefers email notifications" or "Sarah's last order was delayed."
This forces you to either:
- Mock state in your prompts (unrealistic)
- Test only single-turn interactions (limited)
- Build temporary state management (time-consuming)
The result? Your Humanloop testing environment doesn't match production behavior, leading to poor prompt decisions and frustrated users.
The Fix: Persistent Agent Memory
Install BotWire to add persistent key-value memory to any Humanloop agent:
pip install botwire
Basic usage that works immediately:
from botwire import Memory
# Namespace isolates different agents/experiments
memory = Memory("customer-service-v2")
# Store user context
memory.set("user:john:preferences", {
"notification_method": "email",
"language": "en",
"last_order": "ORD-12345"
})
# Retrieve in your Humanloop agent
user_prefs = memory.get("user:john:preferences")
print(f"John prefers: {user_prefs['notification_method']}")
How It Works
The Memory class connects to BotWire's HTTP API at botwire.dev. No signup required, no API keys. Your data persists across Humanloop runs, local development, and production deployments.
Namespaces isolate different experiments. Use descriptive names like "humanloop-exp-47" or "customer-agent-v3". Each namespace gets 1000 writes/day and 50MB storage on the free tier.
from botwire import Memory
# Different experiments don't interfere
exp_a = Memory("prompt-variant-a")
exp_b = Memory("prompt-variant-b")
# Store complex objects (JSON-serializable)
exp_a.set("conversation_state", {
"current_topic": "billing",
"escalation_level": 2,
"unresolved_issues": ["refund-pending"]
})
# List all keys in a namespace
all_keys = exp_a.list_keys()
print(f"Stored keys: {all_keys}")
# Delete specific data
exp_a.delete("temporary_session_data")
Cross-process persistence means your memory survives Humanloop's execution environment. Whether you're testing locally, running in Humanloop's sandbox, or deploying to production, the same memory persists.
TTL support for temporary data:
# Auto-expire session data after 1 hour (3600 seconds)
memory.set("session:temp-token", "abc123", ttl=3600)
Framework Integration
BotWire includes ready-made adapters for popular agent frameworks used with Humanloop:
LangChain chat history:
from botwire import BotWireChatHistory
from langchain.memory import ConversationBufferMemory
# Persistent chat history across Humanloop runs
chat_history = BotWireChatHistory(session_id="user-42")
memory = ConversationBufferMemory(
chat_memory=chat_history,
return_messages=True
)
# Your LangChain agent now remembers conversations
# between Humanloop prompt iterations
CrewAI memory tools:
from botwire.memory import memory_tools
# Get remember/recall/list_memory tools for CrewAI agents
tools = memory_tools("sales-team-memory")
# Your CrewAI agents can now:
# - remember("client_budget", "$50k")
# - recall("client_budget")
# - list_memory()
When NOT to Use BotWire
- Vector/semantic search: BotWire is key-value storage, not a vector database. Use Pinecone or Weaviate for embeddings.
- High-frequency writes: Free tier allows 1000 writes/day. For heavy workloads, consider Redis or self-hosting.
- Sub-millisecond latency: HTTP API adds ~50-200ms. For ultra-low latency, use in-memory solutions.
FAQ
Why not Redis or databases? Redis requires infrastructure setup and management. BotWire works immediately with zero configuration, perfect for Humanloop's rapid iteration workflow.
Is this actually free? Yes. 1000 writes/day per namespace, unlimited reads, 50MB storage. No credit card, no trial expiration. Heavy users can self-host the open-source version.
What about data privacy? Data is stored on BotWire's servers. For sensitive data, self-host using the MIT-licensed code at github.com/pmestre-Forge/signal-api - it's a single FastAPI + SQLite service.
Get Started
Add persistent memory to your Humanloop agents in under 2 minutes. Your prompt iterations will finally match production behavior, leading to better agent performance and more reliable testing.
pip install botwire
Full documentation and self-hosting guides: https://botwire.dev