Memex

Logo

The extra-context layer for AI agents — L1 eviction, sticky L2/L3 context pools, context paging, cold-tier compression.

View the Project on GitHub QiuXu-Tech/memex

Extra context, not just memory

Most “memory” products are note stores or RAG indexes: you curate facts, embed them, and hope retrieval surfaces something useful. Memex starts from a different object — the model’s context window itself.

An agent’s context is scarce, volatile and ordered: tokens compete for attention, old turns get compacted or dropped, and the model can only reason over what is currently paged in. Memex treats conversation and tool history as a context hierarchy, and puts a high-performance layer between raw history and the model window.

The context hierarchy

 raw session / tool history
        │
        ├─ L1  native context window          (the model's working set)
        ├─ L2  session context pool   (10M)    private to this conversation
        ├─ L3  workspace context pool (100M)   shared across sessions in a cwd
        └─ cold context tier                   verbatim, zero-LLM spillover

Terminology: memory concepts → context concepts

What people call it What it actually is here
memory record a context page (verbatim, addressable, with a “when to read” hint)
memory search context lookup / candidate pages for paging-in
memory_open page-in one page to the model window
catalog injection context index for the current window
L1 eviction context spill from the working set
cold tier context swap area (lossless)
capacity compression context compaction (cold spill, optional digests)
memory panel / context ring context budget UI (what is hot/cold, what is shared)

Why it is a layer, not an app

  1. It is window-aware. Operations are tied to the model’s context: eviction ratios, injection budgets, per-model profiles, reasoning-mode guidance.
  2. It is lossless before it is clever. Raw context is archived verbatim; summaries are optional and never the source of truth.
  3. It is automatic. No curation step: capture happens at eviction/compaction, and retrieval is driven by the model’s own tool calls or auto-recall.
  4. It is scoped. L2 is session-scoped and L3 is workspace-scoped; sensitive-content detection can redirect or skip detected spans, but is not a guarantee that all secrets are detected.
  5. It is measured. In the v0.30.0 synthetic 100M-token pool, the SQLite index was 10.7 MiB after writing and 28.3 MiB after cold spill; the measured card-field search median was 10.58 ms before and 28.33 ms after cold spill. These are shared-machine fixture results, not production guarantees (see evaluation and benchmark).

What this changes in practice

Reading guide