gitwtfhub

wtf is belief-agent?

nulllabtests/belief-agent — explained in plain English

Analysis updated 2026-05-18

0PythonAudience · developerComplexity · 3/5LicenseSetup · easy

TL;DR

A Python library that gives LLM agents explicit, trackable beliefs with confidence scores instead of hidden guesses.

Mindmap

mindmap
  root((Belief-Agent))
    What it does
      Explicit belief tracking
      Self critique reflection
      Multi agent negotiation
    Tech stack
      Python
      LiteLLM
    Use cases
      Contradiction detection
      Confidence tracking
      Goal negotiation
    Audience
      LLM agent developers
      AI engineers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Give an LLM agent a memory of what it believes, with confidence scores and evidence, instead of restating facts inconsistently.

REASON 2

Detect when an agent's beliefs contradict themselves and automatically or manually correct them.

REASON 3

Let two agents with different goals negotiate a compromise using structured tradeoff analysis.

REASON 4

Serialize an agent's beliefs to JSON to save and restore its state between sessions.

What's in the stack?

PythonLiteLLM

How it stacks up

nulllabtests/belief-agent0xallam/my-recipe0xhassaan/nn-from-scratch
Stars00
LanguagePythonPythonPython
Last pushed2022-11-22
MaintenanceDormant
Setup difficultyeasymoderatemoderate
Complexity3/52/54/5
Audiencedevelopergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min

Requires Python 3.10 or later, installable from PyPI, and works with any LLM you supply via a callback or LiteLLM.

MIT License: free to use, modify, and redistribute, including commercially, as long as the license notice is kept.

Wtf does this do

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.

Yoink these prompts

Prompt 1
Show me how to wrap my existing OpenAI or Claude agent with BeliefAgent.
Prompt 2
Explain how the reflection loop in Belief-Agent detects and updates contradictory beliefs.
Prompt 3
Help me set up a two-agent negotiation between conflicting priorities using this library.
Prompt 4
Walk me through serializing and restoring a BeliefState with belief_agent.

Frequently asked questions

wtf is belief-agent?

A Python library that gives LLM agents explicit, trackable beliefs with confidence scores instead of hidden guesses.

What language is belief-agent written in?

Mainly Python. The stack also includes Python, LiteLLM.

What license does belief-agent use?

MIT License: free to use, modify, and redistribute, including commercially, as long as the license notice is kept.

How hard is belief-agent to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is belief-agent for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.