Teaching LLM Agents to Use Semantic Search: Closing the Knowledge Gap with Agentic Retrieval

Hanna Lichtenberg7 Jul 2026

Problem

Teams that give an LLM agent a search tool for legal, financial or research work often find that retrieval fails, not reasoning. Mixedbread compared against an "Oracle" run, where the model gets the right documents with the question. With Codex and its default tools, quality fell by nine points on BrowseComp-Plus and by eight on OfficeQA Pro. Models write keyword-style queries, which a semantic engine handles poorly.

Example from the article: an agent sent "senator woman questions billionaires not a company then okay thank you staff will check hearing" to a semantic search system.

Solution in brief

Mixedbread built a small search agent with four tools and at most four search rounds. The prompt makes the agent state the evidence it needs and write one natural sentence per query. Training combines supervised fine-tuning from a larger teacher with on-policy reinforcement learning, rewarding NDCG of the final ranking and LLM-judge rubrics for query style and effort.

Questions this case answers
  • How to close the quality gap between an agent working with the right documents and the same agent working with a noisy corpus through search tools
  • How to make an agent write natural-language semantic queries instead of keyword strings when its pretraining favors grep and web-style queries
  • How to make an LLM agent write better search queries than keyword strings?
  • How to choose between semantic search, grep and metadata filters inside an agent loop?

Tools and methods

  • Four-tool search harness — overview search, semantic search, filter chunks and grep on the Mixedbread platform.
  • Query-writing prompt design — goal framing, task framing, examples.
  • Supervised fine-tuning from a teacher LLM — gives a small, fast model the search strategy.
  • On-policy reinforcement learning — retrieval reward plus trajectory reward.
  • LLM-as-a-judge — scores relevance, ranking, query naturalness and exploration.
Continue reading — it's free

Google or a one-time email code. No password.