Hysen Labs
Open-source project
bigai-nlco/belief-context-graph avatar
bigai-nlco

belief-context-graph

A context graph which is based on confidence-aware belief that drives more determinstic reasoning in long-horizon agents.

27 stars0 forksTypeScriptMIT
DEEP OPEN-SOURCE ANALYSIS

Belief context graph gives agents memory they can audit

A probabilistic, temporal, and evidence grounded memory substrate that tracks what an agent should believe and at what confidence.

From retrieval memory to belief memory

Belief Context Graph, or BCG, starts from a complaint about current agent memory systems. Conversation memory preserves history, vector memory retrieves similar fragments, GraphRAG extracts entities and relations, trace memory records tool calls, and temporal knowledge graphs track facts over time. The README argues these systems answer retrieval questions: which text is relevant, which entities relate, what happened before. But an agent doing real work also faces belief questions: should I believe this fact, is it still valid or has it expired, did it come from a reliable source, does it conflict with other evidence, is it certain enough to act on, and did the outcome prove my prior belief wrong. BCG's answer is to upgrade agent memory from retrieval memory to a belief context graph. It is described as a probabilistic, temporal, evidence grounded, and computational memory substrate that helps an agent maintain what to believe, at what confidence, from which evidence, and whether uncertainty should block action. The framing is that this produces memory you can query, audit, and trust, rather than a pile of retrieved text. The shift from retrieval to belief is the project's central claim, and the rest of the README is built to support it with concrete capabilities and a comparison table.

Core capabilities

The listed capabilities describe how BCG works. Belief extraction segments an agent's trajectories, pulls out structured beliefs that matter for reasoning, and links them into a connected graph. Deterministic confidence computes an auditable posterior from an initial confidence, an evidence confidence, and a relation derived factor confidence; source reliability and stance quality set the prior, while relation weights and activation thresholds propagate support or contradiction in a deterministic way. Evidence provenance means every belief carries exact offset source references back to the originating conversation turn, so a claim can be traced. Temporal awareness gives a run based lifecycle with sessions and timestamps, recording when each belief formed and how it evolved. Relation linking adds forward and backward edges between beliefs, forming a causal decision graph or trace. To place this against alternatives, the README includes a feature comparison of BCG against Mem0, Zep, Letta, LangChain Memory, LlamaIndex, TrustGraph, and Semantica across belief native extraction, deterministic confidence, evidence provenance, temporal lifecycle, relation linking, local first artifacts, graph queryability, merge and dedup, conflict detection, and running without a separate database. BCG marks full support for belief native extraction and deterministic confidence where most others show partial or none. The comparison table is the fastest way to see where BCG differs from memory libraries that stop at retrieval. For a team choosing agent infrastructure, that side by side view turns a vague claim about belief tracking into a concrete list of supported and missing behaviors.

Architecture and status

BCG sits as an optional context layer between an agent and its model. In BCG mode the initial user input and recent completed turns stay in the raw context, while older completed turns stream into graph construction; the resulting belief snapshot is then injected into the system prompt. The HTTP service and the Python SDK share the same backend registry, construction pipeline, confidence semantics, and graph artifacts. The README shows a quick start that clones the repo, runs make install, and checks the version with uv run bcg --version, then launches a bundled reference agent with uv run bcg. The first run asks for model credentials, context mode, and graph construction backend, saving choices under a dot bcg directory. On project status, BCG currently provides a belief native memory SDK, unified and hybrid graph construction backends, an optional HTTP service, a reference agent integration, reproducible benchmark tooling, and graph visualization. The next phase has two directions: a more principled probabilistic foundation grounded in Bayesian inference with clearer priors, likelihoods, evidence dependence, contradiction handling, and calibration, and a move toward Deep Research that plans investigations, tracks provenance, reconciles conflicts, and produces auditable outputs. The project requires Python 3.11 to 3.13. The note that older turns stream into graph construction explains how the context window stays bounded as a session grows. By keeping recent turns raw and summarizing the rest into beliefs, the system avoids the cost of feeding the whole history to the model on every step.

Editorial conclusion

The project is released under the MIT license and requires Python 3.11 to 3.13, with an optional reference terminal agent that also needs Node.js 22.19 or newer.

DEEP OPEN-SOURCE ANALYSIS

Official sources

Community notes

Community notes