Engineering Decision Memory System with CLI + API + MCP, plus a docs frontend in docs.
Software teams usually remember what changed, but lose why it changed. DecisionGraph keeps that reasoning traceable with evidence so teams can move fast without repeating old mistakes.
- Preserve architectural decisions with supporting evidence.
- Answer
why / who / when / what-changedqueries quickly. - Add pre-change guardrails before risky refactors.
- Expose the same decision memory through CLI, HTTP API, and MCP tools.
- Local text/files/directories.
- Git commit history.
- GitHub PRs and Issues.
- Slack export JSON.
- Jira export JSON.
- Generic JSONL event streams.
- Decision query with confidence + warnings.
- Contradiction detection.
- Stale assumption detection from live metrics.
- Summary report and graph snapshot.
- KPI snapshots and scenario checks.
- Evaluation against JSONL benchmark datasets.
- Security audit, doctor checks, release checks.
- Strategy section library/search for GTM and product framing.
python -m pip install -e ".[dev]"
decisiongraph init --reset
decisiongraph seed-demo
decisiongraph serve --host 127.0.0.1 --port 8000Quickstart demo:
Health check:
curl http://127.0.0.1:8000/healthOpen API docs:
http://127.0.0.1:8000/docs
cp .env.example .env
docker compose up --build -dCheck health:
curl http://127.0.0.1:8000/healthTail logs / stop:
docker compose logs -f decisiongraph
docker compose downProduction note:
- If
DECISIONGRAPH_ENV=production, setDECISIONGRAPH_API_TOKENin.env(or setDECISIONGRAPH_REQUIRE_TOKEN_IN_PRODUCTION=falseintentionally).
If you only want terminal usage, skip decisiongraph serve.
python -m pip install -e ".[dev]"
decisiongraph init --reset
decisiongraph seed-demo
decisiongraph chatInside chat, ask questions directly or use commands:
/help
/list 20
/get <decision_id>
/guard <change request>
/contradictions
/stale
/metrics
/graph
/report json
/exit
Non-interactive CLI equivalents:
decisiongraph list
decisiongraph query "Why did we cap payment retries at 2?"
decisiongraph guardrail "Increase retry attempts in payment flow"If decisiongraph command is not available in PATH:
python -m decisiongraph list
python -m decisiongraph query "Why did we cap payment retries at 2?"cd docs
npm install
npm run devdecisiongraph mcpCreate env file:
cp .env.example .envWindows PowerShell:
Copy-Item .env.example .envKey variables:
DECISIONGRAPH_ENV=developmentDECISIONGRAPH_DATA_PATH=data/decisiongraph.jsonDECISIONGRAPH_API_TOKENoptional API key (x-api-keyheader)DECISIONGRAPH_REQUIRE_TOKEN_IN_PRODUCTION=trueblocks startup in production without tokenDECISIONGRAPH_RATE_LIMIT_PER_MINUTE=240per-client rate limit (0disables)DECISIONGRAPH_CORS_ORIGINS=http://localhost:3000,http://127.0.0.1:5173DECISIONGRAPH_GITHUB_TOKENfor GitHub ingestionDECISIONGRAPH_GITHUB_BASE_URL=https://api.github.comSE_URLlegacy fallback (preferDECISIONGRAPH_GITHUB_BASE_URL)GROQ_API_KEY,GROQ_MODELSoptional model integration
Security note:
- Never commit real secrets in
.env. - Commit only
.env.example.
- Seed data and run API:
decisiongraph init --reset
decisiongraph seed-demo
decisiongraph serve --host 127.0.0.1 --port 8000- Ask a why-question:
curl -X POST http://127.0.0.1:8000/api/query \
-H "content-type: application/json" \
-d '{"question":"Why did we cap payment retries at 2?"}'- Run guardrail before change:
curl -X POST http://127.0.0.1:8000/api/guardrail \
-H "content-type: application/json" \
-d '{"change_request":"Increase retry attempts in payment flow"}'- Check stale assumptions:
curl http://127.0.0.1:8000/api/assumptions/staleGET /healthGET /api/report/summary?format=json|markdown
GET /api/decisionsGET /api/decisions/{decision_id}POST /api/queryPOST /api/guardrailGET /api/contradictionsGET /api/assumptions/staleGET /api/metricsPOST /api/metricsGET /api/graph
POST /api/ingestPOST /api/ingest/directoryPOST /api/ingest/gitPOST /api/ingest/jsonlPOST /api/ingest/githubPOST /api/ingest/slack-exportPOST /api/ingest/jira-json
GET /api/scenarios/runGET /api/kpi/snapshotPOST /api/eval/datasetPOST /api/research/scorecardGET /api/research/interview-scriptPOST /api/research/design-partner-progressGET /api/strategy/sectionsGET /api/strategy/section/{section_id}GET /api/strategy/search?q=...GET /api/ops/doctorGET /api/ops/runbookGET /api/ops/release-checkGET /api/ops/security-auditGET /api/schema/info
decisiongraph init [--reset]decisiongraph seed-demodecisiongraph chat [--list-limit 20] [--guardrail-limit 3]decisiongraph list --limit 20decisiongraph get <decision_id>decisiongraph query "..."decisiongraph guardrail "..."decisiongraph contradictionsdecisiongraph stale-assumptionsdecisiongraph metric-set --key ... --value ... [--unit ...]decisiongraph metricsdecisiongraph graphdecisiongraph report --format markdown|json [--output ...]
decisiongraph ingest --source <file> --source-id <id> [--source-type note]decisiongraph ingest-text --source-id <id> --text "..." [--source-type note]decisiongraph ingest-dir --directory <dir> [--pattern "*.md"]decisiongraph ingest-git --repo <repo_path> [--max-commits 200] [--ref HEAD]decisiongraph ingest-jsonl --source <file.jsonl> [--source-type external]decisiongraph ingest-github --owner <org> --repo <name> [--state all]decisiongraph ingest-slack-export --export-dir <dir> [--max-messages 1000]decisiongraph ingest-jira-json --source <jira.json>
decisiongraph scenariosdecisiongraph kpidecisiongraph eval-dataset --dataset <eval.jsonl>decisiongraph research-score --pain-frequency ... --impact ...decisiongraph research-scriptdecisiongraph design-partner-progressdecisiongraph strategy-list | strategy-show <section> | strategy-search "..."decisiongraph doctor | runbook | release-check | security-audit | schema-info
Run stdio server:
decisiongraph mcpTool groups:
- Core tools: query, list, guardrail, contradictions, stale assumptions, metrics, graph, report.
- Ingestion tools: git/jsonl/github/slack/jira connectors.
- Insight tools: scenarios, KPI snapshot, dataset evaluation, research scoring.
- Strategy/Ops tools: strategy sections, doctor, runbook, release check, security audit.
src/decisiongraph/
api.py FastAPI app assembly
service.py Core orchestration logic
store.py JSON store with locking + atomic writes
integrations.py Connectors (git, GitHub, Slack, Jira, JSONL)
mcp_server.py MCP server bootstrap
cli.py Typer CLI entrypoint
api_routes/ API routers
cli_commands/ CLI command groups
mcp_toolsets/ MCP tool groups
tests/ Backend test suite
docs/ Frontend docs app (Vite + React)
assets/ README visual assets
Local quality commands:
python -m pytest -q
cd docs && npm run lint && npm run buildLatest local validation (2026-04-25):
- Backend tests: pass
- Frontend lint: pass
- Frontend build: pass
CI pipeline:
- Round 1 (Core): ingestion, extraction, query, guardrail, contradiction, stale assumptions.
- Round 2 (Surface): connectors + CLI/API/MCP interfaces.
- Round 3 (Outer Ring): insights, strategy, ops, docs, operational checks.
- Keep backward compatibility for API and CLI contracts.
- Add tests for any behavior change.
- Prefer evidence-linked decision entries over free-form notes.
DecisionGraph là hệ thống lưu trí nhớ quyết định kỹ thuật để trả lời nhanh câu hỏi "vì sao code đang như vậy". Bạn có thể ingest từ Git/GitHub/Slack/Jira/JSONL, query theo ngữ nghĩa, chạy guardrail trước refactor, và expose cùng logic qua CLI + API + MCP.
