AIAI EngineerJul 7, 2026· 14:28

How we taught agents to use good retrieval - Hanna Lichtenberg, Mixedbread AI

Mixedbread AI co-founder Amir and AI engineer Hanna Lichtenberg argue the main bottleneck for knowledge agents is not reasoning but retrieval, coining the 'Oracle Gap'—the performance drop when agents use default tools. On BrowsComPlus, Oracle accuracy is 93% but Codex drops 9 points; with Mixedbread's search they recover to within 3 points. They show models write keyword gibberish (e.g., 'Senator, women, questions, billionaires, not a company') because they were trained on code tools like grep. To fix this, they built a search agent with 4 tools (overview, semantic, filter, grep) using a harness that encourages natural query sentences. Training involved supervised fine-tuning from a larger teacher and reinforcement learning with a reward combining retrieval metrics and trajectory quality (e.g., judging if queries are natural sentences). Their agent achieved NDCG@10 of 0.4 on Oblique Congress (vs. 0.18 for GPT multihop) and topped Snowflake's MedQA benchmark with 93.4% accuracy using Gemini 3.5 Flash.

Transcript

Intro0:00

Amir0:01

Hey. Today we're going to talk about how we taught agents to use good retrieval, or how we call it internally: closing the Oracle Gap with knowledge agents.

Hanna Lichtenberg0:11

I'm Hanna. I'm an AI Engineer at Mixedbread, and I'm leading the agentic search at Mixedbread.

Amir0:17

Yeah, I'm Amir. I'm the co-founder of Mixedbread, and let's jump into it. So we have seen over the past years, with the LLMs just getting better and better, that the reasoning capabilities of the models are growing exponentially. So just think back: how good GPT-3.5 was, and how good GPT-5.5 is,right?

It's like a clearly exponential curve. But if you look at search over the last 20 years, basically, we see that it's improving, but it's improving very, very slowly. So there's a huge gap between how, basically, LLMs and the reasoning is evolving, and how retrieval is evolving.

But these retrieval tools are the main access pattern for this reasoning layer to get theright knowledge and to be truly useful beyond code, like in legal work, in finance work, and so on and so forth. Internally, we call this gap happeningright now between reasoning and search the knowledge gap.

And it's not just one obscure theory of ours. We see it actually with real benchmarks and real tasks that this gap exists in the real world as well. Let's take two benchmarks here: BrowsComPlus and Office QA Pro. BrowsComPlus is like a browsing benchmark where we have pretty complex queries and a corpus of 100,000 documents, and we just try to answer these questions.

It's like a real-world deep search task, basically. And Office QA Pro, which has the treasuries of the US treasuries of the past 100 years, basically, and we ask really complex questions over this. Office QA Pro was created by Databricks, and BrowsCom was created by OpenAI, and BrowsComPlus is a version of it with a fixed-size corpus, while BrowsCom was always an open web.

And we see here the Oracle performance in dotted lines. And Oracle means: what is the maximum theoretical performance of the models if we would put in theright documents with the question? We see for

BrowsCom it's 93%, and for Office QA Pro it's 64%. And now we take something like Codex with its default tools and want to see, hey, what is the performance these tools getright now? And you see there's a sharp drop in the quality of the answers Codex produces.

For BrowsCom it's 9 points, and for Office QA Pro it's 8 points. So we see that the models are extremely capable if they would get theright documents, but if we put them into the noisy corpus, the performance drops sharply.

Meaning that actually the bottleneck here is not the reasoning, it's actually the access to theright knowledge it needs to answer this question. So we see this knowledge gap in the real world.

And if we would just drop in way better search using Mixedbread, which is a search tool using latent reaction, we can recover most of the performance. So for BrowsCom, the difference between the Oracle and the GPT-5 with Mixedbread is just 3 points.

Better Search3:22

Amir3:38

And for Office QA Pro, we even almost completely close the gap. With giving the models a better search tool, we can recover most of the knowledge gap. But looking at the queries the model asks or writesright now to the search system, it gets super, super interesting.

So here's an example query we found during some benchmarking, which is: Senator, women, questions, billionaires, not a company, then okay, thank you stuff, we'll check hearing. It's basically gibberish,right? If you have a search system which wants to have neural questions or semantic questions and just gets this keywords over keywords, it gets confused.

Bad Queries3:56

Amir4:18

And the reason why the models write this type of queries is they're mostly trained for coding tasks, like for coding agents, which are then optimized for code-based exploration using tools like grep. And grep just tries to find regular expressions,right?

So the model tries to just write as many expressions it thinks in the document to find theright thing. The second thing is the models are trained to use the web pretty efficiently. And to use the web tools properly, which are highly optimized for humans, they try to mimic human-like query patterns.

So just keyword on keyword on keyword. And number 3, obviously, is the benchmark bias. Most benchmarks we haveright now, like Beer, NanoWear, use Kauffmann-style queries, which are entity-based queries that structurally favor heavily BM25. Soright now the agent guesses the keywords to actually increase the overlap between the query and documents and can't really use powerful search tools properly.

Agent Design5:23

Hanna Lichtenberg5:23

This motivated us to make our own search agent to teach it to use powerful search properly, especially to use theright search tools for different use cases, and to work beyond code search for knowledge work. And most importantly, the agent should be precise, fast, and cheap.

The first step for building this agent was to define a very powerful harness. Our harness is fully built on the Mixedbread platform. Our agent has 4 main search tools, which are: overview search. This is used as a very wide semantic search where the agent receives up to 50 retrieval chunks, and it sees only summaries of the chunk contents to really have just like an overview of the corpus, what exists, and to not fill up the context too much.

Then there is the main semantic search tool where the agent gets the full payload of the top 10 retrieved chunks. It has a filter chunks tool where it can sort and find chunks based on metadata facets. And of course, we also have a grep tool for the keyword match searches.

Our agent loop, the harness itself, is very simple and short because the agent should be fast. But we still wanted it to have a lot of exploration possibilities. That's why we decided to define that it has at maximum 4 search rounds, but within each search round it can have parallel searches.

So it can start several searches at once. Initially, our agent sees the user query, but also already results from an initial semantic search on the user query, plus hints on which metadata facets are available. So that based on this preview of the corpus, the agent can start its search planning.

It splits its search intent into a maximum of 4 queries,

which cover separate aspects. And then for each query and each search intent, it will pick the best tool,

as you can see like an example here on theright. Then when the results of the tools are returned to the agent, we are deduplicating chunks so that it's never seeing several chunks several times to not fill up the context.

And yeah, the next search round can start. And as soon as the agent has enough evidence to answer the user query, it submits its ranking. Yeah, where it just outputs all the chunks that are relevant to the query in a plausible ranking.

So why does this harness encourage better semantic queries and better use of search tools? There are 5 more main points for this, which is: first, the goal framing. The agent has to articulate what evidence it needs before writing the query.

Then the different tools are very important, so it can really use semantic search only if it needs aspects, and also only uses grep when it needs exact keyword matching.

Then the way in which we frame the task of query writing is an important point. We kind of trick the model into not thinking it has to write the typical BM25-based query by just instructing it to write one concise sentence describing what it wants to find, instead of directly instructing "write a search query."

So it cannot fall into this old pattern.

Then we also provide examples in the prompt just to show a few good queries and also how to divide an input query into different aspects to explore

the corpus. What also helps is that we provide the original query semantic search results so it can see what the corpus is about and really define see the language, define where to dig deeper in which aspect. The second important step into building our own search agent was, of course, the training itself.

So here for training, we just decided to have a very small LLM to make the agent even faster. So we are training the small agent to optimize the search strategy itself, to have better tool choice, higher quality of semantic queries, more exploration, ranking, and to be more efficient.

Training10:09

Hanna Lichtenberg10:32

So the first step in training is supervised fine-tuning with a larger teacher LLM. And then we did on-policy reinforcement learning with an own search reward. Our search reward is a combination of both of a retrieval reward and a trajectory reward.

The retrieval reward is built based on the metric result, typical retrieval metric results, like we call an NDCG that the agent's final rank list achieves, plus also an LLM retrieval judging where it gets several rubrics where it decides if the rubrics is hit or not, the rubric is hit or not, which are if the agent results are relevant for this query, are all chunks relevant, and is the ranking itself plausible.

For the trajectory reward, we are also using an LLM judge. And here is the point to really improve the tool choice, make it more efficient, and to improve the quality of the queries. Because we have rubrics that are where the judge is deciding if the query is really a natural sentence, also if the amount of exploration is sufficient, if it's too much or too less.

Here you can see an example trajectory. You see that in the beginning we have the initial search and the initial metadata hints. Then the agent did 4 parallel searches in the first round, and then a second round, just a simple grep tool.

And here's an extract of a trajectory where we see the agent queries. The input query is on the left. This is a very long query, typical Wrenbling-style query from the Oblique Congress benchmark. And yeah, we see the agent queries here for the first semantic search tool.

It's really a sentence describing what it wants to find and not a weird keywordy edit behind each other formulation.

The grep tools, of course, are like typical keyword patterns, which is exactly as intended. Our trained agent is not released yet, unfortunately. However, we have some intermediate results. Here on the left side for the Oblique Congress benchmark, we see that we achieved an NDCG at 10 of 0.4, which is a huge jump towards the model that performed best on the paper of this benchmark, which is the GPT multihop agent, and which achieves 0.18.

Results12:53

Hanna Lichtenberg13:29

On theright side, you can see the result of our beta version of the search agent, which we haveright now in production. It's the Mixedbread Agentic Search. And this agent is top 1 on the Snowflake's MedQA benchmark, achieving an accuracy of 93.4 when we give the Gemini 3.5 Flash model our agentic search as search tool.

And this

performance was also achieved while having way less effort than comparable LLMs with other search agents. You can check out the MedQA leaderboard. These results show that there's still a lot of room for improvement when it comes to huge language models and their search tools.

Wrap-up14:18

Hanna Lichtenberg14:18

And if you want to be part of pushing the boundaries of retrieval even further, we are happy awaiting your application.