Work public

langgraph-agent

LangGraph state-machine agent. Plan, research, write, review with quality gates between phases. 16 tests, SSE streaming, SQLite.

  • agents
  • langgraph
  • state-machine
  • quality-gates
  • fastapi
  • tavily
  • sqlite
Repo
github.com/mj-deving/langgraph-agent
Published
2026-05-26

The problem

A free-running agent loop is hard to debug and harder to verify. A state machine forces the agent to declare which phase it is in, what it needs to enter the next phase, and what artifacts it produced.

LangGraph makes that explicit. This project takes the abstraction and walks a four-phase pipeline behind quality gates.

How it works

Plan, research, write, review. Each transition requires the prior phase to produce a typed artifact and pass a phase-specific gate. Research must produce sources with retrieval evidence. Write must produce a draft against the plan. Review checks the draft against quality criteria and either approves it or kicks it back to write with feedback.

State persists to SQLite. Streams emit via SSE. The 16 tests cover phase contracts and the gate logic. If a gate would fail, the loop does not advance.

Stack

LangGraph for the state machine. FastAPI for the HTTP layer. Tavily for the research lane. SQLite for checkpointing. The state-machine shape is the point.