How DoorDash Cut LLM Web Search Costs 98% Without Losing Accuracy

5 min read

Turn on built-in web search in an LLM API and you get grounded answers with one flag. DoorDash's engineers found that convenience was costing them control, money and even clean JSON. So they pulled search out of the model call and put it behind their own gateway. On their production workload, search costs fell by more than 98% and accuracy stayed the same or went up slightly.

The writeup was picked up by InfoQ on November 30, 2026 and is climbing Hacker News. Here is how it works and what you can copy.

The problem with native search

"Native search" means the model provider runs its own search inside the API call and stitches results into the answer. One request goes out, one answer comes back, and you cannot see the middle. DoorDash listed three problems with that:

  • No control. The model and the search engine come as a bundle. Switching models, or reacting to a price change, means touching the model integration.
  • No reuse. Two agents asking the same question pay for two searches.
  • No visibility. You cannot see what each search cost or how long it took.

There was a fourth, sneakier one. Many of their LLM calls are steps in a pipeline where the output must be JSON, an enum or a plain yes or no. With search turned on, models started ignoring "answer only" instructions. On the HotpotQA benchmark, Claude Sonnet 4 with native search broke an explicit answer-only instruction 78.1% of the time by opening with lines like "Based on the search results". The answer was right. The parser still broke.

The fix: Decoupled Search Grounding

DoorDash calls it Decoupled Search Grounding, or DSG. It is a shared gateway that speaks MCP, the Model Context Protocol, so any agent can call it as a tool. The model does the reasoning. The gateway does the searching.

Every search request goes through the same steps:

  1. Normalize the query so small wording differences hit the same cache entry.
  2. Check an exact-match cache. A hit returns instantly with no search bill.
  3. Check a semantic cache, which reuses an earlier result if its embedding is close enough.
  4. Only then call a search provider, walking a fallback list (Serper, Bright Data, Firecrawl, Exa, Tavily) if one times out.
  5. Normalize the results into the same title, URL and snippet shape.
  6. Write both caches, with a time-to-live that depends on how fast that kind of answer goes stale.
  7. Return a structured tool response, which keeps the model's output contract clean.

New providers are added with a YAML file, not code. Every step logs cost, latency and which branch it took.

The numbers

On their query intent workload, with Gemini Flash doing the reasoning and Serper doing the search:

DatasetNative search accuracy, cost per 1,000DSG accuracy, cost per 1,000
General retail, 7,988 queries93.40%, $7.9093.90%, $0.11
Long-tail, 2,335 queries87.62%, $10.3787.79%, $0.146

These costs are the search bill only and leave out model inference.

The shared cache is where it compounds. On a second, warm pass the cache hit rate went from 6.2% to 99.4% and average latency dropped from 4,570 ms to 1,465 ms.

They also turned retrieval depth into a dial. On SimpleQA, going from 2 to 6 search results raised average accuracy from 78.7% to 84.9%. Going to 10 added only 0.6 points more. So 6 became a sensible default.

Where native search still wins

DoorDash is clear about the limits. On FreshQA, which tests very recent facts, native search beat DSG on all five models tested, because the providers' own search indexes are fresher. Multi-hop questions gained little from either kind of single search call. Their conclusion is not "never use native search". It is that search should be a routing choice you control, with native search as one option behind the same interface.

What you can copy this week

You do not need DoorDash's scale to use the idea:

  • Put web search behind one tool your agents share, instead of a flag on each model call.
  • Cache by exact query first, then by embedding similarity, with short expiry for news and long expiry for stable facts.
  • Return search results as a tool response, not text mixed into the answer, if you parse the output.
  • Log cost per search. You cannot cut what you cannot see.

Sources