Skip to main content

Local-first AI memory for Claude Code — capture, distill, and retrieve project knowledge automatically.

Project description

CherryDocs

Memory for AI coding agents. The AI is the user.

AI agents forget everything when a session ends. CherryDocs gives them a local, persistent project memory: what was decided, what failed, what to avoid — captured automatically, distilled into durable memories, and retrievable in any future session.

You set it up once. Your AI uses it every session without being asked.

capture → distill → promote → retrieve

Setup (once, ~2 minutes)

pip install cherry-docs
cherry install            # wires Claude Code hooks + MCP server globally
export ANTHROPIC_API_KEY=sk-ant-...   # recommended for production distillation

That's it. Open any project in Claude Code — CherryDocs is active. Verify anytime with cherry status.

Distillation provider (auto-detected):

  • ANTHROPIC_API_KEY set → Claude Haiku (best quality, ~fractions of a cent per session)
  • No key → local Ollama (ollama pull qwen2.5:7b-instruct) — good for offline/dev

What the AI gets

Tool When the AI uses it
onboard Session start — top memories + recent session state in one call
answer "Why is this code here?" "What did we already try?" "What failed before?"
log_activity Records a decision, fix, or insight that would otherwise be lost
save_checkpoint Structured handoff a blind AI can continue from

Every memory carries provenance: session, branch, commit, files, and the raw evidence events that support it.

How a session flows

  1. AI calls onboard() — gets project memory instantly
  2. Work happens normally; hooks capture prompts, tool use, shell results
  3. On stop/commit, the session is distilled into durable memories (decisions, warnings, procedures, facts — noise is rejected)
  4. Any future session asks answer("why did we switch to X?") and gets the decision with its rationale and evidence

Memory quality, enforced

  • Self-contained memories only — title-only labels ("Steps for X") are rejected at distillation; a memory must teach something actionable
  • No transient noise — test counts, CI status, commit counts, session summaries never become permanent memories
  • Self-healing storecherry consolidate (also auto-run after promotion) merges near-duplicates and archives junk
  • Relevance-first retrieval — token relevance dominates ranking; trust and past-retrieval utility can't carry an irrelevant memory to the top

Check store health: cherry eval --no-llm

CLI

cherry install      # wire into Claude Code globally
cherry status       # hooks + MCP + provider health
cherry consolidate  # merge duplicate memories, archive junk
cherry eval         # memory quality report (add --no-llm for heuristic only)
cherry why <file>   # memories anchored to commits touching <file>
cherry uninstall    # remove hooks + MCP entry

Architecture

  • Store: local JSON at ~/.cherrydocs/promoted/{project_id}.json — no cloud, no DB
  • Transport: MCP over stdio (FastMCP), 4 tools
  • Capture: Claude Code hooks (UserPromptSubmit, PostToolUse, Stop)
  • Distillation: Anthropic Claude Haiku or local Ollama
  • Privacy: secrets detected and redacted before anything persists

Project-scoped first, branch-aware second.

Development

pip install -e '.[dev,anthropic]'
python -m pytest tests/ -q
python scripts/check_size_limits.py
bash scripts/local_pr_gate.sh fast     # before opening a PR

The canonical source for generated agent rules is docs/agent_protocol.toml. More: Product Brief · System Deep Dive


The test that matters: would another AI keep this turned on because it helps?

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

cherry_docs-0.3.0.tar.gz (85.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cherry_docs-0.3.0-py3-none-any.whl (70.1 kB view details)

Uploaded Python 3

File details

Details for the file cherry_docs-0.3.0.tar.gz.

File metadata

  • Download URL: cherry_docs-0.3.0.tar.gz
  • Upload date:
  • Size: 85.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for cherry_docs-0.3.0.tar.gz
Algorithm Hash digest
SHA256 3c268c6ebda08e7c6283b74ab07225f69e0ebaa656e26ba60007f9ae6afb1c30
MD5 61907601a64e09501b63f721c734ec6a
BLAKE2b-256 451d47b686648d9b73bd3313817769226775b24f1bf70c1768dc34a7cd255d5a

See more details on using hashes here.

File details

Details for the file cherry_docs-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: cherry_docs-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 70.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for cherry_docs-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1ed6cd3712f0efd2735cd567a2520f2b16d6797d1bd7b07fc758618b36e7bace
MD5 78e807e328c160a6c70647e92cdc9557
BLAKE2b-256 e19d576fe6bf56d5f9c2991950c81ff151e1cfdc440fd58ade520c159e466d79

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page