Memory

Every new session starts from zero. Your AI forgets everything it learned.

LeanCTX persists sessions, project knowledge, dependency graphs, and agent handoffs across restarts. The Session Survival Engine ensures structured recovery queries survive context compaction, so no critical context is lost mid-task. Facts are stored with confidence scores and automatically decay over time. Knowledge rooms organize information by topic, and structured handoff bundles allow seamless agent-to-agent transitions with full context preservation.

The Problem

Your Agent Forgets Everything

Every time you start a new chat, your AI agent forgets everything: architecture decisions, bug patterns, API conventions, what was tried and failed. You repeat yourself constantly, wasting time and tokens.

ctx_knowledge persists project knowledge across sessions. Ask once, remember forever.

ctx_knowledge
ctx_knowledge ({ action: "search", query: "auth architecture" })
- Found 3 facts (project: my-app)
- 1. JWT with refresh tokens, Redis session store
- 2. RBAC with 4 roles: admin, editor, viewer, guest
- quality: 0.92, last verified: 2h ago
Memory

5 tools

01

Persistent Sessions

Session state survives restarts with checkpoints, compaction, and bounded growth.

02

Project Knowledge

Facts, patterns, contradictions, and bug memory with confidence scoring and decay policies.

03

Multi-Edge Dependency Graphs

Property Graph with multi-edge BFS traversal across imports, calls, exports, type_ref, and tested_by edges with weighted impact scoring.

04

Agent Handoffs

Structured handoff bundles with diary, tasks, and cost attribution across agents.

05

Session Survival Engine

Structured recovery queries survive context compaction - critical decisions, open tasks, and architecture context are preserved automatically.

Protocol

Context Continuity Protocol (CCP)

A persistence protocol ensuring sessions, knowledge, and context survive across agent boundaries.

CCP Protocol
protocol CCP
version v1
pillar Memory
status active
Persistent Sessions
Growing Project Knowledge
Full Graph Coverage
tools

14 MCP tools

LeanCTX persists sessions, project knowledge, dependency graphs, and agent handoffs across restarts. The Session Survival Engine ensures structured recovery queries survive context compaction, so no critical context is lost mid-task. Facts are stored with confidence scores and automatically decay over time. Knowledge rooms organize information by topic, and structured handoff bundles allow seamless agent-to-agent transitions with full context preservation.

ctx_session

Cross-session memory (CCP). Actions: load (restore ~400 tok), save, status, task, finding, decision, reset, list, cleanup, snapshot, restore, resume, profile (context profiles), role (governance), budget (limits), slo (observability), diff (compare sessions), verify (output verification stats), episodes (episodic memory), procedures (procedural memory).

ctx_knowledge

Persistent project knowledge across sessions (facts, patterns, history). Supports recall modes, embeddings, feedback, and typed relations.

ctx_graph

Unified code graph. Actions: build (index), related (connected files), symbol (def/usages), impact (blast radius), status (stats), enrich (add commits+tests+knowledge), context (task-based query), diagram (Mermaid deps/calls).

ctx_impact

Graph-based impact analysis. Actions: analyze|chain|build|status.

ctx_architecture

Graph-based architecture analysis. Actions: overview|clusters|layers|cycles|entrypoints|module.

ctx_callgraph

Unified call graph query. direction=callers|callees for a symbol. Returns file/symbol/line edges.

ctx_callers

Find all symbols that call a given function/method. Deprecated alias for ctx_callgraph direction=callers.

ctx_callees

Find all functions/methods called by a given symbol. Deprecated alias for ctx_callgraph direction=callees.

ctx_agent

Multi-agent coordination (shared message bus + persistent diaries). Actions: register (join with agent_type+role), post (broadcast or direct message with category), read (poll messages), status (update state: active|idle|finished), handoff (transfer task to another agent with summary), sync (overview of all agents + pending messages + shared contexts), diary (log discovery/decision/blocker/progress/insight — persisted across sessions), recall_diary (read agent diary), diaries (list all agent diaries), list, info.

ctx_task

Multi-agent task orchestration. Actions: create|update|list|get|cancel|message|info.

ctx_handoff

Context Ledger Protocol (hashed, deterministic, local-first). Actions: create|show|list|pull|clear.

ctx_share

Share cached file contexts between agents. Actions: push (share files from your cache to another agent), pull (receive files shared by other agents), list (show all shared contexts), clear (remove your shared contexts).

ctx_compress

Context checkpoint for long conversations.

ctx_compress_memory

Compress a memory/config file (CLAUDE.md, .cursorrules, etc.) to save tokens on every session start. Preserves code blocks, URLs, paths, headings, tables. Creates .original.md backup.

Memory

Related Documentation

Verification

Every output carries proof

LeanCTX generates proof artifacts for every session: which files were read, what was compressed, which checks passed, and how tokens were spent. This makes AI work auditable, replayable, and trustworthy.

Explore Memory Tools

LeanCTX persists sessions, project knowledge, dependency graphs, and agent handoffs across restarts. The Session Survival Engine ensures structured recovery queries survive context compaction, so no critical context is lost mid-task. Facts are stored with confidence scores and automatically decay over time. Knowledge rooms organize information by topic, and structured handoff bundles allow seamless agent-to-agent transitions with full context preservation.