AI Agent Frameworks / Quiz
Conditional Edges and Router Testing
add_conditional_edges is where your agent makes decisions. Routers are pure functions, so there is no excuse for not testing every branch.
- Difficulty
- Medium
- Format
- Quiz
- Points
- 150
- Estimate
- 10 min
// MISSION BRIEF
Your Mission
Conditional edges route a LangGraph based on state: a router function inspects the state and returns a key, a mapping sends execution to the matching node. Routing bugs are agent bugs, and routers are the most unit-testable part of the whole stack.
Scoring: equal weight per question.
// FIRST CONTACT
Battle teaser
add_conditional_edges takes which three things?
- AOnly the source node; targets are inferred
- BA source node, a routing function over the state, and a mapping from the router's return values to target nodes
- CTwo nodes and a probability
- DA regex, a callback, and a timeout
Answers, scoring, hints, and the full battle stay sealed.
// SKILL TAGS
langgraphconditional-edgesroutingunit-testingai-agents