Back to directory

ContextFit

A token-native knowledge base for LLM agent memory that keeps storage, indexing, search and graph traversal entirely in discrete token-ID space, decoding text only at the final retrieval step, avoiding embedding APIs and vector databases altogether.

ContextFit

ContextFit retrieves memory for LLM agents without ever converting most of the pipeline into text or float embeddings: content is tokenized once, stored and indexed as integer token IDs, and only decoded back to text at the final step before the LLM sees it. Its authors report roughly half the storage of raw text, since tokens are not repeatedly re-tokenized, and integer-only operations throughout instead of float-based vector math.

The storage layer memory-maps token arrays with delta encoding and Zstd compression; the index layer combines an inverted index over token IDs using Roaring bitmaps, a suffix array for instant exact n-gram search, and BM25 scoring computed directly on token IDs; and a graph layer connects chunks by token n-gram overlap and Jaccard similarity, using MinHash and LSH for fast similarity without floats, with community detection for finding common themes across chunks. Retrieval tokenizes a query, searches these indexes, traverses the graph, and feeds the resulting token IDs directly to an LLM as input_ids.

Structure-aware ingestion understands Markdown headings, plain-text paragraphs, and a project-specific Tabular Markdown ledger format, preserving each format's own structural metadata during chunking.

More in Agent memory

See all 450
  • A long technical guide to AI agent memory: why stateless LLMs need it, the different memory architectures from vector stores to knowledge graphs, and how Cognee implements one as an open-source memory layer.

  • A local, file-based long-term memory layer for a personal AI that never summarizes conversations, keeping every line with a timestamp and searching by time first and words second, rather than retrieving only similar-seeming chunks.

  • NEOTH

    deepwiki.com

    A local-first personal AI daemon in Rust with five memory tiers, consent-gated tools, a WASM plugin sandbox, multi-provider model routing and signed audit logs, aimed at people who want both a daily assistant and a serious coding helper.