Drop-in memory layer for ANY AI agent
from memorymesh import Memory
mem = Memory()
mem.store("user likes rust")
mem.query("what does the user like?")
# → ["user likes rust"]pip install memorymeshFor semantic embeddings (recommended):
pip install memorymesh[embeddings]from memorymesh import Memory
mem = Memory() # uses ~/.memorymesh/memory.db
mem.store("user prefers dark mode")
mem.store("working on async refactor")
# Query by semantic similarity
mem.query("theme preference")
# → ["user prefers dark mode"]
mem.query("async work", top_k=5)
# → ["working on async refactor", ...]| Method | Description |
|---|---|
Memory(db_path=None, embedder="auto") |
Create memory. Set embedder="fallback" to skip embeddings model. |
mem.store(content) |
Store a memory (deduped). |
mem.query(query, top_k=3) |
Query by semantic similarity. |
mem.all() |
List all memories. |
- Dead simple – 2 methods:
store()andquery() - Plug-and-play – works out of the box, no config
- Local-first – SQLite + optional sentence-transformers
- Zero deps – falls back to deterministic hashing if no model
Works with any AI agent, tool, or assistant.
Scan Claude Code, Cursor, and OpenCode data across your machine (not just the repo):
# Discover locations
memorymesh scan
# Ingest all provider messages
memorymesh pull -p myproject
# Build portable package for another machine/provider
memorymesh package build -p myproject -o ./udata.tar.gz
# Import on another machine
memorymesh package import ./udata.tar.gz -p myprojectSee docs/U_DATA_PACKAGING.md and docs/STORAGE_PATHS.md.
Export everything for a project (messages, summaries, agent state) as plain text, Markdown, or JSON:
memorymesh export -p myproject --format md -o ./export.md
memorymesh export -p myproject --format txt --clipboard
memorymesh export -p myproject --format json --provider cursorThe TUI (memorymesh tui) adds [7] Export. The HTTP API accepts POST /export with {"project":"...", "format":"md", "clipboard": true}.