Overview › 7Orchestration › a.Routing
Routing
Route work to the right path up front. 2 optimizations.
- i.
Route metric questions through a deterministic semantic layer; fall back to text-to-SQL
Where a semantic layer exists, have the agent answer metric questions by choosing metrics and dimensions that the layer compiles to SQL, and write SQL only when the layer cannot answer.
- ii.
Prompt chaining with gate checks
Split a task that decomposes cleanly into fixed steps into a chain of model calls, one goal per call, with a gate between steps: a schema check, an assertion, or a run against the real system, and an LLM check only for subjective criteria.
See also
- 8.a.i
Choose the retriever by corpus size and question type
On a bounded corpus (up to about 100K documents), grep and file reads over the raw text beat an embedding retriever: the agent narrows into documents it has found.