A brain for AI agents that actually learns — confidence scoring, negative results, gap detection. pip install attestdb && attest brain install
Project description
Attest
Licensed under the Business Source License 1.1. Free to use, modify, and self-host. Cannot be offered as a competing managed service. Converts to Apache 2.0 after 4 years.
A brain for AI agents that actually learns. Give Claude Code, Cursor, OpenClaw, and any MCP-compatible agent a persistent knowledge system that tracks confidence, records what failed, detects gaps, and gets smarter every session. Free, open source, runs 100% locally.
pip install attestdb
attest brain install
What It Does
Your agent forgets everything between sessions. Attest Brain fixes that:
- Session recall -- prior knowledge (warnings, patterns, dead ends) injected at session start
- Pre-edit warnings -- known bugs and patterns surface before you edit a file
- Post-test fixes -- prior solutions appear when tests fail
- Negative results -- records what was tried and didn't work, so nobody repeats the search
- Confidence scoring -- every fact has a 0-1 score that updates as evidence arrives
- Contradiction resolution -- conflicting claims resolved with principled reasoning
- Gap detection -- finds what the brain doesn't know and flags it
Works with Claude Code, OpenClaw, Cursor, Windsurf, Codex, and Gemini CLI.
Without Brain vs With Brain
| Without | With Brain | |
|---|---|---|
| Same bug, second time | Debug from scratch (40 min) | Brain recalls the fix (3 min) |
| Preferences | Asks the same questions every time | Remembers and applies automatically |
| Dead ends | Re-investigates failed approaches | Skips known failures |
| Knowledge | Resets to zero each session | Compounds over time |
Quick Start
import attestdb
db = attestdb.open("my_knowledge.db")
# Ingest a claim with provenance
db.ingest(
subject=("BRCA1", "gene"),
predicate=("associated_with", "relates_to"),
object=("Breast Cancer", "disease"),
provenance={"source_type": "database_import", "source_id": "PMID:12345"},
confidence=0.9,
)
# Query the knowledge graph
frame = db.query("BRCA1", depth=2)
print(frame.focal_entity.name)
for rel in frame.direct_relationships:
print(f" --[{rel.predicate}]--> {rel.target.name} (conf={rel.confidence:.2f})")
db.close()
MCP Tools (84 total)
The brain exposes 84 MCP tools. Key ones for everyday use:
# Record knowledge
attest_learned("redis client", "v7 needs decode_responses=True", "warning")
attest_negative_result("session auth", "msgpack doesn't work for Redis 7 serialization")
attest_session_end("success", "Fixed auth tests after Redis upgrade")
# Recall knowledge
attest_get_prior_approaches("Redis serialization error")
attest_check_file("payment_handler.py")
attest_research_context("session management")
# Analyze knowledge
attest_blindspots() # Find gaps
attest_confidence_trail("redis client") # See confidence evolution
attest_predict("entity_a", "entity_b") # Causal prediction via graph
CLI
attest brain install # Install brain into your coding tools
attest brain status # View brain statistics
attest brain uninstall # Remove brain from coding tools
attest stats my.db # Show database statistics
attest query my.db BRCA1 # Query knowledge around an entity
attest serve --port 8892 # Start MCP server (SSE/HTTP)
Under the Hood
Attest isn't a thin wrapper over SQLite or a vector store. It's a purpose-built claim-native database with a Rust storage engine.
- 1.3M claims/sec ingestion, 8us entity query (LMDB via heed)
- Atomic claims -- every fact is a (subject, predicate, object) triple with provenance
- Dual IDs --
claim_id(SHA-256, globally unique) +content_id(SHA-256 of S+P+O, for corroboration) - 13 validation rules on every write
- Merkle audit chain -- tamper-evident append-only log
- Graph algorithms -- PageRank, betweenness centrality, SVD embeddings, causal prediction
Core Capabilities
- Provenance-tracked claims -- every fact has a source chain
- Confidence scoring -- evidence-weighted, updates on corroboration
- Confidence decay -- stale knowledge loses confidence over time
- Retraction with cascade --
db.retract("source_123")propagates downstream - Contradiction resolution -- evidence-weighted voting across sources
- Snapshot/Restore --
db.snapshot(path)for backups - Embedding index -- HNSW similarity search via usearch
- Multi-agent research -- agent registration, task queue, federation
- Negative results -- first-class claims that prune the search tree
- Enterprise RBAC -- groups, policies, entitlements for 10K+ orgs (enterprise)
Intelligence Layer (Enterprise)
LLM-powered features (curation, text extraction, connectors, insight engine) are available in attestdb-enterprise:
pip install attestdb-enterprise
Common Errors
ProvenanceError -- Every claim needs provenance={"source_type": "...", "source_id": "..."}. By design: claims without provenance can't be verified.
ImportError: requires attestdb-enterprise -- Methods like ingest_chat() and connect() need the enterprise package. Use db.ingest() for structured claims without it.
database is locked -- Only one process can write to a .attest file. Kill stale processes or use :memory: for testing.
Running Tests
pip install attestdb[dev]
pytest tests/unit/ tests/integration/ # ~1100 tests, <75s
cd rust && cargo test # Rust unit + golden vectors
Documentation
- attestdb.com/brain.html -- Brain landing page
- attestdb.com/quickstart.html -- Quick start guide
docs/02_architecture.md-- Technical architecturedocs/07_design_decisions.md-- Design decisions with rationale
License
Business Source License 1.1 -- free to use, modify, and self-host. Converts to Apache 2.0 after 4 years.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file attestdb-0.1.36.tar.gz.
File metadata
- Download URL: attestdb-0.1.36.tar.gz
- Upload date:
- Size: 547.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c8bb193df30772ea4f7ab34d4f7e17e42dcb8ad97878fc5e6c099c56ebbe8bb
|
|
| MD5 |
87ea9bd24c79b0cbc7cd7984e0848eaa
|
|
| BLAKE2b-256 |
898c4f8ceffc0654ae0e7c8811744dfc91de07532022d3d614cc92df1303c334
|
Provenance
The following attestation bundles were made for attestdb-0.1.36.tar.gz:
Publisher:
publish.yml on omic/attest
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
attestdb-0.1.36.tar.gz -
Subject digest:
8c8bb193df30772ea4f7ab34d4f7e17e42dcb8ad97878fc5e6c099c56ebbe8bb - Sigstore transparency entry: 1191884257
- Sigstore integration time:
-
Permalink:
omic/attest@2b3921ea2028fb2f52ad939e452e2b0443214ce2 -
Branch / Tag:
refs/tags/v0.1.36 - Owner: https://github.com/omic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2b3921ea2028fb2f52ad939e452e2b0443214ce2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file attestdb-0.1.36-py3-none-any.whl.
File metadata
- Download URL: attestdb-0.1.36-py3-none-any.whl
- Upload date:
- Size: 364.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a40cfcb649c4a61d58238c8defe14f444f2ad06caaedcc8785a48d8912fa7b22
|
|
| MD5 |
8d7eb01a7b8bb162afe448781c51a4f7
|
|
| BLAKE2b-256 |
0d8f6a21384c1455503cf39bc781ed125fdc9cdfde9582426e8f0e6bd39e784b
|
Provenance
The following attestation bundles were made for attestdb-0.1.36-py3-none-any.whl:
Publisher:
publish.yml on omic/attest
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
attestdb-0.1.36-py3-none-any.whl -
Subject digest:
a40cfcb649c4a61d58238c8defe14f444f2ad06caaedcc8785a48d8912fa7b22 - Sigstore transparency entry: 1191884262
- Sigstore integration time:
-
Permalink:
omic/attest@2b3921ea2028fb2f52ad939e452e2b0443214ce2 -
Branch / Tag:
refs/tags/v0.1.36 - Owner: https://github.com/omic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2b3921ea2028fb2f52ad939e452e2b0443214ce2 -
Trigger Event:
release
-
Statement type: