Skip to main content

Verifiable State Plane for Autonomous Agents

Project description

Bilinc

Verifiable state plane for autonomous agents.

Bilinc architecture diagram showing the Bilinc State Plane connected to memory types, AGM belief revision, LangGraph checkpointing, MCP server integration, hybrid recall, SQLite/PostgreSQL storage, Z3 verification, and a Merkle audit trail.

PyPI All-time downloads CI GitHub tag Python versions License: BSL 1.1 Tests Stars

pip install bilinc

Most agent memory systems are a vector store with a wrapper. Bilinc is a state plane: every belief can be verified before it lands, logically revised when it conflicts, and audited so an agent can explain what changed and why.

Others store memories. Bilinc manages truth.

Why Bilinc

Long-running agents fail in predictable ways:

  • They store contradictions they never catch.
  • They overwrite useful context with noisy recency.
  • They cannot roll back when memory or tool state goes bad.

Bilinc gives agents a state layer with verification, belief revision, provenance, and rollback built in.

Core capabilities

Area What Bilinc provides
Memory model Working, episodic, procedural, semantic, and spatial memory with per-type decay curves
Recall FTS5 BM25 + vector similarity + knowledge-graph spreading activation, fused with RRF
Belief revision AGM-style EXPAND / CONTRACT / REVISE for conflict-aware updates
Verification Z3 SMT checks at the commit gate
Auditability Merkle-chain provenance, snapshots, diffs, and rollback
Agent integration MCP server, LangGraph checkpoint adapter, Claude Code / Cursor / VS Code / OpenClaw translation
Storage SQLite by default, PostgreSQL optional

Quick start

from bilinc import StatePlane
from bilinc.storage.sqlite import SQLiteBackend

backend = SQLiteBackend("agent_state.db")
sp = StatePlane(backend=backend, enable_verification=True, enable_audit=True)

# Commit a belief: verification and audit happen before write.
sp.commit_sync(
    "user_preference",
    {"theme": "dark", "language": "python"},
    memory_type="semantic",
    importance=0.9,
)

# Recall across FTS5, vector, and graph signals.
results = sp.recall_all_sync("user preference", limit=5)

# Snapshot, mutate, rollback.
snapshot_id = sp.snapshot_sync()
sp.commit_sync("user_preference", {"theme": "light"})
sp.rollback_sync(snapshot_id)

CLI

bilinc --db ./agent.db commit --key USER_PREF --value '{"theme": "dark"}'
bilinc --db ./agent.db recall --key USER_PREF
bilinc --db ./agent.db forget --key USER_PREF
bilinc --db ./agent.db status

# Hermes integration
bilinc hermes bootstrap
bilinc hermes smoke

MCP integration

Bilinc ships as an MCP server for Claude Code, Cursor, and any MCP-compatible agent:

{
  "mcpServers": {
    "bilinc": {
      "command": "python",
      "args": ["-m", "bilinc.mcp_server.server_v2"],
      "env": { "BILINC_DB_PATH": "~/bilinc.db" }
    }
  }
}

MCP tools include: commit_mem, recall, revise, forget, consolidate, contradictions, diff, snapshot, rollback, status, verify, query_graph, bilinc_recall_smart, bilinc_query_analysis, bilinc_event_segment, bilinc_summarize, bilinc_health, bilinc_benchmark, bilinc_export, and bilinc_import.

LangGraph checkpointing

Use Bilinc as a verified persistent checkpoint store for LangGraph agents:

from langgraph.graph import StateGraph
from bilinc import StatePlane
from bilinc.storage.sqlite import SQLiteBackend
from bilinc.integrations.langgraph import LangGraphCheckpointer

sp = StatePlane(backend=SQLiteBackend("checkpoints.db"), enable_verification=True)
checkpointer = LangGraphCheckpointer(sp)

graph = StateGraph(...).compile(checkpointer=checkpointer)

Every checkpoint can flow through Bilinc's revision and verification pipeline, making long-running LangGraph state inspectable and rollback-capable.

Architecture

StatePlane
├── WorkingMemory          PFC-inspired active slots and eviction
├── AGM Engine             EXPAND / CONTRACT / REVISE
├── Dual-Process Arbiter   fast path + deliberate verification path
├── StateVerifier          Z3 SMT contradiction gate
├── AuditTrail             Merkle chain and provenance
├── KnowledgeGraph         entities, relations, spreading activation
├── Hybrid Recall          FTS5 → vector → KG → RRF fusion
├── ContextBudgetRL        adaptive token allocation by memory type
├── Storage                SQLite / PostgreSQL
└── MCP Server v2          stdio + authenticated HTTP

Benchmarks

Benchmark Score Notes
LongMemEval 98.0% Fully local, no LLM
ConvoMem 98.0% 5 categories, real recall pipeline
LoCoMo 90.3% Temporal, causal, and multi-hop recall

These are repository benchmark runs, not hosted-service claims. Reproduce them from the benchmark scripts and fixtures in this repo.

Comparison

Feature Bilinc Mem0 Zep Letta
Z3 formal verification
AGM belief revision
Cryptographic audit trail
Snapshot / diff / rollback
Blind spot detection
Hybrid decay
FTS5 + vector hybrid recall
Knowledge graph
LangGraph checkpoint adapter
MCP server
Fully local mode

Installation

# Core
pip install bilinc

# PostgreSQL backend
pip install "bilinc[postgres]"

# HTTP MCP server
pip install "bilinc[server]"

# Development
pip install -e ".[dev]"
pytest tests/ -v

License

BSL 1.1 — free for personal and research use. Commercial SaaS use is restricted until 2030, then Apache 2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bilinc-1.2.5.tar.gz (140.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bilinc-1.2.5-py3-none-any.whl (127.4 kB view details)

Uploaded Python 3

File details

Details for the file bilinc-1.2.5.tar.gz.

File metadata

  • Download URL: bilinc-1.2.5.tar.gz
  • Upload date:
  • Size: 140.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for bilinc-1.2.5.tar.gz
Algorithm Hash digest
SHA256 203f0a365dbd6ac8e4715c28d4e76b44fb9a4b2f53b482013d5a1871b86c57ce
MD5 00ff9405fd19c5b6ea887f10f1b7f476
BLAKE2b-256 24428b510d144ebbdd604ee44375a4df4ed16c0ee878b0c90f395e5706a69a47

See more details on using hashes here.

File details

Details for the file bilinc-1.2.5-py3-none-any.whl.

File metadata

  • Download URL: bilinc-1.2.5-py3-none-any.whl
  • Upload date:
  • Size: 127.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for bilinc-1.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 aeadab12d470e946eaa6f22ae9a4f7b98dcaeb37f74b1b2331af71612550f598
MD5 cfdcf27a198c8bd97ef87175f1d2b7d9
BLAKE2b-256 773a46255dafcef4051c5ca3dbb4beac99e5dcd4f47f820a5a8dd4237d90c9cc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page