Local-first agent memory CLI โ dump, diff, migrate & query across Mem0, Letta, and more
Project description
๐ง mnemo
Local-first agent memory CLI โ dump, diff, migrate, and query memories across Mem0, Letta, and your local filesystem.
Agents are finally getting good longโterm memory, but every framework (Mem0, Letta, Supermemory, custom Postgres) stores it differently. mnemo is a gitโlike CLI for agent memory: you can dump, diff, migrate, and query what your agents know, all from your terminal, using a simple normalized schema and localโfirst files. Itโs designed for developers who want to own their agentโs โbrainโ instead of locking it into a single vendor.
Inspired by Mnemosyne (Greek goddess of memory), mnemo is a portable CLI for managing agent memory: capture facts, version-control dumps, compare snapshots, and sync to cloud memory providers โ all from your terminal.
Features
- 15 CLI commands with rich
--helpand tab-completion - Normalized schema โ facts with
{entity, attribute, value, source, timestamp, confidence, metadata.tags} - Multi-provider โ local JSON, Mem0, Letta (stubs โ real APIs with optional deps)
- TF-IDF search โ
mnemo recall "query"with zero external ML deps, filterable by--tag - Rich tables โ confidence color-coded (๐ข โฅ0.8, ๐ก โฅ0.5, ๐ด <0.5)
- HTML + graph diffs โ visual diff between dump snapshots
- MCP server โ FastAPI
/mcp/list_tools+/mcp/call_toolfor Ollama/Claude Code agents - Push/pull sync โ S3, Cloudflare R2, or local filesystem remote; timestamp-based merge
- Safe writes โ
--dry-runon load, pull, and migrate
Quick Start
# Install
pip install mnemo-agent # core (local only)
pip install "mnemo-agent[s3]" # + S3/R2 push-pull sync
pip install "mnemo-agent[all]" # everything (mem0 + letta + parquet + graph + s3)
# Initialize Joshua's job-prep agent
mnemo init --agent job-prep
# Add facts manually (entity defaults to agent name, --tag is repeatable)
mnemo add --fact "Joshua uses React, Node, Supabase, Vercel" --agent job-prep
mnemo add --fact "Joshua is based in Toronto" --agent job-prep --confidence 1.0
mnemo add --fact "Chose Supabase over Firebase for auth" --agent job-prep --attribute decision --tag decision --tag auth
# View stored memories โ plain format shows IDs for retract/edit
mnemo show --agent job-prep
mnemo show --agent job-prep --format plain
# Recall using natural language, optionally filtered by tag
mnemo recall "tech stack" --agent job-prep
mnemo recall "auth" --agent job-prep --tag decision
mnemo search "Supabase database" --agent job-prep --limit 5
# Edit or remove facts by ID (use 'show --format plain' to find IDs)
mnemo retract a1b2c3d4 --agent job-prep
mnemo edit a1b2c3d4 --value "Updated wording" --agent job-prep
# List all agents
mnemo ls --pretty
# Dump to a timestamped file
mnemo dump --agent job-prep
# Load a sample dump
mnemo load --file tests/fixtures/job_prep_sample.json --agent job-prep
# Compare two agents (or two dump files)
mnemo diff --agent-a job-prep --agent-b job-prep-v2
mnemo diff dump1.json dump2.json --html diff_report.html
# Start the MCP server (for Ollama / Claude Code agents)
mnemo serve --agent job-prep --port 8080
# Sync to S3 (prompts for credentials on first add)
mnemo remote add origin s3://my-bucket/mnemo --agent job-prep
mnemo push --agent job-prep
mnemo pull --agent job-prep # merges remote facts into local
๐ All Commands
| Command | Description |
|---|---|
mnemo init --agent <name> |
Initialize agent directory + config |
mnemo add --fact "text" --agent <name> |
Add a memory fact (--entity, --attribute, --tag supported) |
mnemo dump --agent <name> [--source mem0|letta] |
Dump memories to JSON |
mnemo load --file dump.json --agent <name> |
Load dump into local/Mem0/Letta |
mnemo ls [--agent all] |
List agents and fact counts |
mnemo show --agent <name> |
Display agent's latest memories (--format pretty|json|plain) |
mnemo diff --agent-a <a> --agent-b <b> |
Diff two agents (or diff a.json b.json) |
mnemo recall "query" [--tag <tag>] |
TF-IDF search across all agents, optional tag filter |
mnemo search "query" [--limit 10] [--tag <tag>] |
Alias for recall with higher default limit |
mnemo retract <fact-id> --agent <name> |
Remove a fact by ID or 8-char prefix |
mnemo edit <fact-id> --agent <name> |
Edit value/attribute/confidence of an existing fact |
mnemo migrate --dump f.json --target mem0 --agent name |
Migrate between providers |
mnemo serve --agent <name> [--port 8080] [--read-only] |
MCP FastAPI server |
mnemo remote add <name> <url> --agent <name> |
Add a named remote (s3://, r2://, file://) |
mnemo remote list --agent <name> |
List configured remotes |
mnemo remote remove <name> --agent <name> |
Remove a remote |
mnemo push [--remote origin] --agent <name> |
Push local memory to remote |
mnemo pull [--remote origin] --agent <name> |
Pull and merge remote memory into local |
Project Structure
mnemo-agent/
โโโ src/mnemo/
โ โโโ __init__.py # version
โ โโโ cli.py # Click CLI (all commands)
โ โโโ models.py # Pydantic: Fact, AgentDump, MnemoConfig
โ โโโ storage.py # Local file I/O (JSON, YAML, credentials)
โ โโโ search.py # TF-IDF search + diff engine
โ โโโ remotes.py # Push/pull backends: FileBackend, S3Backend
โ โโโ server.py # FastAPI MCP server
โ โโโ adapters/
โ โโโ mem0_adapter.py # Mem0 API โ normalized facts
โ โโโ letta_adapter.py # Letta API โ normalized facts
โโโ tests/
โ โโโ test_cli.py # CLI command tests
โ โโโ test_remote.py # Remote backends, merge, push/pull tests
โ โโโ fixtures/
โ โโโ job_prep_sample.json
โโโ config.yaml # Sample agent config
โโโ pyproject.toml
โโโ requirements.txt
Memory Schema
{
"agent": "job-prep",
"dump_ts": "2026-03-21T23:00Z",
"source": "manual",
"version": "1",
"facts": [
{
"id": "uuid",
"entity": "Joshua",
"attribute": "tech_stack",
"value": "React, Node, Supabase, Vercel",
"source": "chat|tool|manual|mem0|letta|import",
"timestamp": "2026-03-21T20:00Z",
"confidence": 0.95,
"metadata": {}
}
]
}
Example: Project Memory for advisor-prep
{
"agent": "advisor-prep",
"facts": [
{
"id": "uuid-1",
"entity": "advisor-prep-agent",
"attribute": "project_summary",
"value": "CLI + agent that helps students prep for advisor meetings using UBC context.",
"source": "manual",
"timestamp": "2026-03-22T01:00Z",
"confidence": 0.9,
"metadata": { "tags": ["summary", "high-level"] }
},
{
"id": "uuid-2",
"entity": "advisor-prep-agent",
"attribute": "decision",
"value": "Chose Supabase over Firebase for auth due to better Postgres integration.",
"source": "manual",
"timestamp": "2026-03-22T01:05Z",
"confidence": 0.95,
"metadata": { "tags": ["decision", "auth"], "ticket": "ADR-001" }
},
{
"id": "uuid-3",
"entity": "advisor-prep-agent",
"attribute": "stack",
"value": "Next.js, React, Node, Supabase, Vercel.",
"source": "manual",
"timestamp": "2026-03-22T01:10Z",
"confidence": 1.0,
"metadata": { "tags": ["stack"] }
}
]
}
๐ MCP Server (for Ollama / Claude Code)
mnemo serve --agent job-prep --port 8080
| Endpoint | Description |
|---|---|
GET /mcp/list_tools |
List available tools (MCP schema) |
POST /mcp/call_tool |
Call a tool by name with arguments |
GET /facts |
REST: list all facts |
GET /search?q=query |
REST: search memories |
GET /docs |
Swagger UI |
Available MCP tools
{ "name": "search_memory", "description": "TF-IDF search over agent memory" }
{ "name": "list_facts", "description": "Return all facts, optionally filtered" }
{ "name": "upsert_fact", "description": "Add a fact to agent memory" }
{ "name": "get_agent_info", "description": "Agent metadata and fact count" }
โ๏ธ Configuration
Each agent has ~/.mnemo/<agent>/config.yaml:
agent: job-prep
default_source: local
default_target: local
mem0_api_key: null # https://app.mem0.ai
mem0_user_id: joshua
letta_base_url: http://localhost:8283
letta_agent_id: null # from your Letta agent
tags: [job-prep, interview]
notes: Memory store for interview prep agent
remotes:
origin: s3://my-bucket/mnemo
Remote credentials (S3/R2 access keys) are stored separately in ~/.mnemo/credentials with chmod 600. They are populated automatically when you run mnemo remote add โ you will be prompted for them interactively. Pass --no-creds to skip prompting and rely on the standard boto3 credential chain (AWS_ACCESS_KEY_ID env var, ~/.aws/credentials, IAM role).
Environment Variables
| Variable | Description |
|---|---|
MNEMO_AGENT |
Default agent name (skips --agent flag) |
MNEMO_DIR |
Override base directory (default: ~/.mnemo) |
AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY |
S3 credentials (alternative to prompting) |
R2_ACCOUNT_ID |
Cloudflare R2 account ID (alternative to prompting) |
Tests
pip install "mnemo-agent[dev]"
pytest tests/ -v
Roadmap
- Push/pull sync to S3, R2, and local filesystem remotes
- Vector embeddings for semantic search (v2)
- Parquet export for analytics
-
mnemo auditโ fact provenance trace - Web UI dashboard
- Native Ollama MCP client registration
Example Use Case: job-prep Agent
# Bootstrap your interview prep memory
mnemo init --agent job-prep
mnemo load --file tests/fixtures/job_prep_sample.json --agent job-prep
# Ask your agent questions via MCP (Ollama / Claude Code reads from :8080)
mnemo serve --agent job-prep --port 8080
# After a practice interview, add what you learned
mnemo add --fact "Lead with Supabase migration story at FAANG interviews" \
--agent job-prep --attribute interview_tip --confidence 0.9 --tag tip
# Before next session, recall relevant context
mnemo recall "React Supabase full-stack" --agent job-prep
License
MIT ยฉ Joshua Ndala
Project details
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 mnemo_agent-0.3.0.tar.gz.
File metadata
- Download URL: mnemo_agent-0.3.0.tar.gz
- Upload date:
- Size: 40.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54104b7a17ca865d605a181f0692ecb0f9efb8931aba9f189639819c5ce2d52a
|
|
| MD5 |
9576c8abffeb89526cf02fdf16d50e59
|
|
| BLAKE2b-256 |
526e201f22331a76ab0b82f297d3c25dabb1d88009120c015e20c5106a12a40e
|
Provenance
The following attestation bundles were made for mnemo_agent-0.3.0.tar.gz:
Publisher:
publish.yml on joshndala/mnemo-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mnemo_agent-0.3.0.tar.gz -
Subject digest:
54104b7a17ca865d605a181f0692ecb0f9efb8931aba9f189639819c5ce2d52a - Sigstore transparency entry: 1186226712
- Sigstore integration time:
-
Permalink:
joshndala/mnemo-agent@721c6e29528f20fb33bfc646a0d8bdaaba109c8a -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/joshndala
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@721c6e29528f20fb33bfc646a0d8bdaaba109c8a -
Trigger Event:
push
-
Statement type:
File details
Details for the file mnemo_agent-0.3.0-py3-none-any.whl.
File metadata
- Download URL: mnemo_agent-0.3.0-py3-none-any.whl
- Upload date:
- Size: 31.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15ef4c28e936a1df02a562581632bb6ed4fcfd0f1fb47cfb042277722ed778e2
|
|
| MD5 |
1f4b9aa06185ec17a30da6403ea8fb6e
|
|
| BLAKE2b-256 |
48d2b0bddccc176f2bedcb97ab26e89a17f8c1789cec77a2d02f922cf4b16d53
|
Provenance
The following attestation bundles were made for mnemo_agent-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on joshndala/mnemo-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mnemo_agent-0.3.0-py3-none-any.whl -
Subject digest:
15ef4c28e936a1df02a562581632bb6ed4fcfd0f1fb47cfb042277722ed778e2 - Sigstore transparency entry: 1186226718
- Sigstore integration time:
-
Permalink:
joshndala/mnemo-agent@721c6e29528f20fb33bfc646a0d8bdaaba109c8a -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/joshndala
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@721c6e29528f20fb33bfc646a0d8bdaaba109c8a -
Trigger Event:
push
-
Statement type: