Skip to main content
Customer support agents, product copilots, and personal assistants often serve the same user across many conversations. Memory keeps facts such as preferences, responsibilities, and recurring goals available across those conversations.
memory_agent.py
The first run stores useful facts for sarah. The second run uses the same user_id, so the agent can recall those facts in a different session.

How Memory Works

  1. user_id identifies whose memories should be loaded.
  2. The configured database stores each user’s memory records.
  3. Stored memories for that user are added to the model context for later runs.
  4. The selected memory mode controls when records are created, updated, or deleted.
Use a stable application user ID for every run that should share the same memories.

Choose a Memory Mode

Automatic memory applies one consistent extraction step during each run. Agentic memory adds memory tools to the agent’s toolset and lets the model choose when to call them.
When both settings are enabled, agentic memory takes precedence and the automatic extraction step is skipped. Choose one mode for each agent.

Memory, History, and State

These features can work together. A support agent can use memory for the customer’s communication preference, history for the current ticket, and state for the ticket status.

Store and Inspect Memories

Memories use the database configured on the agent. The default table or collection name is agno_memories. Set memory_table on the database when your application needs a custom name.
Manual retrieval is useful for customer profile screens, debugging, review, and deletion workflows. You can also manage memories in the AgentOS UI.

Next Steps

Agent Memory

Configure memory for a single agent.

Team Memory

Share user memories with a team and its members.

Working with Memories

Customize memory creation, retrieval, and storage.

Production Best Practices

Plan user isolation, retention, and memory quality checks.