Solution
Retrieval Engineering
Find the right evidence at a justified cost, with routes chosen per question.
- Business problem
- Every query runs through one vector index, a large context window and a frontier model, whether it is an exact policy-number lookup or a multi-hop comparison.
- Consequence of failure
- Spend grows with traffic, exact identifiers are missed by semantic search, and P95 latency blocks adoption while quality is never measured.
- Decision supported
- Which retrieval route, context budget and model should each class of question use to meet the quality threshold at the lowest cost?
- Our approach
- We classify queries, route them among keyword, vector, hybrid, graph, SQL, API and approved web retrieval, and tune reranking and context budgets against a reference set and a cost per trusted answer.
Workflow
How the work flows
- Authorized query
- Classify and transform
- Route selection
- Retrieve candidates
- Rerank and diversify
- Assemble context budget
- Grounded answer or abstain
Feedback and exception paths
- Rerank and diversifyRoute selectionlow coverage: escalate route
- Classify and transformGrounded answer or abstaincache hit on same index version
Authorization happens before retrieval. Low coverage escalates to a richer route; cache hits are valid only for the same index version.
- Approval or policy gate
- Agent step
- Side-effecting action
Components
What the solution includes
- Ingestion, parsing and document structure preservation
- Chunking and metadata schema
- Keyword, vector, hybrid, graph, SQL, API and approved web routes
- Query transformation and decomposition
- Reranking and source diversity
- Context assembly and compression
- Model and retrieval routing
- Cache and index versioning
Assumptions and limitations
- The reference set represents production traffic by query class.
- The quality threshold is agreed before cost is optimized.
- Prices and latency are measured on the target deployment, not vendor sheets.
Metrics
How quality is measured
- Recall at k
- Share of required evidence present in the top k results.
- nDCG
- Ranking quality weighted by position.
- P95 latency
- Latency at the 95th percentile, by stage.
- Cost per trusted answer
- Total cost divided by answers meeting the threshold.
Depth
Read it at your depth
Architecture
- Retrieval gateway routes among keyword, vector, graph, SQL, API and web
- Evaluation service runs component and system metrics per route
- Trace store records route, tokens, latency and cost per stage
Schema
RouteDecision {
queryId, queryClass, route: "keyword" | "vector" | "hybrid"
| "graph" | "sql" | "api" | "web" | "abstain"
indexVersion, topK, contextTokens, reranked: boolean
latencyMs: { retrieve, rerank, generate }
costUsd, metThreshold: boolean
}Pseudocode
cls = classify(query)
route = policy.route_for(cls)
while True:
hits = retrieve(route, query, filters=authz(user))
if coverage(hits) >= policy.min_coverage(cls):
break
route = policy.escalate(route)
if route is None:
return abstain("insufficient evidence")
ctx = assemble(rerank_if_needed(hits), budget=policy.tokens(cls))
return generate_grounded(query, ctx)Next steps
Try it, learn it, or engage us
Interactive demonstrationOpen the Cost and Quality CalculatorTutorial and exerciseRetrieval Methods and Intelligent RoutingRoute forty policy questions across four retrieval routes and find the cost-quality frontier.Industry showcaseEnterprise Policy and Knowledge Operations
Related consulting serviceRetrieval and RAG OptimizationImprove relevance, coverage, latency and economics.