# Supabrain

**Context infrastructure for AI agents.** Private build · Local-first · Answer-free.

## The problem isn't longer context. It's deciding what deserves context.

Supabrain keeps project knowledge outside the model and compiles the smallest fresh, traceable working set an agent needs for the task in front of it.

    PROJECT KNOWLEDGE  →  FAST INDEX  →  CONTEXT COMPILER  →  AGENT
    repository, tests,    persistent,    task-scoped,          bounded
    decisions, history    incremental    hard-budgeted         working set

---

## 01 — The problem

**Context windows got bigger. The allocation problem didn't move.**

An agent accumulates repository files, tool outputs, prior decisions, transcripts, sub-agent results and logs. Most of it is irrelevant to the next action.

A larger window makes carrying all of that possible. It does not make it desirable. Every passage that enters the live context competes for attention with the passages that actually decide the task.

> Availability is not relevance.
>
> The model should not have to read the project to understand the task.

## 02 — How it works

**Four primitives. No answers.**

1. **Persist.** Project knowledge is ingested into one local SQLite store per project, with stable identities and exact provenance.
2. **Index.** A repository change updates a persistent retrieval index incrementally. Unchanged sources are never re-read.
3. **Compile.** A task becomes a bounded evidence working set: scoped retrieval, file-diverse head, hard delivered-text budget.
4. **Verify.** Every passage carries file, line span and content hash. Freshness, exclusions and evidence gaps stay visible.

| Tool | Purpose |
|---|---|
| `supabrain_status` | Project, index and freshness state. Cheap by contract. |
| `supabrain_search` | Fielded lexical retrieval over the persisted index. |
| `supabrain_open` | Primary-key lookup of one evidence block. |
| `supabrain_compile` | The bounded working set for a task, with accounting. |

Exactly four read-only tools over stdio JSON-RPC. Stateless, no server-side conversation state, no repository mutation, no answer field anywhere. Verified from Claude Code and from Codex.

## 03 — Fast Index

**Do the expensive work before the query.**

A search engine does not read the world when the user asks a question. Neither should an agent's context layer. Repository changes update the index; the query path then touches only the postings it needs.

A guard process proves the property rather than asserting it: with the corpus loader and the in-memory index builder made to raise, all seven requests still answered. The query path never touches them.

| Measure | Before | Persisted index |
|---|---|---|
| First search in a fresh MCP process | 12.4 s | **0.083 s** |
| Max resident memory, same process, seven requests | ~650 MB | **139.8 MB** |

- **0.85 s** — first `compile` in the same fresh process.
- **0.26 s** — incremental ingest: 263 candidates re-classified without reading them.
- **10.6 s** — one-time index build over 61,747 passages. Paid once, before the query.

One real repository: the operator's Vision7 store, 1,513 sources and 61,747 passages, measured 2026-08-17 from a fresh `supabrain-api mcp` process. This is a product smoke on a named snapshot, not a benchmark and not a general performance claim. The 0.083 s search was measured on a compacted copy of the store; on the operator's un-compacted 5.1 GB store file the same first search took 1.1 s.

## 04 — The working set

**61,747 passages indexed. A handful enter the model.**

> The index can be large. The live context should not be.

How many blocks a task actually needs is a function of the task, the scope and the budget, not a fixed number. Supabrain makes no token-savings and no answer-quality claim; it makes the selection explicit, budgeted and inspectable.

## 05 — Agent graphs — *direction, not shipped*

**Not every node needs the whole project.**

> The graph decides who works.
>
> Supabrain decides what they need to know.

    TASK · security review
              │
      ┌───────┼───────┐
     AUTH    DATA    DEPS          each with its own working set
      └───────┼───────┘
              │  structured results, not transcripts
        SYNTHESIZER

A graph already draws execution boundaries. Those boundaries can also be context boundaries. Node A does not need Node B's transcript; Node B should not inherit every file Node A opened.

Each node can start from a fresh context and receive only the evidence its bounded job requires. Durable structured results survive the node. Transient context dies with it.

Status: direction, not a shipped capability. The review of whether the existing `compile` contract can serve a bounded node without new tools is delivered with recommendation PARTIAL (four candidate revisions, ruling pending). The private three-node spike has not started. Supabrain is not a graph framework and makes no claim of superiority over graph systems.

## 06 — Real use

**Built by dogfooding, not demos.**

12 genuine sessions · 5 private repositories · 9 real-use defects fixed · defect discovery, not a benchmark.

The nine defects were found by using the system on real work, not by writing demos for it. Each was fixed red-first: a failing regression test against the pre-fix code, green after. One P0, four P1, four P2. None waived at closure.

Retained negative from the same closure: the product tools — `search`, `open`, `compile` — were exercised in one of the twelve sessions.

> Retrieval selects context. It is not a completeness oracle.
>
> Compile is a context reducer, not a truth oracle.

## 07 — Technical surface

**Four read-only tools. One SQLite file. No answer field.**

| | |
|---|---|
| Local | One SQLite store per project, outside the repository. Trusted-local only. |
| MCP | stdio JSON-RPC, read-only, stateless. status / search / open / compile. |
| Provenance | File, line span, content and file hashes, repository commit, deterministic evidence ids. |
| Freshness | current / stale / unverifiable. Repository-level and deliberately coarse. |
| Budgets | Hard delivered-text budget. Whole items are trimmed, never silently truncated. |
| No answers | Supabrain supplies evidence. The agent reasons. |

    supabrain_compile → package
      evidence_items       file · lines · evidence_id
      context_text         within a hard budget
      budget               43 / 700  (recorded demo run)
      freshness            current | stale | unverifiable
      exclusions           reason-tagged, with counts
      evidence_gap_status  visible when evidence is missing
      package_fingerprint  deterministic, timestamp-free
      answer_field_present false

Shape, abbreviated. The budget figure is from a recorded demo run; it is not a general result.

## 08 — Now / Next

**Now — implemented and accepted**

- Persistent Fast Index and incremental ingestion. Accepted 2026-08-18, operational on all five private operator stores.
- Context Compiler. Scoped retrieval, file-diverse head, hard-budget package with reason-tagged exclusions.
- Provenance, freshness, visible gaps, budget accounting.
- Four-tool read-only MCP. Verified from Claude Code and from Codex, byte-identical package fingerprint across clients.
- Operator setup and doctor. One idempotent setup command; expensive verification lives in doctor, status stays cheap.

**Next — direction, not shipped**

- Node-contract context. Review delivered, recommendation PARTIAL, four candidate contract revisions, ruling pending.
- Private three-node graph spike. Bounded private experiment. Not started.
- Context lifecycle. Checkpoint, fresh session, minimal rehydration. Investigation closed PARTIAL; implementation not authorized.

## 09 — Limits

**Boundaries matter.**

- Local and trusted-local only. No hosted runtime, no public binding, no deployment claim.
- No answer generation, and no answer field in any output.
- No production, beta, enterprise or customer-data readiness claim.
- No answer-quality and no token-savings claim. Retrieval is lexical; freshness is repository-level and coarse; nested repositories are reported, not covered.
- Graph context and context lifecycle are direction, not shipped capability.
- Measured figures are product smokes on named snapshots. Negative and null results are retained, not removed.

---

**Large knowledge. Small working set.**

Supabrain — a context layer for agents · private development build.

**Lineage.** Supabrain began as context-allocation research on external long-memory benchmarks in 2026. That strand is frozen and kept as evidence including its negatives: a reranking stack that lost to plain BM25 on real repository tasks, a null result on authority and freshness boosts, and a native-agent pilot closed PARTIAL with no comparative product result. The product that emerged from it is a local context compiler for agents.

supabrain // © Kill The Dragon GmbH, Austria. This page keeps claims bounded: measured results on named snapshots, no answer generation, no production or hosted-readiness claim.

Confidential and proprietary. All ideas, concepts, research approaches, AI workflows, prompts, prototypes, methods, designs, texts, structures, and related materials presented here are owned by Kill The Dragon GmbH, unless expressly stated otherwise. Access to this page does not grant any licence, right of use, or transfer of intellectual property rights. Any copying, reproduction, adaptation, distribution, publication, reverse engineering, model training, or commercial use is prohibited without prior written permission from Kill The Dragon GmbH.
