Decision-Evidence Graph: traceable, challengeable, temporal decision provenance for AI agents
Project description
DEG — Decision-Evidence Graph
Persistent decision memory for AI agents. DEG records WHY decisions were made, WHAT alternatives were rejected, and WHEN to reconsider — across sessions, with full provenance. It integrates as a Claude Code skill (via MCP + hooks) so decisions are captured and queried automatically, with zero manual documentation maintenance.
Quick Start
pip install degraph[mcp]
cd my-project
deg init --goal "Build a fraud detector" --phase "Research"
deg setup
# Restart Claude Code — DEG is now active
What Happens After Setup
Claude Code will automatically:
- Record decisions with evidence, alternatives, and reconsider-if triggers
- Surface stale decisions when triggers fire (time-based, metric drift, dependency changes)
- Trace provenance chains when you ask "why did we choose X?"
- Challenge decisions when new evidence contradicts them
- Hand off session state so the next session starts with full context
You don't invoke DEG manually. It runs reflexively via hooks and MCP tools.
Core Operations
| Operation | Description |
|---|---|
status() |
Project state, stale alerts, and next actions |
decide() |
Record a decision with evidence, alternatives, and reconsider_if |
evidence() |
Record a finding with source, confidence, and temporal validity |
search(query) |
Hybrid semantic + keyword + graph-walk retrieval |
trace(id) |
Full upstream provenance chain (BFS) |
challenge(id) |
Check validity, triggers, evidence health, and alternatives |
impact(id) |
Downstream cascade — all affected nodes |
continue_research(id) |
Next searches, open questions, and look_for directives |
close_session() |
Save state for the next session |
compile() |
Incremental YAML-to-JSONL+FAISS compilation |
CLI Commands
deg init Initialize a DEG project (creates decisions/, evidence/, .deg/)
deg setup Configure Claude Code skill (CLAUDE.md + MCP + hooks)
deg status Show project state and stale alerts
deg decide Record a decision interactively
deg evidence Record evidence interactively
deg search Search the decision graph
deg trace Trace provenance for a node
deg challenge Challenge a decision's validity
deg impact Show downstream impact of a node
deg continue Show next steps for a research thread
deg close Close session and save state
deg compile Force recompilation of all sources
deg export Export graph as JSON/DOT/Mermaid
deg serve Start MCP server (for non-Claude clients)
MCP Tools
DEG exposes 9 tools via MCP for any compatible AI client:
| Tool | Purpose |
|---|---|
deg_status |
Get project state and alerts |
deg_decide |
Record a decision |
deg_evidence |
Record evidence |
deg_search |
Query the decision graph |
deg_trace |
Get provenance chain |
deg_challenge |
Challenge a decision |
deg_impact |
Get downstream cascade |
deg_continue_research |
Get next research steps |
deg_close_session |
Save session state |
How It Works
decisions/ YAML frontmatter markdown (human-readable, git-friendly)
evidence/ Same format for findings, measurements, sources
.deg/
index.jsonl Compiled node index
graph.jsonl Edge list
embeddings.faiss IDMap2(FlatL2) vector index
state.yaml Session handoff state
Architecture:
- Decisions and evidence are stored as markdown files with YAML frontmatter
deg compileincrementally hashes and indexes them into.deg/(content-hash dedup, ~100x embedding savings)- Claude accesses the graph via MCP tools during conversation
- Hooks auto-fire
deg statuson session start anddeg closeon session end - Retrieval is hybrid: semantic (FAISS) + keyword (BM25-like) + graph walk (Personalized PageRank)
- DEG itself makes zero LLM calls — all intelligence comes from the host agent
Latency: status 0.6ms, decide/evidence 22ms, search 6ms, trace/impact <1ms.
Ecosystem
DEG handles decision provenance. For full agent context, pair with:
- Understand-Anything — code structure graph (replaces architecture docs)
- TinyFish — web research with source tracking
- Probe-Ratchet — deterministic experiment loops with automatic evidence capture
- ML-Intern — deep literature research agent (feeds evidence into DEG)
Together with DEG, these replace all manually-maintained .md files except a minimal CLAUDE.md.
Install Options
pip install degraph[mcp] # Recommended: MCP server + CLI + hooks
pip install degraph # Minimal: CLI only, no MCP
pip install degraph[all] # Full: adds local FAISS semantic search
Requirements
- Python 3.10+
- Claude Code (or any MCP-compatible client)
- No API keys needed — DEG makes zero external calls
License
MIT
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
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 degraph-1.0.1.tar.gz.
File metadata
- Download URL: degraph-1.0.1.tar.gz
- Upload date:
- Size: 174.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cbf60b6ca312d79937ba9142db64ff23e7a0460032b73ea2a5c75712b6e70342
|
|
| MD5 |
dde5e686b63ac6f0a0243cc83fa2ea8c
|
|
| BLAKE2b-256 |
f0279588148ddde10d8d466ebddee6819e37e15c24dc9352f339a73d13a6aa5e
|
File details
Details for the file degraph-1.0.1-py3-none-any.whl.
File metadata
- Download URL: degraph-1.0.1-py3-none-any.whl
- Upload date:
- Size: 59.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
807f24792873371ca4133893afb538da6532a72a2f0a86c5edcf0c1fa59be2e6
|
|
| MD5 |
69344aa597155df1bf7abff5c6781825
|
|
| BLAKE2b-256 |
a446981dd083b3daef7e357118da5b3e14ce64c241ec46d315f80511c422210f
|