langgraph-langserve-starter
REST API template exposing a LangGraph research agent via LangServe — SQLite thread resume, streaming, Langfuse tracing and a zero-key fake-LLM mode.
langgraph-langserve-starter is an open-source Python template I built that exposes a LangGraph agent as a REST API through LangServe: github.com/AleSZanello/langgraph-langserve-starter.
The problem
Most LangGraph tutorials live in notebooks, and most LangServe examples wrap simple chains rather than state machines. This repo shows the seam between the two done correctly — including resuming a thread over HTTP.
Architecture
- Graph. A
StateGraphwith three nodes — planner (splits a topic into sub-questions), researcher (answers each) and synthesizer (produces a typedResearchReport). State is aTypedDictwhose list fields accumulate throughAnnotated[list, operator.add]reducers. - API. FastAPI with LangServe
add_routespublishes/research/invoke,/research/stream(token and node-event streaming),/research/batchand/research/playground, plus/healthand OpenAPI docs. - Durable threads. A
SqliteSavercheckpointer persists state across requests; passing athread_idin the config resumes an interrupted research session. It is built directly on asqlite3connection so the checkpointer can outlive awithblock. - Observability. Setting Langfuse keys mounts a callback handler on the app, so every invoke or stream produces a Langfuse trace.
- Pluggable model. Google Gemini by default, with OpenAI and Anthropic Claude behind a one-line switch. Web search through Tavily is optional and falls back to LLM-only answers.
- Zero-key mode. Without a Gemini key the server boots with a fake LLM and canned responses; tests use the same fake model with FastAPI's
TestClient, so they run with no network and no keys.
Status
Live, 2026, MIT licensed.
Related
- LangGraph · LangChain · FastAPI · Python
- Durable Execution · Observability · Langfuse · Multi-Agent Systems
- langgraph-ts-agents · local-rag-chatbot — sibling labs
- Ale Zanello