v12.1.0
thedotmack/claude-memv12.1.0Apr 9, 2026by thedotmack
AI Summary
This release introduces a major Knowledge Agent system that allows users to build queryable AI 'brains' from their Claude observation history, enabling conversational Q&A against compiled corpora with full lifecycle management (build, prime, query, reprime, rebuild, delete). The update includes 6 new MCP tools, 8 HTTP API endpoints, significant security hardening against path traversal and instruction injection, and comprehensive documentation with a Quick Start guide.
Key Highlights
- New Knowledge Agent system for building queryable AI 'brains' from observation history
- 6 new MCP tools: build_corpus, list_corpora, prime_corpus, query_corpus, rebuild_corpus, reprime_corpus
- 8 new HTTP API endpoints on the worker service (/api/corpus/*)
- Security hardening: path traversal prevention, system prompt injection protection, runtime validation
- Comprehensive e2e test suite with 31 tests covering full corpus lifecycle
New Features
- Knowledge Agent system with full lifecycle management (build, prime, query, reprime, rebuild, delete)
- CorpusBuilder - searches observations, hydrates records, calculates stats, persists to ~/.claude-mem/corpora/
- CorpusRenderer - renders observations into full-detail prompt text for 1M token context
- KnowledgeAgent - manages Agent SDK sessions with session resume for multi-turn Q&A
- Auto-reprime - expired sessions automatically reprimed and retried for session errors
- Knowledge agent skill (/knowledge) for guided corpus creation
- Path traversal prevention with alphanumeric name validation + resolved path check
- System prompt hardened against instruction injection from untrusted corpus content
- E2e curl wrappers with connect-timeout and transport failure fallback
Full Release Notes
## Knowledge Agents Build queryable AI "brains" from your claude-mem observation history. Compile a filtered slice of your past work into a corpus, prime it into a Claude session, and ask questions conversationally — getting synthesized, grounded answers instead of raw search results. ### New Features - **Knowledge Agent system** — full lifecycle: build, prime, query, reprime, rebuild, delete - **6 new MCP tools**: `build_corpus`, `list_corpora`, `prime_corpus`, `query_corpus`, `rebuild_corpus`, `reprime_corpus` - **8 new HTTP API endpoints** on the worker service (`/api/corpus/*`) - **CorpusBuilder** — searches observations, hydrates full records, calculates stats, persists to `~/.claude-mem/corpora/` - **CorpusRenderer** — renders observations into full-detail prompt text for the 1M token context window - **KnowledgeAgent** — manages Agent SDK sessions with session resume for multi-turn Q&A - **Auto-reprime** — expired sessions are automatically reprimed and retried (only for session errors, not all failures) - **Knowledge agent skill** (`/knowledge-agent`) for guided corpus creation ### Security & Robustness - Path traversal prevention in CorpusStore (alphanumeric name validation + resolved path check) - System prompt hardened against instruction injection from untrusted corpus content - Runtime name validation on all MCP corpus tool handlers - Question field validated as non-empty string - Session state only persisted after successful prime (not null on failure) - Refreshed session_id persisted after query execution - E2e curl wrappers hardened with connect-timeout and transport failure fallback ### Documentation - New docs page: Knowledge Agents usage guide with Quick Start, architecture diagram, filter reference, and API reference - Knowledge agent skill page with workflow examples - Added to docs navigation ### Testing - Comprehensive e2e test suite (31 tests) covering full corpus lifecycle **Full Changelog**: https://github.com/thedotmack/claude-mem/compare/v12.0.1...v12.1.0