Context compaction · build_context

Stop stuffing the prompt. Start with the right facts.

Flooding the context window wastes tokens and buries the signal. abagraph assembles one compact, confidence-ranked, deduped, source-cited packet from your entire fact store, with a single build_context call.

ranked by confidence token-budget-aware source-cited deduped
build_context.json
MCP CALL
{
  "tool": "build_context",
  "args": {
    "seeds": ["acme-corp", "sarah-chen"],
    "token_limit": 1200,
    "as_of": "now"
  }
}
CONTEXT PACKET · 8 FACTS ranked by confidence
0.97 Decision maker: Sarah Chen, VP Product buyer
0.94 Budget cycle closes end of Q3 timeline
0.91 Primary pain: manual reporting overhead pain
0.89 Prefers async-first communication style
0.86 Evaluated competitor X last quarter context
0.83 Champion: Jordan Kim, Sr. Engineer stakeholder
0.79 No contact Fridays, on-call rotation constraint
0.75 Last interaction: demo call Jun 18 history
tokens used 840 / 1,200
01

One call. The right facts.

Without abagraph, agents get everything and understand nothing. With it, one call returns exactly what matters: ranked by confidence, deduped, within your token budget.

BEFORE
NAIVE APPROACH
Dump 40 documents into the prompt
Blows the context window. Most content never gets read.
Stale and duplicated facts compete for attention
No provenance. The model cannot verify any claim.
The model guesses which facts matter, and guesses wrong.
tokens used ~120,000 / 128,000
context window blown
AFTER
ABAGRAPH
One build_context call
Top-ranked facts that fit your declared token budget
Superseded facts collapsed to the single current truth.
Every fact carries its source. The agent can verify.
Ordered by confidence. Strongest signals first.
tokens used ~840 / 128,000
within budget · 127k tokens free for reasoning
02

Six deterministic steps. Every time.

No prompt engineering. No tuning. No guesswork. The right facts arrive in the right order because the pipeline is deterministic. Each fact’s own confidence score decides where it lands.

01
Seeds
Subject entities, goals, or questions that anchor the query
02
Recall
Vector + graph + relational + temporal paths run in parallel
03
Rank
Facts scored by confidence, recency, and relevance to each seed
04
Dedupe
Superseded facts collapsed to the single canonical truth
05
Compact
Top-ranked set trimmed to fit your declared token budget exactly
06
Packet
A structured, source-cited context object ready to inject
build_context · MCP call
JSON-RPC 2.0
{
  "tool": "build_context",
  "args": {
    "seeds":       ["acme-corp", "sarah-chen"],
    "token_limit": 1200,
    "as_of":       "now"
  }
}
 8 facts · 840 tokens · 412 ns recall
WHY IT MATTERS
The agent gets only what it needs. Reasoning stays focused.
Confidence ordering prevents weak facts from overriding strong ones
Bitemporal dedup means no stale data sneaks through
The remaining tokens are free for actual reasoning
03

Confidence is the sort key.

Every fact carries a score from 0.00 to 1.00. Context assembly sorts by it. The agent reads the most trustworthy signal first. Below your threshold, the engine excludes it. It never guesses.

CONTEXT PACKET · CONFIDENCE SIGNALS
Decision maker: Sarah Chen, VP Product 0.97
Budget cycle closes end of Q3 0.94
Primary pain: manual reporting overhead 0.91
Prefers async-first communication 0.89
Evaluated competitor X last quarter 0.86
THRESHOLD 0.80 · ABSTAIN BELOW
Headcount estimate from LinkedIn scrape 0.61
▲ row excluded · below threshold. Agent responds: “I’m not confident enough to act on this. Please verify.”

This is not a filter you write yourself. It is baked into every fact at write time. The agent receives a packet where every item passed a bar you set, not one the model guessed.

Early access open now

Context compaction is one call. The whole engine is underneath it.

build_context sits on top of bitemporal storage, hybrid recall, source-cited provenance, and a durable agent kernel. One engine, not a patchwork.

Join early access Explore the platform →