Sitewarden
Sole builder — prototype, not deployed
Governed AI operations platform (prototype): LangGraph state graph with human approval gates, Postgres checkpoints, risk-tiered tool gateway, and pgvector hybrid retrieval with citations.
Architecture
Problem
Autonomous AI agents that write to production systems need structured approval workflows — not post-hoc logging. The challenge is building a state graph where a human can interrupt, review, and approve before any consequential action proceeds.
What I built
The state graph runs: plan (decompose goal) → analyse (gather facts via read tools) → self-check (verify plan completeness) → write-report (draft output) → await-approval (human interrupt: approve or revise) → revise (iterate on human feedback). The risk-tiered gateway classifies each tool call: read-only tools proceed automatically; write tools (file system, API mutations) require approval before execution. Postgres checkpoints mean the graph can resume after a process restart without re-running completed steps.
Engineering decisions
- 01
Human interrupt approval is a first-class graph node, not an afterthought — the graph cannot proceed past await-approval without explicit human input.
- 02
Postgres checkpoints make the approval workflow durable: a server restart does not lose pending approvals or completed steps.
- 03
Risk-tiered gateway keeps read tools fast (no approval latency) while requiring explicit approval only for write operations.
- 04
pgvector hybrid search combines dense vector similarity with BM25 keyword matching, then attaches source citations to every retrieved chunk.
- 05
Retrieval evals measure recall at k; trajectory evals verify that the agent chose the right tool sequence for each test scenario.
Outcome
89 tests passing. Retrieval and trajectory evals. CI enforces import rules. Prototype — demonstrates governed agent design patterns.
