Build with Redis Agent Memory

API reference, SDK examples, and language-specific guides for building with Redis Agent Memory.

Everything you need to start building with Redis Agent Memory — REST API reference, SDK examples, and language-specific guides.

What you can build

Redis Agent Memory gives your agents a two-tier memory layer available via REST API and Python SDK:

  • Session memory — Store the current conversation as a sequence of events. Query by session ID to reconstruct context for the next agent turn.
  • Long-term memory — Automatically extract and persist important facts, preferences, and patterns from session events. Search semantically to retrieve what's relevant.
  • Multi-session recall — Retrieve memories across sessions and users using semantic search, with filtering by session, owner, namespace, topic, and memory type.
  • Direct memory writes — Bulk-create long-term memories from external sources without going through a session, for importing existing knowledge.

API quick start

1. Add a session event — store a conversation turn in short-term memory:

POST /v1/stores/{storeId}/session-memory/events
{
    "sessionId": "session-abc",
    "actorId": "user-123",
    "role": "USER",
    "content": [{ "text": "I prefer vegetarian restaurants." }],
    "createdAt": "2026-06-01T10:00:00Z"
}

Agent Memory automatically promotes important information (like preferences) to long-term memory in the background.

2. Search long-term memory — retrieve relevant context before the next agent response:

POST /v1/stores/{storeId}/long-term-memory/search
{
    "text": "user dietary preferences",
    "filter": {
        "ownerId": { "eq": "user-123" }
    }
}

See the full API and SDK examples for all endpoints, including session retrieval, memory deletion, and search filters.

Language guides

Note:
The guides below show how to implement agent memory patterns directly using Redis client libraries — without the managed Agent Memory service. This is a good option if you prefer to self-host, want full control over the implementation, or are using a language that doesn't yet have an Agent Memory SDK. For the managed service, use the REST API from any language.

Step-by-step examples for building agent memory into your application using your preferred Redis client library:

Set up authentication

All API calls require an Agent Memory API key and a Store ID. Pass the key as a Bearer token and the store ID as a path parameter:

curl -X POST "https://$HOST/v1/stores/$STORE_ID/session-memory/events" \
    -H "Authorization: Bearer $API_KEY" \
    -H "Content-Type: application/json" \
    -d '{ ... }'

To get your API endpoint, key, and Store ID, see Create an Agent Memory service.

RATE THIS PAGE
Back to top ↑