pypi cpersonastdioMITupdated 7d ago
Give Claude persistent memory across sessions. Single SQLite file. 30 tools. Zero LLM dependency.
What can you do with CPersona?
CPersona
MCP Memory Server
Give Claude persistent memory across sessions. Single SQLite file. 30 tools. Zero LLM dependency.
Documentation · Getting Started · Architecture · Tools · PyPI · Zenn Book (JP)
Standalone repository — This is the standalone version for use with Claude Desktop, Claude Code, and any MCP client. If you are a ClotoCore user, install CPersona from the in-app marketplace (ClotoHub) instead — it distributes this same repository.
Project status — 2.4.x is Stable; 2.5.x is Current, an internal stabilization line where all fixes land, pending production-soak certification. The DB schema is preserved across the line. Additive, rollback-safe features may land here as well (lifecycle standard §2.6); a change that cannot be rolled back waits for 2.6. Which version to run, and how long each line keeps receiving fixes: SUPPORT.md.
Upgrading from 2.5.2 or earlier? Two things need a decision from you. v2.5.3 will not start the HTTP transport without
CPERSONA_AUTH_TOKEN, wherever it binds — set one, or opt out withCPERSONA_ALLOW_UNAUTHENTICATED_HTTP=true(why; stdio is unaffected). v2.5.2 changed tool response shapes — branch onok is false, and treat any response carryingerroras a failure whether or notokis present (contract §10).
The Problem
Claude forgets everything between sessions. Every conversation starts from zero — no context about your project, your preferences, or what you discussed yesterday.
cpersona fixes this. It's an MCP server that stores memories in a local SQLite file and retrieves them through hybrid search. Claude remembers you. It runs against any MCP-compatible host — Claude Desktop, Claude Code, ClotoCore (the AI agent platform where cpersona originated, and whose memory layer it is), or a client of your own.
Quick Start
Claude Code? Let the agent do the setup. The wheel ships an Agent Skill that installs everything and teaches Claude when to store, recall and archive. Copy it in, then say "Set up CPersona."
python -c "import cpersona,pathlib,shutil; s=pathlib.Path(cpersona.__file__).parent/'skills'/'cpersona-memory'; shutil.copytree(s, pathlib.Path.home()/'.claude/skills/cpersona-memory', dirs_exist_ok=True)"
1. Install — Python 3.11+, and uv for the one-command path.
uvx cpersona # run directly, no install step
pip install cpersona # or install it
2. Run an embedding server (recommended — it powers the vector layer)
uvx --from "cembedding[onnx]" cembedding-download-model --model jina-v5-nano
EMBEDDING_PROVIDER=onnx_jina_v5_nano uvx --from "cembedding[onnx]" cembedding # serves http://127.0.0.1:8401/embed
Any endpoint implementing the embedding contract works. Without one, cpersona runs on FTS5 + keyword search and tells you it is degraded.
3. Register it with your MCP client
claude mcp add-json cpersona '{"type":"stdio","command":"uvx","args":["cpersona"],"env":{"CPERSONA_DB_PATH":"/home/you/.claude/cpersona.db","EMBEDDING_MODE":"http","EMBEDDING_HTTP_URL":"http://127.0.0.1:8401/embed"}}' -s user
That's it. Ask Claude to store something and recall it in a later session.
Claude Desktop config, Windows paths, installing from source and the full walkthrough: Getting Started.
What You Get
- Hybrid search — vector, FTS5 (trigram, so it works on Japanese and other space-less scripts) and keyword, fused by rank or relative score. The FTS and keyword layers rescue what vectors miss: identifiers, error strings, exact names.
- Three memory types — facts, session summaries and an accumulated profile.
- Zero LLM dependency — cpersona never calls a generative model; your agent summarizes and hands over the result. Recall is deterministic given a calibrated gate, but the gate is sampled, so two installs on identical data can settle differently.
- Single-file SQLite — no external database;
sqlite3 .backupcopies the corpus (the calibration sidecar beside it needs copying too). - Operable — auto-calibrated thresholds, a health check with auto-repair, an advisory when the embedding layer dies, JSONL export/import, agent-to-agent merge.
- Isolation —
agent_id,project_idandchannellet several agents and projects share one database without bleeding into each other.
How it fits together: Architecture · what the tools do: Tools · what you may rely on: Behavior Contracts.
Benchmarks
Measured on LMEB (Long-horizon Memory Embedding Benchmark, arXiv:2603.12572) — 22 datasets subsuming LoCoMo and LongMemEval, measured here as 22 retrieval tasks. The metric is Mean NDCG@10 across all 22 tasks. Track A is the raw embedding model alone; Track B routes the same embeddings through cpersona's real store/recall code paths (SQLite + FTS5 + RRF fusion + per-agent auto-calibration).
| Embedding Model | Params | Dim | Track A (raw) | Track B (cpersona) | Δ |
|---|---|---|---|---|---|
| all-MiniLM-L6-v2 | 22M | 384 | 43.67 | 50.10 | +6.43 |
| bge-m3 | 568M | 1024 | 56.83 | 57.66 | +0.83 |
Track B lands at or above Track A on both models: the fusion layers add signal rather than merely persisting vectors, and a weaker embedding gains more because the FTS5/keyword layers rescue what its vectors miss. How to read the deltas, the noise envelope, the measurement harness and the reproduction regime: benchmarks/.
Documentation
cloto-dev.github.io/CPersona is canonical — when this README disagrees with it, the site wins.
| Getting Started | Install, embedding server, client registration, verification |
| Behavior Contracts | What you may rely on: recall ordering, dedup, scan window, response shapes |
| Tools | All 30 tools, grouped by what you reach for them for |
| Architecture | Storage, the retrieval pipeline, isolation axes |
| Operations Runbook | Backup, degradation detection, tuning, CJK guidance, corpus sync |
| Configuration | Every environment variable and its default |
| Quality Assurance | How a release is gated: audits, the bug ledger, structural and mutation gates |
| FAQ | Short answers to the questions operators actually ask |
Japanese translations are in the language selector (English is canonical) and
agents can read llms.txt.
Longer reads in Japanese: a book
on the design and setup, and an article
on the token economics of session-end → /clear → recall.
Quality Assurance
Every release is gated by a machine-verifiable process: multi-agent audit rounds with adversarial verification, a bug ledger that fails CI if a fix marker disappears or a removed defect returns, structural gates for invariants a plain test cannot express, a mutation proof that those gates go red when the invariant is broken, and gates holding the documented counts, defaults and version claims to the source that defines them.
Behind it: ~1,195 test functions across ~99 test modules (~1,520 cases parametrised, more test code than server code), on Schema v13 — how a release is gated.
Support
Three tiers — Stable (production-certified, critical fixes only), Current (newest line, all fixes land here) and Experimental (opt-in pre-releases). A superseded line keeps critical-fix support for 30 more days. Read SUPPORT.md § Known issues before pinning a version — some of them change what you should run.
Found a bug, or something the docs do not explain? Open a bug report or feature request, even when you are not certain — a configuration problem mistaken for a bug means the documentation was unclear, which is a defect of its own. Report security vulnerabilities privately via SECURITY.md.
License
MIT — free to use from any MCP host without restriction.
Install
Add CPersona to your client. Pick the one you use.
claude mcp add cpersona -- uvx cpersonacodex mcp add cpersona -- uvx cpersonaamp mcp add cpersona -- uvx cpersona{
"mcpServers": {
"cpersona": {
"command": "uvx",
"args": [
"cpersona"
]
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"cpersona": {
"command": "uvx",
"args": [
"cpersona"
]
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
code --add-mcp '{"name":"cpersona","command":"uvx","args":["cpersona"]}'Or add the block manually to `.vscode/mcp.json` under `servers`.
{
"mcpServers": {
"cpersona": {
"command": "uvx",
"args": [
"cpersona"
]
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
{
"mcpServers": {
"cpersona": {
"command": "uvx",
"args": [
"cpersona"
]
}
}
}Add to `cline_mcp_settings.json` via the MCP Servers panel.
{
"mcpServers": {
"cpersona": {
"command": "uvx",
"args": [
"cpersona"
]
}
}
}Add to `~/.gemini/settings.json`.
{
"mcpServers": {
"cpersona": {
"type": "local",
"command": "uvx",
"args": [
"cpersona"
],
"tools": [
"*"
]
}
}
}Add to `~/.copilot/mcp-config.json`, or run `/mcp add` inside the CLI.
{
"context_servers": {
"cpersona": {
"command": {
"path": "uvx",
"args": [
"cpersona"
]
}
}
}
}Add to your Zed `settings.json`.
uvx cpersonaRun `goose configure`, choose **Add Extension → Command-line Extension**, and paste this command.
Score
39 / 100
Incomplete
- Documentation25/25
- Maintenance19/25
- Trust13/20
- Capability0/15
- Install experience12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 0 days ago
- Has a release history
- Repository is not archived
- Licensed MIT
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 12 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint — no local install
Version history
| Versions | Published |
|---|---|
| 2.5.3Latest | Jul 30, 2026 |
| 2.5.2 | Jul 29, 2026 |