Universal memory infrastructure for AI agents
Project description
Tokyo Brain
Give your AI agent a memory that never forgets.
Tokyo Brain is universal memory infrastructure for AI agents. Store, recall, and forget — with one API call.
Install
pip install tokyo-brain
Quickstart
from tokyo_brain import Brain
brain = Brain(api_key="tb-...")
# Store a memory
brain.store("User prefers dark mode and speaks Japanese", track="preferences")
# Recall relevant memories
result = brain.recall("What language does the user speak?")
for memory in result.memories:
print(f"[{memory.score:.2f}] {memory.document}")
# Forget specific memories
brain.forget(ids=["mem_abc123"])
# Health check
health = brain.health()
print(f"Status: {health.status} | Version: {health.version}")
Features
| Feature | Description |
|---|---|
| 🌍 50+ Languages | Multilingual embeddings — store in Japanese, recall in English |
| 🏗️ 3-Tier Architecture | Hot (Redis) → Warm (Postgres+pgvector) → Cold (S3) |
| 🔌 Plugin-First | Drop-in memory for LangChain, CrewAI, AutoGen, OpenClaw |
| 🔒 Encryption at Rest | AES-256 encryption for all stored memories |
| 📊 Tracks | Organise memories by track — history, preferences, knowledge |
| ⚡ Sub-50ms Recall | Optimised vector search with HNSW indexing |
API Reference
Brain(api_key, base_url, timeout)
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key |
str |
required | Your API key (starts with tb-) |
base_url |
str |
https://api.tokyobrain.ai |
API endpoint |
timeout |
int |
30 |
Request timeout in seconds |
brain.store(document, track, metadata)
Store a memory document. Returns StoreResult.
brain.recall(query, format, top_k)
Recall memories matching a natural-language query. Returns RecallResult with a list of Memory objects.
brain.forget(ids, where)
Delete memories by ID list or filter. Returns ForgetResult.
brain.health()
Check API health. Returns HealthResult.
Comparison
| Tokyo Brain | Mem0 | Zep | |
|---|---|---|---|
| Multilingual (50+ langs) | ✅ | ❌ | ⚠️ Limited |
| 3-tier storage | ✅ Hot/Warm/Cold | ❌ Single tier | ⚠️ 2-tier |
| Plugin ecosystem | ✅ LangChain, CrewAI, OpenClaw | ⚠️ LangChain only | ⚠️ LangChain only |
| Encryption at rest | ✅ AES-256 | ❌ | ✅ |
| Track-based organisation | ✅ | ❌ | ❌ |
| Sub-50ms recall | ✅ | ❌ | ⚠️ |
| Self-host option | ✅ | ✅ | ✅ |
| Pricing | Free tier + usage | Free tier + usage | Per-seat |
Self-Hosting
docker run -p 9500:9500 tokyobrain/server:latest
Then point the SDK at your local instance:
brain = Brain(api_key="tb-local", base_url="http://localhost:9500")
Documentation
Full documentation at tokyobrain.ai.
License
MIT — see LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tokyo_brain-0.1.0.tar.gz.
File metadata
- Download URL: tokyo_brain-0.1.0.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
025689fcb8934ab1717b770bcb01db543d10b826eed724f1218e850ba442b79f
|
|
| MD5 |
eede28f822fedee40bbc5b821fbb72f5
|
|
| BLAKE2b-256 |
91b1739c93ae307d23b56c04b05298c667c66f8853ca5c125c4f0aa4b339294f
|
File details
Details for the file tokyo_brain-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tokyo_brain-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae9f751f3d901d961a6e6a2e21633d43ead2315de1e37535607ea825d3f018db
|
|
| MD5 |
e3353f8f5baf2d72a6513e9dba3d4e67
|
|
| BLAKE2b-256 |
607dcf7549cd5cc2e8204c6f13b97d4dce6aeef5fc68199eebe65ac3429c35d2
|