nulllabtests/belief-agent — explained in plain English
Analysis updated 2026-05-18
Give an LLM agent a memory of what it believes, with confidence scores and evidence, instead of restating facts inconsistently.
Detect when an agent's beliefs contradict themselves and automatically or manually correct them.
Let two agents with different goals negotiate a compromise using structured tradeoff analysis.
Serialize an agent's beliefs to JSON to save and restore its state between sessions.
| nulllabtests/belief-agent | 0xallam/my-recipe | 0xhassaan/nn-from-scratch | |
|---|---|---|---|
| Stars | 0 | — | 0 |
| Language | Python | Python | Python |
| Last pushed | — | 2022-11-22 | — |
| Maintenance | — | Dormant | — |
| Setup difficulty | easy | moderate | moderate |
| Complexity | 3/5 | 2/5 | 4/5 |
| Audience | developer | general | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires Python 3.10 or later, installable from PyPI, and works with any LLM you supply via a callback or LiteLLM.
Belief-Agent is a Python library that adds explicit, trackable beliefs on top of any LLM agent. The problem it addresses is that ordinary LLM agents tend to answer confidently based on whatever pattern matches the conversation, without any real memory of what they previously said or any way to notice when they contradict themselves. Belief-Agent tries to fix that by storing what an agent believes as actual data, rather than leaving it hidden inside the model's weights. The library adds three layers on top of a language model. The first, called BeliefState, is a structured store of beliefs, each with a confidence score between 0 and 1, supporting evidence, any known contradictions, tags, and timestamps. The second, reflection, runs a self-critique loop that reviews existing beliefs, checks them against a language model again, and updates their confidence when contradictions or new evidence appear, either automatically or with a human approving the change. The third, negotiation, lets multiple agents with different goals rank their priorities, analyze tradeoffs, and generate a compromise when their objectives conflict. In practice, you wrap any LLM call, whether that is OpenAI, Claude, a local model, or something else through the LiteLLM integration, inside a BeliefAgent object. You can then have the agent adopt beliefs with a stated confidence level, chat with it normally while its current beliefs get injected into every prompt, and call a reflection function to have it re-examine and update its own beliefs, printing out how each belief's confidence changed and why. Beliefs can be listed, searched by keyword or tag, and serialized to and from JSON so an agent's memory can be saved and restored. The project requires Python 3.10 or later, is installable from PyPI, and its README states it ships with 62 passing tests and 78 percent test coverage. It is released under the MIT License, meaning it can be used, modified, and redistributed freely, including in commercial projects, as long as the license notice is kept.
A Python library that gives LLM agents explicit, trackable beliefs with confidence scores instead of hidden guesses.
Mainly Python. The stack also includes Python, LiteLLM.
MIT License: free to use, modify, and redistribute, including commercially, as long as the license notice is kept.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
double-check against the repo, no cap.