Lattice
Skip to content

Hybrid retrieval at scale

A ai search stack.

AI search · 100,000 req/mo. At the default case — 100k requests a month, no further constraints — drawn from the 112 tools already in the index. Each pick is a tool whose own skip-when is stated, because a stack built on tools it does not know how to overcommit to is a guess. Describe your case to change it.

The picks

  • One index carrying BM25 and dense vectors, with ranking you can tune.

    Watch out: You need a permissive licence: the Elastic licence is not OSI-approved.

    Consider Turbopuffer instead when high-recall retrieval at volume, without operating the index yourself

  • Local generation with a UI tuned for interactive, long-form use.

    Watch out: You need headless serving at scale.

    Consider llama.cpp instead when the constraint is hardware, not throughput: no GPU, or an edge box

  • A high-throughput OpenAI-compatible proxy with a small footprint.

    Watch out: You need the breadth of a full routing stack.

    Consider Cloudflare AI Gateway instead when edge caching and latency dominate, on Cloudflare already

  • OpenTelemetry-native evaluation you can run yourself.

    Watch out: You want a vendor support contract behind it.

    Consider Braintrust instead when making evaluation, rather than tracing, the primary workflow

The costs and the risks

Estimated cost
$40–$238
per month
A heuristic band from query volume, not a vendor quote.
Confidence
87%
Lower when constraints narrow the field, higher when the workload has a well-worn default.

Cost driversElasticsearch

Biggest risk at the default case: Retrieval quality decides the outcome: most failures are ranking or chunking failures, not model failures. Build the eval set before tuning anything.

Rules of thumb

  • Most bad retrieval is a ranking or chunking problem, not a database problem. Fix the eval set and the chunks before you migrate stores.
  • Benchmark at your concurrency, not at batch size one. A runtime that wins a single-stream demo can lose badly at fifty concurrent users.
  • Route on measured quality, not on price alone. A cheaper model that fails your eval set is not cheaper.
  • Build the eval set before tuning anything. Every later decision in the stack is only as good as the measurement behind it.

Quick answers

What should you run for the AI search stack?
Retrieval: Elasticsearch. Inference: KoboldCpp. Routing: Bifrost. Evals: Arize Phoenix. Retrieval quality decides the outcome: most failures are ranking or chunking failures, not model failures. Build the eval set before tuning anything.
What should you use for retrieval in the AI search stack?
Elasticsearch: one index carrying BM25 and dense vectors, with ranking you can tune. Watch out: you need a permissive licence: the Elastic licence is not OSI-approved. Consider Turbopuffer instead when high-recall retrieval at volume, without operating the index yourself.
What should you use for inference in the AI search stack?
KoboldCpp: local generation with a UI tuned for interactive, long-form use. Watch out: you need headless serving at scale. Consider llama.cpp instead when the constraint is hardware, not throughput: no GPU, or an edge box.
What should you use for routing in the AI search stack?
Bifrost: a high-throughput OpenAI-compatible proxy with a small footprint. Watch out: you need the breadth of a full routing stack. Consider Cloudflare AI Gateway instead when edge caching and latency dominate, on Cloudflare already.
What should you use for evals in the AI search stack?
Arize Phoenix: openTelemetry-native evaluation you can run yourself. Watch out: you want a vendor support contract behind it. Consider Braintrust instead when making evaluation, rather than tracing, the primary workflow.
What does the AI search stack cost per month?
$40–$238 a month at the default case: a heuristic band from query volume, not a vendor quote. Cost drivers: Elasticsearch.

Ask an AI about this page

Opens the assistant with this page’s link and a question already filled in.

A starting point, not a prescription. The recommendation at the default case is what the engine would tell a stranger with your workload; the recommendation at your case is what it tells you once it knows the constraints. The Stack Builder holds both — the builder link preselects this workload and starts with your volumes from here.