The capstone of the track: expose your Level 2 GraphRAG pipeline as one tool the Level 3 supervisor can choose — and crucially, choose only when the question needs it.
function route(state: State): Tool {
if (state.multiHopNeeded) return 'hybridRetrieve'; // GraphRAG
if (state.question.includes('connected to')) return 'graphExpand';
return 'vectorSearch'; // cheap path
}
Why make it a route, not the default. GraphRAG retrieval is expensive (traversal, larger context). Running it on 'what's the refund window?' wastes money and latency for zero quality gain. The supervisor classifies intent and reserves the graph for genuinely multi-hop or relational questions — naive vector search handles the rest.
Confidence and budget gates. Add a branch that routes low-confidence answers to a critic, and a budget-aware branch that falls back to vector search under cost pressure. The graph tool lives inside the same safety/cost policy as every other tool.
This is where the two halves of the course meet: the knowledge graph and hybrid retrieval (Levels 0–2) become a callable capability inside a state-machine orchestrator (Level 3), with provenance, checkpointing and routing all working together. That composition — not any single piece — is what a production system actually looks like.