Skip to main content

Basic Sessions

Multi-turn conversations use sessionId to persist message history across .run() calls. The agent remembers prior turns automatically.

Session Manager

Use SessionManager to create, list, retrieve, and delete sessions programmatically — useful for building chat UIs or multi-user backends.

Memory with Summarization

When conversations grow long, the memory system automatically summarizes overflow messages so the agent retains context without exceeding the context window.

User Memory

Enable userFacts to automatically extract and remember facts about users across sessions. The agent personalizes responses based on accumulated knowledge.

Entity Memory

Track people, companies, products, and other entities mentioned in conversations. Entities are automatically extracted and searchable across sessions.

Decision Log

Log and retrieve past decisions with reasoning and outcomes. Builds an audit trail the agent can reference for consistency.

User Profile

Build structured user profiles automatically from conversation data. The agent extracts name, role, company, timezone, and custom fields.

Memory Curator

Maintain healthy memory stores by pruning stale data, deduplicating facts, and clearing user data on request.

Cross-Session Intelligence

Combine session history, user facts, entity memory, and decision logs to give the agent full cross-session awareness. This is the “everything enabled” configuration.

Memory with Storage

Persist memory to durable storage backends. Use InMemoryStorage for development, SqliteStorage for single-server apps, and MongoDBStorage or PostgresStorage for production.
Storage backends support the same interface — swap one line to migrate:

Graph Memory

Build a knowledge graph of entities and relationships from conversations. The agent can traverse connections to answer questions about how people, companies, and projects relate to each other.

Temporal Facts

When a user changes their mind or updates a preference, the memory system automatically supersedes the old fact. Only the latest version is used for context — older facts are kept for audit but marked as invalidated.

Simplified API

Use remember(), recall(), and forget() for quick memory operations without configuring individual stores. These convenience methods dispatch to the appropriate store automatically.

Procedural Memory

The agent learns multi-step workflows from successful tool-call sequences and suggests them when similar tasks come up again. This turns one-off actions into reusable procedures.
See Procedural Memory for the full scope hierarchy.

Team Shared Memory

When agents work together in a Team, they can share a single memory configuration. Facts learned by one agent are visible to all team members, enabling cross-agent knowledge sharing.

Scoped Learnings (workflow-shared knowledge)

User facts are personal — “Alice prefers email” only belongs to Alice. But workflow knowledge (“Vendor X invoices always have line-item drift”) belongs to a team, not a person. LearnedKnowledge supports an explicit scope hierarchy so genuinely shared insights can be saved once and seen by every authorised user.

Promoting from personal to shared

Auto-extracted learnings always save as "user" — the framework never auto-promotes an LLM-extracted insight to a shared scope. To promote, the agent (or a human reviewer) calls save_learning explicitly with scope: "agent" or scope: "tenant".
The same pattern applies to procedures — workflow templates like “Reconcile invoice with PO mismatch” can be saved with scope: "agent" so every member of the invoice-recon team gets the same procedure suggested. See Multi-User Isolation for the full scope contract.

Composite Scoring

When recalling memories, results are ranked using a composite score that blends semantic similarity, recency, and importance. More relevant, recent, and important memories surface first.

Memory Consolidation

Over time, memory stores accumulate redundant or near-duplicate facts. The curator’s consolidate() method uses an LLM to identify semantically similar facts and merge them into single authoritative entries.

Multi-Tenant Memory

One agent definition serving many organizations. Personal facts stay private to each user; tenant-scoped learnings are shared org-wide but never cross tenant boundaries.

Timezone-Aware Fact Extraction

The timezone config anchors date-relative statements (“today”, “yesterday”, “next Monday”) to the user’s local date. Without it, a user near midnight gets the wrong date stored.

Debugging Injected Context

When the model seems to “forget” something, inspect exactly what was injected into the system prompt with buildContext().
You can also subscribe to the memory.context.built event to track context size over time: