Give Your AI a Long-Term Memory: A Plain-English Guide to Memobase
For global developers who want their apps to remember users—without the hype.
Three Opening Questions
-
Why does my chatbot greet me like a stranger every single time? -
Can an AI remember that I speak Korean, love Mexican food, and hate ALL-CAPS typing? -
Will the memory system still work if my user base jumps from 10 to 100 000 overnight?
If any of these sound familiar, you have just found the answer: 「Memobase」.
It is a user-profile–centric memory layer that turns scattered conversations into a structured, time-aware snapshot of each human. The rest of this post walks through the official docs, line-by-line, in everyday English.
What Is Memobase in One Sentence?
❝
Memobase = a database of user profiles + a timeline of user events + a plug-and-play memory module for any LLM stack.
❞
Real Problems It Solves
Scenario | Without Memory | With Memobase |
---|---|---|
Learning companion | Repeats “What grade are you?” | Remembers “Grade 9, weak at geometry, likes basketball.” |
E-commerce concierge | Keeps pushing baby strollers | Detects the stroller was returned and now recommends camping gear. |
Digital companion | Forgets yesterday’s argument | Recalls birthday, shared memories, and last apology. |
Architecture at a Glance
User chat
│
├─① ChatBlob (raw messages)
│ └─Buffer (1024 tokens or 1 h idle)
│
├─② Flush (async or manual)
│ └─LLM extracts → structured fields
│
├─③ Profile & Event
│ ├─basic_info, interest, work …
│ └─timestamped events (e.g., “2025-07-21 bought lantern”)
│
└─④ Context API
└─Packs everything into a short string for your prompt
Local vs Cloud: A 30-Second Comparison
Dimension | Local Docker | Memobase Cloud Free Tier |
---|---|---|
Setup time | 5–10 min | 30 s sign-up |
Data retention | You control | 30-day rolling window |
Token budget | Your disk | 50 k / month |
Best for | Production / privacy | Quick demos / MVPs |
Five-Step Quick Start
1. Two Things You Need
-
「Project URL」 -
Local: http://localhost:8019
-
Cloud: https://api.memobase.dev
-
-
「Project Token」 -
Local: secret
-
Cloud: sk-proj-xxxxxx
-
2. Install the Python SDK
pip install memobase
3. Check the Connection
from memobase import MemoBaseClient, ChatBlob
client = MemoBaseClient(
project_url="http://localhost:8019",
api_key="secret"
)
assert client.ping() # Should return True
4. Create a User and Feed Data
uid = client.add_user({"source": "blog_demo"})
user = client.get_user(uid)
dialogue = [
{"role": "user", "content": "Hi, I'm Gus, 25, studied Korean"},
{"role": "assistant", "content": "Nice to meet you, Gus!"}
]
blob_id = user.insert(ChatBlob(messages=dialogue))
❝
By default the raw messages are discarded after processing. To keep them, flip one flag in the config.
❞
5. Trigger Memory Generation
user.flush(sync=True) # Wait for processing
print(user.profile(need_json=True))
Example output (trimmed):
{
"basic_info": {
"name": {"content": "Gus"},
"age": {"content": "25"}
},
"education": {
"major": {"content": "Korean"}
}
}
Plug Memory into Your Prompt—One Line
memory_snippet = user.context(max_token_size=300, prefer_topics=["basic_info"])
Result:
# Memory
Unless the user asks, do not mention these details.
## User Background:
- basic_info:name: Gus
- basic_info:age: 25
Paste that snippet into your system prompt and the model instantly knows the user.
Frequently Asked Questions
How is Memobase different from mem0, LangMem, or Zep?
Official LOCOMO benchmark: higher accuracy, time-aware search, and you decide which fields to keep.
Is it expensive?
v0.0.38 cut insert cost by 30 % and batch processing keeps the bill tiny for everyday chat.
Which languages are supported?
Official SDKs: Python, Node.js, Go. Raw REST works everywhere.
How do I permanently delete a user?
client.delete_user(uid)
Everything—profiles and events—is gone.
Beyond the Basics
1. Design Your Own Profile Fields
Only need work
and interest
? Edit the config and the generated profile will skip demographics
, saving tokens.
2. Time-Travel Search
Looking for “the lantern the user mentioned last week”?
events = user.search_events(query="lantern", after="2025-07-14")
3. Batch Ad-Matching Example
profiles = user.profile()
for p in profiles:
if p.topic == "work" and "Engineer" in p.content:
ad = "JetBrains 30 % off"
Production Deployment Checklist
-
[ ] Docker 20+ -
[ ] Port 8019 free -
[ ] Postgres + Redis running -
[ ] .env
copied from.env.example
-
[ ] docker compose up -d
-
[ ] curl localhost:8019/health
returns{"status":"ok"}
What to Read Next
-
Interactive Playground – explore memory in the browser, no install. -
Memobase-Playground on GitHub – full Next.js + FastAPI chat template. -
Memobase-Inspector – open-source admin UI with charts and test bench.
Closing Thoughts
Turning AI from a one-off tool into a long-term companion boils down to memory. Memobase solves the three problems that matter:
-
It 「remembers」 the user. -
It 「respects」 your control over what to remember. -
It 「scales」 without breaking the bank.
Run the five steps above, and your AI will finally have a past—and a much better future.