Mahal Systems

Overview › 7Orchestration › a.Routing

Routing

Route work to the right path up front. 2 optimizations.

  1. 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.

    Better quality

    Tier 3 · tuning · changes control flow, knowledge access · data analysis agents · 4 sources, 3 measured

  2. 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.

    Better qualityMore secureBetter governanceBetter for brandHigher costSlower

    Tier 4 · restructuring · changes control flow · any agent · 11 sources, 8 measured

See also

  1. 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.

    Retrieval › Expanding sources

    Better qualityLower cost

    Tier 3 · tuning · changes knowledge access, control flow · retrieval agents · 25 sources, 22 measured

Before you go...

Build better agents, weekly

Our latest research, performance benchmarks, optimization strategies, and updates around AOT development.

One email a week, nothing else. Unsubscribe anytime.