
hypotree
by tygryso
hypotree — Memory That Forgets
A persistent, self-revising hypothesis DAG for agentic R&D — exposed as an MCP server.
Current agent memory is passive: vector stores and scratchpads accumulate facts but never revise them. Hypotree structures the agent's working knowledge as a directed acyclic graph of hypotheses backed by SQLite-WAL. When an experiment fails, the engine walks the dependency edges and retracts what rested on it. When a premise collapses, every dependent subtree is pruned automatically.
What it does
- Write-back belief revision — an ATMS-style engine (de Kleer, 1986) that propagates evidence failures upstream through the dependency graph.
- Cascading prune — invalidating a parent hypothesis instantly transitions its entire subtree to
PRUNED. No tokens spent on dead branches. - Exclusion-group inference — confirming one member of a mutually exclusive group retires the rest as
EXHAUSTEDwithout probing them. - Deduction by elimination — last-man-standing: when all but one alternative in an exclusion group are refuted, the survivor is
VERIFIEDwithout a probe. - Thompson Sampling navigation — Beta-distribution sampling over the open frontier, giving bounded worst-case regret (no catastrophic lock-in).
- Conflict resolution via differential ablation — when an integration test fails but every component passes alone, the engine rebuilds the failing combination one swap at a time to pinpoint the culprit.
- A derivation trail, not just a state —
generate_learning_pathnarrates what was settled, in order, separating what an experiment paid for from what the engine inferred for free, and calling out beliefs that were later withdrawn. - Persistent across sessions, models, agents, users, and projects — the belief state is a SQLite database, not a context window.
Install
# From PyPI
uvx hypotree
# or
pip install hypotree
# From source
git clone https://github.com/tygryso/hypotree.git
cd hypotree
uv sync
Requires: Python 3.10+ · Runs on: Linux, macOS, Windows
Check the install without wiring up a client — the server speaks JSON-RPC on stdin, so starting it in a terminal otherwise looks like a hang:
hypotree --version # or: uvx hypotree --version
hypotree --info # which belief state am I connected to, and where is it?
Quick start
1. Connect to an MCP client
Add hypotree to your MCP client config (Cursor, Cline, Claude Desktop, etc.):
{
"mcpServers": {
"hypotree": {
"command": "uvx",
"args": ["hypotree"],
"env": {
"HYPOTREE_WORKSPACE_ID": "my-project"
}
}
}
}
Or run directly:
uvx hypotree
2. Create hypotheses
The agent creates a tree with parent_ids wiring combinations to their premises and exclusion_group declaring competing answers to one question:
# Agent calls over MCP:
create_hypotheses(hypotheses=[
{"node_id": "catalyst_A", "statement": "Pd/C catalyst works", "exclusion_group": "catalyst"},
{"node_id": "catalyst_B", "statement": "Pt catalyst works", "exclusion_group": "catalyst"},
{"node_id": "catalyst_C", "statement": "Ni catalyst works", "exclusion_group": "catalyst"},
{"node_id
Related servers

n8n
by n8n-io
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

@modelcontextprotocol/server-everything
OfficialMCP server that exercises all the features of the MCP protocol

@modelcontextprotocol/server-filesystem
OfficialMCP server for filesystem access