liveBook · Manning

Dynamic routing

As explained in Knowledge Graphs and LLMs in Action

Dynamic routing is a workflow technique that selects the next processing path according to runtime state or results.

Dynamic routing selects the next processing path from runtime state, execution results, and user intent. In a LangGraph QA pipeline, it turns query outcomes into retries, summarization, or completion. section 15.1.5

A post-query routing stage applies a compact decision pipeline:

Post-query decision

A failed Neo4j query returns retry until the third attempt; a successful graph query returns summarize; a successful table query returns END.

How Knowledge Graphs and LLMs in Action covers it

How deep it goes
Implements conditional edges with explicit state checks, retry limits, and terminal branches, but does not develop routing theory.
Examples
Uses failed Neo4j queries, graph or map results, and tabular results to demonstrate retry, summarization, and completion.
What it assumes
Assumes an agent state carrying query errors, retry counts, output types, and execution results.
What you can do after
Build it from scratch as a LangGraph conditional edge that returns retry, summarize, or END from agent state.
How it connects
Connects LangGraph state graphs, query execution, text-to-Cypher generation, error handling, visualization intent, and summarization.

Also explained in

Compare how 3 books explain dynamic routing →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Knowledge Graphs and LLMs in Action. The section links point to the parts of the book it draws on.