← Latest papers
💬 NLP

Is Grep All You Need? How Agent Harnesses Reshape Agentic Search

This paper presents an empirical study demonstrating that grep-based retrieval often outperforms vector retrieval in agentic search systems, while highlighting that overall performance is significantly influenced by the specific agent harness and tool-calling paradigm used, even when underlying data remains constant.

Original authors: Sahil Sen, Akhil Kasturi, Elias Lumer, Anmol Gulati, Vamse Kumar Subbiah

Published 2026-05-15
📖 5 min read🧠 Deep dive

Original authors: Sahil Sen, Akhil Kasturi, Elias Lumer, Anmol Gulati, Vamse Kumar Subbiah

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are a detective trying to solve a mystery, but instead of a single file folder, you have a massive library containing millions of pages of conversation logs. You need to find specific facts (like "What time did the meeting start?" or "What is the user's favorite color?") to answer a client's question.

This paper is a report from a team at PwC who tested two different ways for AI "detectives" (Large Language Models) to search through this library. They wanted to see if the AI should use a smart, semantic search (like asking a librarian for "the story about the red car") or a literal, keyword search (like shouting "RED CAR!" and scanning every page for those exact words).

Here is the breakdown of their findings using simple analogies:

The Two Search Methods

  1. Vector Search (The "Smart Librarian"): This method understands the meaning of your question. If you ask about a "fast vehicle," it might find a page mentioning a "speeding sports car," even if the word "vehicle" isn't there. It's great for understanding concepts but can sometimes get distracted by pages that are about the topic but don't have the exact answer.
  2. Grep Search (The "Keyword Scanner"): This is a blunt instrument. It looks for exact words or patterns. If you ask for "fast vehicle," it will only find pages containing those exact words. It doesn't understand meaning, but it is incredibly precise at finding the exact sentence you need.

The Experiment: The "Harness" Matters

The researchers didn't just test the search methods; they tested them inside different "workspaces" (called harnesses).

  • Custom Harness (Chronos): Think of this as a custom-built detective agency. The AI has a manager who organizes the files, tells the AI exactly how to ask questions, and formats the answers perfectly.
  • Provider CLI Harnesses (Claude Code, Codex, Gemini CLI): Think of these as off-the-shelf toolkits provided by the tech giants. The AI is given a command line (like a terminal) and has to figure out how to use standard tools like grep on its own.

The Big Surprises

1. The "Literal" Scanner Often Wins
Contrary to the popular belief that "smart" semantic search is always better, the study found that the literal keyword scanner (Grep) was often more accurate, especially when the answers were specific facts like dates, names, or numbers.

  • Analogy: If you are looking for a specific phone number in a book, shouting the exact digits (Grep) is often more reliable than asking a librarian to find "the contact info" (Vector), because the librarian might bring you a page with a different phone number that is related to the topic.

2. How You Hand the Results to the AI Changes Everything
The researchers tested two ways to give the search results to the AI:

  • Inline (The "Open Book"): The search results are pasted directly into the chat window. The AI reads them immediately.
    • Result: Grep dominated here. When the exact words were pasted right in front of the AI, it nailed the answers.
  • File-Based (The "Filing Cabinet"): The search results are saved to a file, and the AI has to take a second step to open and read that file.
    • Result: The advantage flipped. Sometimes, the AI got confused by the extra step of opening the file. In these cases, the "smart" Vector search sometimes did better because it brought back a smaller, more relevant set of results that were easier to read. However, for some AI models, the file-based method caused the Grep advantage to vanish or even reverse.

3. The "Workplace" is More Important Than the "Tool"
The most surprising finding was that the environment (the harness) mattered more than the search tool itself.

  • Analogy: It's like giving a master chef a knife. If you put them in a professional kitchen with a sous-chef (Custom Harness), they cook a perfect meal. If you put them in a messy, unfamiliar kitchen with no instructions (Provider CLI), they might struggle, even with the same knife.
  • The same AI model (like Claude Opus) got a 93% score in the custom harness but only a 76% score in the provider's CLI, even when using the exact same search data. The "manager" and the "instructions" changed the outcome more than the search method did.

4. The "Noise" Test
The researchers added more and more irrelevant conversation (noise) to the library to see how the search methods held up.

  • They found that as the library got messier, the results were unpredictable. Sometimes the "Smart Librarian" (Vector) was better at filtering out the noise early on. Other times, the "Keyword Scanner" (Grep) was better at ignoring the noise once the AI found the right pattern.
  • There was no single "best" method that worked for all situations; it depended entirely on which AI model and which "workplace" setup was being used.

The Bottom Line

The paper concludes that there is no single "magic bullet" for AI search.

  • Don't just assume "Semantic Search" is the future. For tasks requiring exact facts, simple keyword searching is often superior.
  • The setup is everything. How you present the search results to the AI (directly in the chat vs. in a file) and how you manage the AI's workflow (custom instructions vs. raw tools) changes the results more than the search algorithm itself.

In short: It's not just about what the AI searches for; it's about how the AI is set up to do the searching and how the results are handed to it.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →