Example Gallery (examples_py/)
The examples_py/ directory holds real-world DLG topology configs, adapted from
LangGraph’s official how-to guides. They illustrate graph shapes you can copy into
your own project.
Note
These configs are reference topologies only. The .py files sitting next to
each config are archival stubs from the upstream LangGraph docs repo (each says
“this file has been moved”) — they are not DLG node handlers and the
configs will not DLGEngine.from_file(...) and run as-is. To use a pattern
below, copy the JSON and write your own state.py / nodes.py implementing
the named handlers and routers, following the Hello World
walkthrough.
human_in_the_loop/wait-user-input.json
Agent runs, then pauses for human approval before executing an action.
agent→ conditional routerneeds_human_review→human_review(review) or__end__(end)human_reviewhasinterrupt_before: true→ pauses forCommand(resume=...)human_review→execute→__end__
See Human Review for the minimal working version of this pattern.
customer-support/customer-support.json
Classic router fan-out: one classifier node dispatches to one of several specialist agents.
Entry
router→ conditional routerclassify_intent→billing_agent/technical_agent/general_agentEach specialist agent edges directly to
__end__
chatbots/information-gather-prompting.json
Loop-until-satisfied pattern: keep asking clarifying questions until enough information has been gathered.
gather_info→ conditional routerhas_enough_info→ back togather_info(gather) orrespond(respond)respond→__end__
extraction/retries.json
Structured extraction with per-node retry policy and a validation loop.
extractnode declaresretry_policy(max_attempts: 3, exponential backoff)extract→validate→ conditional routerroute_validation_result→ back toextract(retry) or__end__(end)Uses a
pydanticstate definition instead oftyped_dict
code_assistant/langgraph_code_assistant.json (and ..._mistral.json)
RAG + self-correcting code generation, with two independent check gates.
retrieve→generate→ conditional routerroute_after_generate→check_codeor straight tocheck_hallucinationcheck_code→ conditional routerroute_after_check→ back togenerate(regenerate) orcheck_hallucinationcheck_hallucination→__end__The
_mistralvariant is the same topology with a swappedgenerate_code_mistralhandler — shows how to parameterize a graph per model provider.
chatbot-simulation-evaluation/agent-simulation-evaluation.json (and langsmith-...json)
Simulate a user/chatbot conversation for N turns, then score the transcript.
simulated_user→chatbot→ conditional routershould_continue_simulation→ loop back tosimulated_user(continue) orevaluator(evaluate)evaluator→__end__The
langsmith-...variant adds"settings": {"telemetry": {"enabled": true, "provider": "langsmith"}}and swaps the evaluator node for one that calls LangSmith — see Streaming/telemetry notes for the general telemetry story.
For contributors: if you turn one of these into a fully runnable example (add
state.py + nodes.py), update this page and move it out of the “reference
only” framing above.