Ctxdb
Stores and retrieves structured context for Large Language Models, optimizing for relevance and token budget.
Ctxdb is a specialized context database designed for Large Language Models (LLMs), enabling them to store information structurally and retrieve only the most relevant pieces for a given query. It goes beyond simple text dumps by segmenting context into semantic layers with distinct expiry rules and employing a hybrid retrieval approach that combines lexical (BM25) and semantic (vector KNN) search, fused with RRF for optimal ranking. Running on Python and SQLite, it seamlessly integrates with Claude as an MCP server, offering robust memory management, structured facts, and token-budgeted context packing to enhance LLM performance and reduce hallucination.