Memory
Your agent's brain. Persistent, self-improving, secure.
Every pattern learned, every pitfall avoided, every decision made — remembered forever and recalled in milliseconds.
Your agent explained your codebase yesterday. Tomorrow it still knows.
Every pattern, every pitfall, every architecture decision — stored once, recalled forever. Your agent loads only what it needs per task (~400 tokens) instead of stuffing everything into a system prompt (5,000+ tokens). That's 92% less wasted context on every single message.
You never have to say "remember this."
Wrap your LLM call with brain.chat() and memory happens invisibly. Before the agent responds, relevant memories are recalled and injected into context. After it responds, new learnings are extracted and stored. Your agent gets smarter with every conversation without you doing anything.
Four strategies. One answer.
Every recall query runs through four search strategies simultaneously: semantic similarity, full-text keyword matching, graph traversal, and temporal recency. Reciprocal Rank Fusion merges the results into one ranked list. A cross-encoder reranker filters the noise. Query expansion catches what you meant, not just what you typed. The result: the right memory, every time.
Overnight, the brain reorganizes itself.
Inspired by how biological memory works during sleep. Overnight, AgentBay reviews the day's memories: promotes frequently-used knowledge to long-term storage, merges duplicates into concise summaries, surfaces contradictions, and generates topic-level overviews. Your agent wakes up with a cleaner, sharper brain than when it went to sleep.
Wrong memories fix themselves.
When two memories contradict each other, AgentBay doesn't just flag it — it resolves it. The system examines both entries, considers which has been verified more often, which was accessed more recently, and which source is more trusted. The winner stays. The loser fades. No manual cleanup needed.
The brain builds its own map.
As memories accumulate, AgentBay automatically extracts entities — functions, services, APIs, patterns — and links them into a knowledge graph. When your agent recalls one memory, it traverses the connections to find related context: what depends on this service, which patterns relate to this function, what pitfalls surround this API. Graph-augmented recall means deeper, more connected answers.
Remember every user. Personally.
Scope memories by user ID. Thomas prefers TypeScript and dark mode. Sarah works on the API team and needs deployment details. Each user gets their own memory space within your agent. Build chatbots, support agents, and personal assistants that remember who they're talking to — across sessions, across devices.
Something went wrong? Go back.
Before every major operation, AgentBay snapshots the entire brain state. If a bad import corrupts your knowledge base, or a rogue agent stores garbage, restore to any previous point with one command. The snapshot you're restoring to? It auto-creates a backup of the current state first — so you can undo the undo.
Works everywhere. Starts local.
pip install agentbay and you're running locally with SQLite and FastEmbed — no signup, no API key, no cloud dependency. When you're ready, upgrade to cloud with one command. Twenty LLM providers supported out of the box: OpenAI, Anthropic, Google, Mistral, Ollama, and more. Your memories migrate automatically. Nothing is lost.
Your agents deserve a real brain.
Start locally. No signup, no API key, no credit card.
pip install agentbay