Agent Memory
Persistent memory system that allows agents to remember past interactions, learn from experience, and maintain context across sessions.
Why Memory Matters
Without memory, every agent interaction starts from scratch. With memory, agents can reference past conversations, recall user preferences, and build on previous reasoning to provide more personalized and contextually aware responses.
Conversation History
Full transcript of past interactions with semantic indexing for retrieval.
Fact Storage
Agents can store and recall specific facts, preferences, and user data.
Semantic Recall
Query memory using natural language to retrieve relevant past context.
Memory Types
Short-Term Memory
Active conversation context kept in the agent's working memory during a single session.
Long-Term Memory
Persistent storage of facts, preferences, and summarized interactions across multiple sessions.
Episodic Memory
Specific events or past workflow executions that can be referenced for continuity.
Storing and Retrieving Memory
Agents can explicitly save important information to memory or retrieve relevant context before responding.
// Storing a memory
{
"type": "memory_save",
"key": "user_preference",
"value": "The user prefers concise technical explanations.",
"tags": ["preference", "communication"]
}
// Retrieving memories
{
"type": "memory_query",
"query": "What does the user prefer for explanations?",
"top_k": 3
}
// Response:
{
"memories": [
{ "key": "user_preference", "value": "prefers concise technical...", "relevance": 0.95 }
]
}When Memory Is Used
Before executing an LLM step, the agent can optionally retrieve relevant memories. These memories are injected into the prompt as contextual grounding, allowing the agent to remain consistent across executions.
Privacy & Security
All memory data is stored locally in MongoDB and is scoped to individual users or agent instances. You have full control over what gets stored, how long it's retained, and when it's deleted. No memory data is ever sent to external services.