Memory
OMD Cleo maintains several layers of memory that allow the agent to remember context across conversations and provide more personalised, relevant responses over time.
Memory layers
| Layer | Scope | Technology | Description |
|---|---|---|---|
| Session (short-term) | One conversation | PostgreSQL | Full message history for the current conversation window |
| Long-term (user) | One user, all conversations | mem0 + ChromaDB / Memgraph | Facts extracted from past conversations for a specific user |
| Long-term (organisation) | All users in a tenant | mem0 + ChromaDB / Memgraph | Facts relevant to the organisation as a whole |
| Document store | Tenant | ChromaDB | Searchable document embeddings (see Document Hub) |
How long-term memory works
After each conversation, the mem0 layer analyses the conversation history and extracts key facts — preferences, names, decisions, recurring topics — and stores them as structured memory entries.
Memory is stored in two backends:
- ChromaDB — vector embeddings for semantic retrieval ("What does this user prefer?")
- Memgraph — property graph (entities and relations) for structured recall ("User X works in territory Y and prefers morning shifts")
At the start of each new conversation, the agent retrieves relevant memories and injects them into the system prompt, so the LLM has context from previous interactions without the user having to repeat themselves.
Memory tools
The agent has explicit tools to read and write memory during a conversation:
| Tool | Description |
|---|---|
add_memory |
Store a fact about the current user or organisation |
search_memories |
Retrieve memories relevant to a query |
delete_memory |
Remove a specific memory entry |
The agent may use these tools automatically when it identifies important context worth remembering, or in response to explicit user instructions ("Remember that I prefer metric units").
Memory graph
The Memgraph backend stores memory as a property graph: entities (people, places, preferences, organisations) and the relations between them. This graph can be visualised in the Cleo admin frontend.
Memory isolation
Memory is strictly tenant-scoped. A user in one tenant cannot access memories from another tenant. Within a tenant, user-scoped memory is only accessible to that user's conversations; organisation-scoped memory is accessible to all users in the tenant.
Configuring memory backends
Memory backend settings are configured via environment variables:
| Variable | Description |
|---|---|
MEM0_MEMGRAPH_HOST |
Memgraph hostname |
MEM0_MEMGRAPH_PORT |
Memgraph port |
CHROMA_HOST |
ChromaDB hostname |
CHROMA_PORT |
ChromaDB port |
GITHUB_MEMORY_REPO |
(Optional) GitHub repo for git-backed memory |
GITHUB_MEMORY_TOKEN |
(Optional) GitHub token for git-backed memory |