Open-source context infrastructure

Memory that knows why it believes.

BCG turns agent trajectories into inspectable beliefs, evidence, confidence, and relationships—then returns the right graph state to the next model call.

Integration
Python SDK · HTTP
Runtime
Agent-agnostic
Artifacts
Local-first
Graph stateresearch-run / 08
Live context
Selected belief · B25

Two independent records identify the same person and location.

Confidence0.78
supports → D04source: search result

Retrieval finds text.
Agents need belief state.

Conversation memory preserves history. Vector memory finds similarity. BCG maintains what an agent currently believes—and makes the path to that belief inspectable.

Questions before an agent actsBCG state
Should I trust this claim?confidence
Where did it come from?provenance
Is another source in conflict?contradiction
What conclusion depends on it?relations
Is it still valid?time
01

Belief-native extraction

Turn raw trajectories into knowledge and decision nodes that preserve source offsets.

02

Deterministic confidence

Inspect the initial score, evidence contribution, and relation-derived factors separately.

03

Typed relationships

Read how beliefs depend on, add context to, or contradict one another.

04

Temporal lifecycle

Track when knowledge formed, how it changed, and which session produced it.

05

Merge and deduplication

Canonicalize repeated beliefs before linking to keep downstream structure compact.

06

Inspectable artifacts

Persist JSON and JSONL state for replay, visualization, and trajectory audits.

Less context.
More useful state.

Default, Summary, and BCG use the same agent model and harness. Only context management changes.

BrowseComp +3.79pp

accuracy over Default

1,266 tasks16.2% fewer total tokens
BrowseComp-ZH +9.69pp

accuracy over Default

289 tasks9.5% fewer total tokens
Full-dataset accuracy, mean token cost, and cumulative token cost comparisons for BrowseComp and BrowseComp-ZH
Agent: gpt-5.6-luna with low-effort thinking. BCG keeps two recent completed turns and injects compact Graph Context. Token Cost includes Agent and Graph Construction tokens.

A context layer,
not another agent framework.

Use BCG beneath your own runtime through Python or HTTP. The bundled terminal agent is only a reference integration.

  1. 01
    Observe

    Stream trajectory turns or load a completed run.

  2. 02
    Construct

    Extract, merge, link, and update confidence.

  3. 03
    Select

    Build compact graph state for the task at hand.

  4. 04
    Inject

    Return belief context to the next model call.

BCG architecture showing agent context management, Python SDK, construction backends, graph pipeline, and graph snapshots

The agent can use what the graph already resolved.

In a successful BrowseComp trajectory, the model explicitly referenced stored belief IDs and confidence, then avoided repeating a completed search.

Model trace “Memory explicitly B53 says age 4, confidence .78, then B51. Answer.”
Open the complete case study
B53 · confidence 0.78

The search result identifies Johanna Catharina Stoffelina Engelbrecht as age 4 and as the daughter of Mrs Alida Maria Hendrika Aletta Engelbrecht.

provenancesearch result
supports final answer

One graph layer.
Three entry points.

from bcg import BCG, BCGMemory, BCGRunner, LLMClient

memory = BCGMemory(graph=BCG())
runner = BCGRunner(
    memory=memory,
    llm=LLMClient(),
    backend="unified",
)

result = await runner.observe_trajectory(turns)
context = memory.context(task="Decide the next action")

Make agent memory
inspectable.

curl -LsSf https://raw.githubusercontent.com/bigai-nlco/belief-context-graph/main/install.sh | sh
Read the quickstart Star on GitHub