Labsco
Cloto-dev logo

CPersona

β˜… 2

from Cloto-dev

Persistent AI memory server with 3-layer hybrid search, confidence scoring, and 16 tools. Zero LLM dependency.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeNeeds API keys
<div align="center">

cpersona

MCP Memory Server

Give Claude persistent memory across sessions. Single SQLite file. 27 tools. Zero LLM dependency.

License: MIT Python Tests

Quick Start Β· Features Β· Architecture Β· All Tools Β· Zenn Book (JP)

</div>

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) β€” Accuracy-improvement work on the 2.4 series is complete (RRF fusion, per-agent threshold calibration, recall-precision control, channel/project isolation). The remaining 2.4.x releases are stabilization only β€” bug fixes, health-check hardening, and performance repairs β€” after which 2.4 will be declared stable. New feature development moves to the 2.5 series.

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.

Features

Hybrid Search β€” Three independent retrieval strategies run in parallel and merge results via Reciprocal Rank Fusion (RRF):

LayerMethodStrength
VectorCosine similarity (jina-v5-nano, 768d)Semantic meaning
FTS5SQLite full-text search with trigram tokenizerExact terms, names, IDs
KeywordFallback pattern matchingEdge cases, partial matches

Memory Types:

  • Declarative memory β€” Individual facts, decisions, instructions stored via store
  • Episodic memory β€” Conversation summaries archived via archive_episode
  • Profile 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 β€” 16 automated detections with auto-repair (contamination, duplicates, FTS desync, invalid data, stale tasks, empty content, invalid sources)
  • Deep 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)     β”‚  β”‚
                         β”‚  β”‚  task_queue   (async jobs)     β”‚  β”‚
                         β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
                         β”‚                                      β”‚
                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                        β”‚ 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

Tested on LMEB (Long-term Memory Evaluation Benchmark) β€” 22 evaluation tasks measuring memory retrieval quality:

Embedding ModelParamsDimensionsMean NDCG@10
MiniLM-L6-v222M38436.88
e5-small33M38446.36
jina-v5-nano33M76854.14

jina-v5-nano achieves +47% improvement over the MiniLM baseline.

All Tools

ToolDescription
storeStore a message in agent memory
recallRecall relevant memories (vector + FTS5 + keyword, RRF merge)
recall_with_contextRecall with external conversation context (auto-dedup)
get_profileGet current agent profile
update_profileSave pre-computed agent profile
archive_episodeArchive conversation episode with summary and keywords
list_memoriesList recent memories
list_episodesList archived episodes
update_memoryUpdate memory content (rejects if locked)
lock_memoryLock memory to prevent deletion/editing
unlock_memoryUnlock memory to allow deletion/editing
delete_memoryDelete a single memory (ownership enforced)
delete_episodeDelete a single episode (ownership enforced)
delete_agent_dataDelete all data for an agent
calibrate_thresholdAuto-calibrate vector search threshold via z-score
set_recall_precisionSet an agent's recall precision (knob 3) and recalibrate its gate
get_recall_precisionRead an agent's effective recall precision (knob 3)
pause_persistenceTurn writes into no-ops for an opt-in TTL window
resume_persistenceRe-enable persistence immediately
persistence_statusReport whether persistence is paused and the TTL remaining
migrate_channel_axisRe-channel bridge-type memories to their concrete channel
export_memoriesExport to JSONL (memories, episodes, profiles)
import_memoriesImport from JSONL (idempotent via msg_id dedup)
merge_memoriesMerge one agent's data into another (atomic, with dedup)
get_queue_statusBackground task queue status
check_healthRegistry-driven health check (severity-tagged issues) with auto-repair
deep_checkDeep semantic data quality analysis with auto-repair

Stats

  • ~5,600 LOC Python across focused modules
  • 146 tests across 12 test modules
  • Schema v10 (auto-migrating)
  • MIT License

Works With

cpersona is an MCP server β€” it works with any MCP-compatible host:

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.

Learn More

License

MIT β€” free to use from any MCP host without restriction.

</div>