What is Memobase?
Memobase is an open-source memory backend that gives LLM applications long-term memory about each user. Instead of storing raw conversation logs, it builds a structured user profile (name, interests, work, demographics, and more) plus a time-stamped event timeline that grows as the user keeps chatting. It sits in the Agent Memory category of the Agents & Automation tools and is open-source, written in Python and licensed Apache-2.0.
Overview
Memobase is an open-source memory backend that gives LLM applications long-term memory about each user. Instead of storing raw conversation logs, it builds a structured user profile (name, interests, work, demographics, and more) plus a time-stamped event timeline that grows as the user keeps chatting.
It is aimed at developers building virtual companions, educational tools, and personalized assistants who need their AI to remember a user across sessions. You send conversations to Memobase, it processes them in a per-user buffer, and you read back a compact profile or a ready-to-use context block to drop into your prompt.
As a memory framework, Memobase focuses on the user rather than the agent. It runs as a server built on FastAPI, Postgres, and Redis, and offers SDKs for Python, Node, and Go plus a REST API, so it slots into an existing LLM stack with small code changes.
What it does
- Builds a structured, controllable user profile with topics and sub-topics learned from chats
- Records a time-aware event timeline so the assistant can answer time-related questions
- Batches each user's conversations in a buffer, then flushes them to memory to keep cost and latency down
- Returns a profile or a packed context block you can insert directly into your prompt
- SDKs for Python, Node, and Go, plus a REST API and an MCP server
- Self-hostable via Docker (FastAPI, Postgres, Redis) or a hosted cloud free tier
Getting started
Run a Memobase server (self-hosted or the hosted cloud free tier), then connect with the Python SDK to add a user, insert a chat, flush, and read the profile.
Install the SDK and connect
Install the Python client, then create a client with your project URL and token and confirm the connection. Local defaults are http://localhost:8019 with the token secret.
pip install memobaseConnect to your project
Point the client at your project URL and API key, then ping to verify.
from memobase import MemoBaseClient, ChatBlob
client = MemoBaseClient(
project_url=PROJECT_URL,
api_key=PROJECT_TOKEN,
)
assert client.ping()Add a user and insert a chat
Create a user, then insert a conversation as a ChatBlob. Memobase processes blobs into memory and removes them by default once handled.
uid = client.add_user({"any_key": "any_value"})
u = client.get_user(uid)
messages = [
{"role": "user", "content": "Hello, I'm Gus"},
{"role": "assistant", "content": "Hi, nice to meet you, Gus!"},
]
bid = u.insert(ChatBlob(messages=messages))Flush and read the profile
Flush the buffer (use sync=True to wait for processing), then read the structured profile the user has learned.
u.flush(sync=True)
print(u.profile(need_json=True))Commands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Give a virtual companion or chatbot persistent memory so it remembers a user's name, interests, and history across sessions
- Personalize an AI assistant's answers using a structured profile packed into the prompt context
- Answer time-related questions by querying the user's event timeline
- Track and analyze what your AI learns about users over many conversations
How Memobase compares
Memobase alongside other open-source agent memory tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| Claude-Mem | ★ 121k | Persistent memory layer for coding agents: it captures what an agent does during a session, compresses it into semantic summaries, and injects the relevant parts back into later sessions. |
| Mem0 | ★ 69.7k | A memory layer that you add to existing LLM agents to extract, store, and recall user facts and preferences across sessions using vector, graph, and key-value backends. |
| Hindsight | ★ 64.3k | An agent memory server that stores facts and experiences, consolidates them into observations and mental models, and serves them back through retain, recall, and reflect operations. |
| MemPalace | ★ 60.8k | Local-first agent memory that stores conversations verbatim instead of summarising them, with a structured palace index, pluggable vector backends and an MCP server. |
| OpenViking | ★ 43.1k | A context database that stores an agent's memories, resources, and skills as one browsable viking:// filesystem with three-tier (abstract/overview/details) on-demand loading. |
| Cognee | ★ 33.7k | A graph-native memory engine that turns raw documents and conversations into a queryable knowledge graph for agents that need to build lasting knowledge. |
| Graphiti | ★ 33.2k | A library that builds a temporal knowledge graph from an agent's conversations and data so facts can be tracked and queried as they change over time. |
| Memobase | ★ 3k | User-profile-based long-term memory backend for LLM chatbots and assistants |

