LangGraph + Python + FastAPI (Agentic AI Workflows)
Production architecture for autonomous multi-agent systems, LangGraph cyclic state graphs, Pydantic v2 structured tool calling, and Chroma/Qdrant vector stores.
- Formats
- 4 files
- AGENTS.md
- 43 lines
- CLAUDE.md
- 16 lines
- Languages
- Python
- Updated
- Oct 2026
- Used by
- 4 projects
Writes .claude/skills/langgraph-python-fastapi/SKILL.md
$ curl -s --create-dirs -o .claude/skills/langgraph-python-fastapi/SKILL.md https://stackitfast.com/rules/langgraph-python-fastapi/SKILL.mdRule files
Works with Cursor · Claude Code · Windsurf · AGY
Architecture notes
Architecture Overview
Production architectural standard for autonomous agentic systems built on LangGraph, FastAPI, and Pydantic v2.
Key Advantages
- Stateful Cyclic Workflows: LangGraph supports human-in-the-loop approvals, time-travel debugging, and cyclic reasoning loops where agents evaluate, revise, and retry failed actions.
- Deterministic Tool Calling: Pydantic v2 schemas enforce strict input/output boundaries on tool execution, preventing hallucinated parameters.
- Production Streaming: Async generators stream token-by-token thought processes and tool execution statuses directly to web clients.
Cheap decisions in front of the graph
Not every node needs a generative model. Closed-ended steps such as routing a request, scoring urgency or checking a guardrail can go to a System One decision model like Jev, which returns typed answers with probabilities, while the LangGraph agent handles the steps that need reasoning and text. See FastAPI + Jev decision service.
Frequently asked questions
Does this AGENTS.md work with Cursor, Claude Code, and Windsurf?
Yes — AGENTS.md is the open, cross-tool standard read by Cursor, Claude Code, Windsurf, and 30+ other agents. A dedicated .mdc file is also included for Cursor's native .cursor/rules format.
Why does an agent graph need an explicit recursion_limit?
LangGraph agents can enter cyclic reasoning loops by design — a tool call triggers another tool call, which triggers another, with no guaranteed termination condition. Without a recursion_limit, a single bad prompt or flaky tool response can spin an agent indefinitely, burning API credits and compute until it's killed manually.
Why avoid parsing LLM output with regular expressions?
LLM text output is inherently unstructured and varies between calls even with the same prompt, so regex patterns that work today will silently break on the next model update or an unusual completion. Native structured output or tool calling constrains the model to emit a schema-validated response, which fails loudly and predictably instead of silently mis-parsing.
Used in production
Explore all stacksMindsHub (formerly MindsDB)
1Splitting the client, API and agent into separately versioned git submodules lets each ship on its own cadence (a signed desktop app, a PyPI server package, an agent package), while one Makefile and one docker-compose.yml still bring the whole stack up together.
OpenMAIC
Built as a Next.js app around a set of npm-published packages (slide DSL, generation, renderer, editor, importer, storage). The multi-agent LangGraph pipeline, the slide format and persistence can each be reused or swapped, and heavy video rendering runs in a separate container.
VoiceStudio
Heavy model work stays in a Python FastAPI backend with a pluggable, hardware-aware engine registry. Desktop, web, MCP and remote-worker clients all use the same local API, so voice models run on the user's own GPU without a cloud dependency.
vLLM
vLLM solves GPU memory fragmentation in large language model serving, delivering state-of-the-art throughput on commodity and enterprise hardware.