CPersona
OfficialCPersona is an MCP memory server that provides persistent, searchable memory for AI agents (like Claude) using a local SQLite database with hybrid search and zero LLM dependency.
Store & Retrieve Memories
store: Save facts/messages with channel and project isolationrecall: Retrieve memories via multi-strategy hybrid search (vector similarity + FTS5 + keyword fallback, merged via Reciprocal Rank Fusion)recall_with_context: Merge recalled memories with external conversation history, auto-deduplicated and sorted chronologicallyarchive_episode/list_episodes/delete_episode: Store and manage conversation summariesget_profile/update_profile: Read and write agent/user profile attributes
Memory Management
list_memories,update_memory,delete_memory: Browse, edit, and remove memorieslock_memory/unlock_memory: Protect important memories from edits or deletiondelete_agent_data: Purge all memories, episodes, and profiles for a specific agent
Search & Calibration
calibrate_threshold: Auto-tune vector search similarity threshold via statistical analysisset_recall_precision/get_recall_precision: Adjust recall strictness (strict/balanced/lenient) per agent
Data Portability
export_memories/import_memories: Backup or migrate to/from JSONL with idempotent deduplicationmerge_memories: Atomically merge one agent's data into another (copy or move mode)migrate_channel_axis: Re-assign memories to their correct concrete channel
Persistence Control
pause_persistence/resume_persistence/persistence_status: Temporarily disable write operations (useful for benchmarking or ephemeral exploration)
Health & Diagnostics
check_health: Run automated database integrity checks (duplicates, FTS desync, stale tasks, etc.) with optional auto-repairdeep_check: Semantic data quality analysis (anonymous sources, short content, orphaned episodes) with optional auto-repairget_queue_status: Monitor background task queue for async jobs
Key Characteristics: No LLM calls are made internally; agent namespaces are isolated in a single SQLite file; supports project-level and per-user source filtering for multi-agent/multi-user scenarios.
CPersona
MCP Memory Server
Give Claude persistent memory across sessions. Single SQLite file. 29 tools. Zero LLM dependency.
Quick Start · Features · Architecture · All 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 (July 2026) — The 2.4 series is the Stable line (latest: v2.4.40, gated by three comprehensive audit rounds — see Quality Assurance). The 2.5 series is the Current line (latest: v2.5.3) — an internal stabilization line that has passed the full release gate and is where all fixes land, pending production-soak certification; the DB schema is preserved across the line, and feature development resumes in 2.6. v2.5.3 refuses to start the HTTP transport when
CPERSONA_AUTH_TOKENis unset, wherever it binds — earlier versions allowed an unauthenticated loopback bind, which a tunnel or reverse proxy silently turns into public exposure (bug-198, HIGH; see Remote HTTP transport). A deployment that deliberately runs without authentication must now say so withCPERSONA_ALLOW_UNAUTHENTICATED_HTTP=true; the stdio transport is unaffected. v2.5.2 changes three things about MCP tool responses —storereports its outcome inresult(stored / skipped / rejected) instead of an always-trueok,check_healthreports the singlestatusverdict without thehealthyboolean, and every tool-level failure a handler returns now carriesok: false(most used to returnerroralone, with nookto branch on; the explanation still travels inerror, except onstore, which puts it inreason). Two shapes stay outside that rule and always did: the outermost MCP dispatch answers an unknown tool name, or an exception escaping a handler, with a bareerrorand nook— that layer is vendored from a library shared with the other Cloto servers, so correcting it is an upstream change rather than a local edit — and a successful read (get_contents,list_memories,list_episodes,get_profile) returns its payload with nookeither. Branch onok is false, and treat a response carryingerroras a failure whether or notokis present. Tiers and support windows: Release Channels & Support.
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.
Related MCP server: mcp-memory-graph
Quick Start
Prerequisites: Python 3.11+ (and uv for the one-command path).
Claude Code? Let the agent do the setup. This repo ships an Agent Skill that walks Claude through the whole installation — cpersona, the embedding server, MCP registration, and a store/recall smoke test — and, more importantly, teaches it when to store, recall, and archive memories afterwards:
# Installed from PyPI? The skill ships inside the wheel — no clone needed: 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)" # Running via uvx (isolated environment), or not installed yet: git clone --depth 1 https://github.com/Cloto-dev/cpersona.git /tmp/cpersona mkdir -p ~/.claude/skills && cp -r /tmp/cpersona/skills/cpersona-memory ~/.claude/skills/Then just tell Claude Code: "Set up CPersona — I want persistent memory." The manual steps below are for Claude Desktop users and anyone who prefers to configure things by hand.
1. Install cpersona
uvx cpersona # run directly, no install step
# or
pip install cpersona # then the `cpersona` command is on your PATHgit clone https://github.com/Cloto-dev/cpersona.git
cd cpersona
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install .Run it with python -m cpersona (or python server.py).
2. Set up Embedding Server (Recommended)
cpersona's hybrid search works best with an embedding server for vector similarity. cpersona is embedding-server-agnostic: point CPERSONA_EMBEDDING_URL (see step 3) at any HTTP endpoint that implements the following minimal contract.
POST /embed
Request: { "texts": ["string", ...] } # non-empty array, max 100 per batch
Response: { "embeddings": [[float, ...], ...], "dimensions": <int> }Contract requirements (2.5.0b1 clarifications):
Embeddings MUST be L2-normalized. cpersona computes similarity as a raw dot product; a backend returning unnormalized vectors biases ranking by vector magnitude. Every supported backend (the client's
apimode and all CEmbedding providers) already normalizes.The contract is role-less — queries and documents are embedded through the same call. Prompt-prefix models (e5-style, prompted bge) will underperform behind it; symmetric or retrieval-merged models (jina-v5-nano, bge-m3, MiniLM) are the intended fit.
Swapping models behind the same URL: cpersona fingerprints the backend by embedding dimension only (the contract carries no model identity). A same-dimension model swap silently invalidates the stored corpus — after one, re-embed (
check_health(fix=true)repairs NULLed rows) andcalibrate_threshold.
The reference server is CEmbedding (MIT) — it runs jina-v5-nano on-device (CPU) and exposes exactly this endpoint:
git clone https://github.com/Cloto-dev/CEmbedding.git && cd CEmbedding
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install ".[onnx]"
python download_model.py --model jina-v5-nano
EMBEDDING_PROVIDER=onnx_jina_v5_nano python server.py # serves http://127.0.0.1:8401/embedcpersona ships with defaults tuned against jina-v5-nano (768d). Any other server that satisfies the contract above works too — see Benchmarks for models with published measurements.
Without an embedding server, cpersona falls back to FTS5 + keyword search only. Vector search (the strongest retrieval layer) will be disabled.
3. Configure your MCP client
Claude Desktop — add to claude_desktop_config.json:
{
"mcpServers": {
"cpersona": {
"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"
}
}
}
}The embedding server from step 2 is a plain HTTP process, not an MCP server — run it however you run background services (a terminal, launchd/systemd, etc.); cpersona only needs its URL.
Windows: use
C:/Users/you/.claude/cpersona.dbfor the DB path. No embedding server yet? Drop the twoEMBEDDING_*lines (or setEMBEDDING_MODE=none) — cpersona runs on FTS5 + keyword and tells you when it's degraded.
Claude Code:
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 userThat's it. Claude now has persistent memory. Ask it to store something and recall it in a later session.
Features
Hybrid Search — Three independent retrieval strategies run in parallel and merge results via Reciprocal Rank Fusion (RRF):
Layer | Method | Strength |
Vector | Cosine similarity (jina-v5-nano, 768d) | Semantic meaning |
FTS5 | SQLite full-text search with trigram tokenizer | Exact terms, names, IDs |
Keyword | Fallback pattern matching | Edge cases, partial matches |
Memory Types:
Declarative memory — Individual facts, decisions, instructions stored via
storeEpisodic memory — Conversation summaries archived via
archive_episodeProfile memory — Accumulated user/project attributes via
update_profile
Confidence Scoring — Each recalled memory gets a confidence score combining:
Cosine similarity (semantic relevance)
Dynamic time decay (adapts to corpus time range — a 1-year-old corpus and a 1-day-old corpus use different decay curves)
Recall boost (frequently useful memories surface more easily, with natural fade-out)
Completion factor (resolved topics decay faster)
Zero LLM Dependency — cpersona is a pure data server. It never calls an LLM internally. All summarization and extraction is performed by the calling agent. This means zero API costs from cpersona itself, deterministic behavior, and no hidden latency.
Additional capabilities:
Agent namespace isolation — multiple agents share one DB without interference
Background task queue — DB-persisted, crash-recoverable async processing
JSONL export/import — full memory portability between environments
Agent-to-agent memory merge — atomic copy/move with deduplication
Auto-calibration — statistical threshold tuning via null distribution z-score (no labels needed)
Health check — a check registry with severity-tagged issues (
critical/warn/info) and auto-repair (contamination, duplicates, FTS integrity, embedding dimension drift, schema objects, isolation-axis hygiene, stale tasks, invalid data), plus apython -m cpersona.checkupCLI for CI gatingDeep check — semantic data quality analysis (anonymous source recovery, short content, stale profiles, orphaned episodes)
Memory protection — lock/unlock to prevent accidental deletion or editing
Recent recall penalty — suppresses echo chamber effect for frequently recalled memories
stdio + Streamable HTTP transport
Single-file SQLite — no external database required
Architecture
┌─────────────────────────────────────┐
│ MCP Host │
│ (Claude Desktop / Claude Code) │
└──────────────┬──────────────────────┘
│ MCP (JSON-RPC)
┌──────────────▼──────────────────────┐
│ cpersona │
│ (server.py) │
│ │
│ ┌─────────┐ ┌─────────┐ │
│ │ store │ │ recall │ ... │
│ └────┬────┘ └────┬────┘ │
│ │ │ │
│ ┌────▼─────────────▼────────────┐ │
│ │ SQLite DB │ │
│ │ │ │
│ │ memories (content + embed) │ │
│ │ episodes (summaries) │ │
│ │ profiles (attributes) │ │
│ │ memories_fts (FTS5 index) │ │
│ │ episodes_fts (FTS5 index) │ │
│ │ pending_memory_tasks (queue) │ │
│ └────────────────────────────────┘ │
│ │
└──────────────┬───────────────────────┘
│ HTTP
┌──────────────▼──────────────────────┐
│ Embedding Server │
│ (jina-v5-nano ONNX, 768d) │
└─────────────────────────────────────┘Recall flow (RRF mode):
Query → ┌── Vector search (cosine similarity) ──┐
├── FTS5 search (episodes + memories) ──┼── RRF merge → Confidence scoring → Top-K
└── Keyword fallback ──┘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.
Two tracks isolate the pipeline's contribution:
Track A — the raw embedding model alone (baseline retrieval).
Track B — the same embeddings routed through cpersona's real
store/recallcode paths: SQLite + FTS5 + RRF fusion + per-agent auto-calibration (cpersona v2.4.40, full-ranking regime).
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 |
cpersona's hybrid pipeline outranks the raw embedding on both models (Track B > Track A) — the fusion layers add signal rather than merely persisting vectors. The weaker the embedding, the larger the pipeline's contribution: the FTS5/keyword layers rescue queries the vector search alone misses. Methodology, the measurement harness, and the reproduction regime live in benchmarks/.
All Tools
Tool | Description |
| Store a message in agent memory |
| Recall relevant memories (vector + FTS5 + keyword, RRF merge) |
| Recall with external conversation context (auto-dedup) |
| Expand recall preview refs ( |
| Get current agent profile |
| Save pre-computed agent profile |
| Read the operator-owned operating context served to every client (read-only; edited on the filesystem) |
| Archive conversation episode with summary and keywords |
| List recent memories |
| List archived episodes |
| Update memory content (rejects if locked) |
| Lock memory to prevent deletion/editing |
| Unlock memory to allow deletion/editing |
| Delete a single memory (ownership enforced) |
| Delete a single episode (ownership enforced) |
| Delete all data for an agent |
| Auto-calibrate vector search threshold via z-score |
| Set an agent's recall precision (knob 3) and recalibrate its gate |
| Read an agent's effective recall precision (knob 3) |
| Turn writes into no-ops for an opt-in TTL window |
| Re-enable persistence immediately |
| Report whether persistence is paused and the TTL remaining |
| Re-channel bridge-type memories to their concrete channel |
| Export to JSONL (memories, episodes, profiles) |
| Import from JSONL (idempotent via msg_id dedup) |
| Merge one agent's data into another (atomic, with dedup) |
| Background task queue status |
| Registry-driven health check (severity-tagged issues) with auto-repair |
| Deep semantic data quality analysis with auto-repair |
Configuration
All settings via environment variables with sensible defaults:
Variable | Default | Description |
|
| SQLite database path, relative to the client's working directory — set it to an absolute path to keep one memory across sessions |
|
| Embedding mode ( |
| (unset) | Embedding server URL, e.g. |
|
| Vector search execution ( |
|
| Recall fusion strategy ( |
|
| Preview tier: max content chars returned by the recall tools ( |
|
| RRF smoothing parameter |
|
| Max characters per stored memory and per profile. Longer writes are truncated; |
|
| Include confidence metadata in results |
|
| Auto-calibrate on startup |
|
| Background task queue (DB-persisted, crash-recoverable) |
|
| Penalty for recently recalled memories |
|
| Window (minutes) for recent recall penalty |
The generic aliases EMBEDDING_MODE / EMBEDDING_HTTP_URL / EMBEDDING_MODEL
are also accepted (the CPERSONA_-prefixed form wins when both are set) — the
marketplace catalog and the Quick Start use the generic names.
Remote (HTTP) transport
The default transport is stdio, where the MCP client owns the process and no
network is involved. Set CPERSONA_TRANSPORT=streamable-http to serve over HTTP
instead — one server, several clients, reachable over a network.
Variable | Default | Description |
|
|
|
|
| Bind address |
|
| Bind port |
| (unset) | Bearer token required on every request |
|
| Run the HTTP transport with no authentication at all |
A loopback bind is not a security boundary. Tunnels (cloudflared, ngrok),
reverse proxies, kubectl port-forward and published container ports all forward
to 127.0.0.1, so binding there says nothing about who can reach the port. Every
tool is exposed to whoever can — including delete_agent_data and the
file-reading/writing export_memories / import_memories. Set
CPERSONA_AUTH_TOKEN whenever the process is not something only you can talk to.
Since v2.5.3 the server enforces that: with CPERSONA_TRANSPORT=streamable-http
and no CPERSONA_AUTH_TOKEN, it refuses to start. If you are upgrading from
2.5.2 or earlier and run the HTTP transport without a token, it will not start
— set CPERSONA_AUTH_TOKEN, or set CPERSONA_ALLOW_UNAUTHENTICATED_HTTP=true to
state that you really do want no authentication (local development only).
Earlier versions allowed an unauthenticated loopback bind and logged that it was
"bound to loopback only", which read as an all-clear and was not one.
Recall fusion mode (CPERSONA_RECALL_MODE)
rrf(default) — Reciprocal Rank Fusion: merges the vector + FTS channels by rank only. Robust and scale-free, but discards score magnitude.rsf— Relative Score Fusion: per-query min-max-normalizes each channel's raw score (cosine for vector, bm25 for keyword) and sums them, so the keyword channel's bm25 magnitude survives the merge. Recommended for topic-drift-prone or space-less language (e.g. Japanese) contexts, where that magnitude is the discriminating signalrrfflattens away (≈ Weaviate'srelativeScoreFusion; see the ClotoCoreRECALL_CONTAMINATION_AB_2026-06-14report §10–12). Caveat: min-max normalization can over-cut small, closely-scored result sets whenautocutis enabled —rrfremains the default until that interaction is hardened.cascade— Sequential channel fill (legacy).
Stats
~10,700 LOC Python across focused modules, plus a 3,300-line vendored MCP common snapshot
608 test functions across 54 test modules — 710 cases once the behavioural matrix is parametrised (~17,800 LOC, more test code than server code), including structural-enforcement gates
Schema v13 (auto-migrating)
MIT License
Works With
cpersona is an MCP server — it works with any MCP-compatible host:
ClotoCore (AI agent platform, where cpersona originated)
Any custom MCP client
Part of ClotoCore
cpersona is the memory layer of ClotoCore, an open-source AI agent platform written in Rust. While cpersona is fully standalone (MIT license), it was designed to give AI agents persistent, searchable memory within the ClotoCore ecosystem.
Quality Assurance
Every release is gated by a machine-verifiable quality process:
Audit-gated releases — before a release is cut, the codebase goes through comprehensive multi-agent audit rounds (independent finders per dimension, each finding adversarially verified from multiple lenses). v2.4.39 shipped after three such rounds — 43 fixes, every one re-verified against the tree it landed on.
Issue registry — every audited defect lives in
qa/issue-registry.jsonwith a machine-checkable code pattern;scripts/verify-issues.shverifies that every fix marker is still present (and every removed defect stays removed), so a regression or a silently-reverted fix fails loudly.Structural CI gates — invariants that a plain test can't express are enforced by AST- and behaviour-level gates in the pytest suite (run in CI on Python 3.11/3.13): every writer holds the shared write lock, agent-scoped SQL carries its isolation predicates, identity/dedup probes carry the project/channel axes, and
check_healthperforms no embedding network I/O while holding the write lock.Release lifecycle standard — the release process itself is specified in
docs/RELEASE_LIFECYCLE_STANDARD.md(v1.0), piloted in this repository as the reference implementation for Cloto-family projects.
Release Channels & Support
Releases follow a three-tier model — Stable (production-certified, critical fixes only), Current (newest release line, all fixes land here), and Experimental (alpha/beta pre-releases, opt-in). When a new line is certified Stable, the previous one keeps critical-fix support for 30 more days, then reaches EOL. Current status: 2.4.x is the Stable line (latest v2.4.40) and 2.5.x is the Current line (latest v2.5.3), where all fixes land while it awaits production-soak certification.
Known issue: v2.4.39 and earlier under-scan vector recall on corpora beyond a few hundred rows (bug-085; v2.4.38–v2.4.39 are the most affected — the limit clamp closed the only workaround). Fixed in v2.4.40; upgrading is strongly recommended. See SUPPORT.md § Known issues.
Known issue (Stable line): the 2.4.x line starts the HTTP transport unauthenticated when
CPERSONA_AUTH_TOKENis unset and the bind is a loopback address (bug-198, HIGH). A loopback bind does not bound reachability — tunnels, reverse proxies,kubectl port-forwardand published container ports all forward to127.0.0.1. If you serve 2.4.x over HTTP, setCPERSONA_AUTH_TOKEN. The startup enforcement that makes a missing token refuse to boot wherever it binds is in the Current line (v2.5.3); the Stable line only warns.
Full policy: SUPPORT.md · specification: RELEASE_LIFECYCLE_STANDARD.md · security reports: SECURITY.md.
Found a bug, or something the docs do not explain?
Open an issue — bug report or feature request.
Reports are welcome even when you are not certain it is a bug. If it turns out to be a configuration problem, that is still useful signal — it means the documentation was unclear, which is a defect of its own. Security vulnerabilities are the one exception: please report those privately via SECURITY.md rather than in a public issue.
Learn More
Zenn Book (Japanese) — Full design walkthrough and setup guide
Replacing /compact with external memory (Japanese) — Measured token economics of the session-end →
/clear→recallworkflowMemory System Design — Technical specification
ClotoCore — The AI agent platform
License
MIT — free to use from any MCP host without restriction.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityAmaintenancePersistent AI memory server with 3-layer hybrid search (vector + FTS5 + keyword), confidence scoring via Reciprocal Rank Fusion, episodic/profile memory, and 16 tools. Zero LLM dependency. Works standalone with Claude Desktop and Claude Code. MIT licensed.Last updated3Business Source 1.1
- AlicenseAqualityAmaintenanceLocal-first memory for Claude Code and any MCP client: hybrid vector + keyword search and a bi-temporal knowledge graph in one SQLite file. Local embeddings, no API key, $0/token.Last updated512011PolyForm Noncommercial 1.0.0
- Flicense-qualityDmaintenanceA lightweight MCP memory server built on SQLite + FTS5, providing cross-session long-term memory for Claude Code.Last updated
- Flicense-qualityDmaintenancePersistent memory server for AI assistants with semantic search and three-layer context (global, project, personality). Works with MCP-compatible AI tools like Claude Code, Cursor, Continue, Cline, and more.Last updated1
Related MCP Connectors
Long-term memory for AI assistants. Hybrid retrieval, query expansion, auto-topics.
Universal memory for AI agents and tools. Save, organize and search context anywhere.
Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Cloto-dev/CPersona'
If you have feedback or need assistance with the MCP directory API, please join our Discord server