Redis Agent Memory overview

How Redis Agent Memory's session and long-term memory tiers work, and what runs automatically in the background.

Background summarization and extraction

A memory store holds session events and long-term memories. Each store has its own retention and extraction settings. Your application writes session events as they happen. The store has separate controls for two background tasks.

  • Automatic summarization condenses older events when a session reaches the configured threshold. It keeps recent events in full.
  • Background extraction saves useful information from session events as separate, searchable long-term memories.
An application writes session events synchronously to session memory. Background extraction moves durable information into long-term memory, which the application can search directly.

A saved event is available in session memory right away. Extracted memories become searchable after the background job saves them. Built-in extraction compares new information with existing memories to avoid duplicates.

Memory types

You can think of Redis Agent Memory's tiers as analogous to human memory:

Human memory What it holds Redis Agent Memory tier
Working memory What's being discussed right now Session memory: the ordered events of the current conversation
Episodic memory What happened in a specific past experience Long-term memory, episodic type: a snapshot from one session
Semantic memory Facts and preferences you've generalized over time Long-term memory, semantic type: durable, cross-session facts

Session memory is the working set: the current conversation's events, read and written every turn. Long-term memory is what survives after the session ends, durable enough to recall in a conversation the agent hasn't seen before.

Use a session summary from automatic summarization to resume the same conversation. Use a searchable session recap to recall a short account of an earlier conversation in a later session. Use a Summary View to synthesize a selected set of long-term memories.

You can define custom long-term memory types for domain-specific information. See Memory types & extraction for the complete set of built-in and custom types.

Adding to session memory

Your application appends events to session memory. Both your application and background extraction read this conversation transcript.

Key terms

  • Session event: One message in a conversation, added with sessionId, actorId, role, content, and createdAt.
  • actorId: Identifies who or what sent the event, a user, the agent, or a tool.
  • ownerId: Identifies who a long-term memory belongs to, for search and filtering later. Independent of who wrote the session event it came from.
  • memoryType: The category of a long-term memory, such as semantic, episodic, or a custom type you define.

How it works

  1. Add the event. Your application sends the new turn to session memory as it happens. This write is synchronous and fast.
  2. Agent Memory extracts memories. When extraction is enabled, Agent Memory uses session context across turns to identify and save information worth keeping.
  3. Build context for the next turn. Retrieve the session by ID and search long-term memory for relevant facts and preferences. Choose which events, summaries, and search results to give the model. Your application can also let the agent recall memories through a tool.

Send each new turn once. Extraction already has access to earlier events from the session.

Namespaces

Namespaces group related conversations and long-term memories. For example, a travel application can keep a user's trip plans in a personal travel namespace. A shared namespace can hold information that several users need, such as a team's travel policy.

Each namespace has a stable ID. Your application uses that ID when it stores or retrieves memories, even if the namespace's name changes. Namespaces are optional; you can use session and long-term memory without creating one.

See Namespaces for examples. To store conversation events or recall information across conversations, see Sessions and Long-term memory.

FAQ

Do I still need a separate store for conversation state? No. Session memory stores the ordered events of a conversation, with automatic expiration based on a time-to-live (TTL) you set, and no schema to design. It doesn't replace a general-purpose cache or your application's other session data unrelated to the conversation.

What happens if I write directly to long-term memory instead of letting extraction do it? Both paths are supported. Use direct writes for bulk imports or external knowledge sources: anything that didn't originate in a conversation. Automatic extraction is for facts that emerge from session events themselves.

Next steps

RATE THIS PAGE
Back to top ↑