Skip to main content

4 docs tagged with "routing"

View all tags

Conditional Edges

A plain addedge("a", "b") always routes from a to b. addconditional_edges routes based on a function of the current state — this is how a graph loops an agent node against a tool node until the model stops requesting calls.

Multi-Tool Routing

Tool selection quality degrades as the tool list grows — with a handful of well-named tools the model picks correctly almost every time; past a few dozen, overlapping descriptions start colliding and the wrong tool gets called more often.

Parallel Execution and Branching

Real chains are rarely a single straight line. RunnableParallel runs several steps against the same input concurrently, RunnablePassthrough threads the original input through unchanged so a later step can still see it, and RunnableBranch picks one path out of several based on a condition.