# Agentic search beat a local vector index

Markdown copy of https://realalpha.app/s/agentic-search-beat-a-local-vector-index/ on Real Alpha, the best minutes from long interviews with the people building AI. Cite and link the page, not this copy.

- Speaker: [Boris Cherny](https://realalpha.app/builders/boris-cherny/) · Boris Cherny is creator and Head of Claude Code at Anthropic. · Created Claude Code at Anthropic and leads its team; previously spent about five years at Meta.
- Host: [Gergely Orosz](https://realalpha.app/people/gergely-orosz/) · Host, The Pragmatic Engineer · Spent four years at Uber heading mobile, web and backend teams; shipped part of its payments system.
- Show: The Pragmatic Engineer
- Episode: [Building Claude Code with Boris Cherny](https://realalpha.app/v/julbw1JuAz0/), Mar 4, 2026
- Moment: 49:39 to 52:40 of the episode (3 min), playing on https://realalpha.app/s/agentic-search-beat-a-local-vector-index/; the episode from there: https://realalpha.app/v/julbw1JuAz0/?t=2979

## Quote

> “It turned out that **agentic search just outperformed everything**.”
> — [Boris Cherny](https://realalpha.app/builders/boris-cherny/) at [51:47](https://realalpha.app/v/julbw1JuAz0/?t=3107) · The Pragmatic Engineer

## Takeaways

1. A local index could miss functions added since indexing.
2. Permissioning the index raised security concerns.
3. The model's Glob and Grep search outperformed tested approaches.

## About this segment

Boris Cherny replaced local vector-based retrieval after it fell out of sync and raised permission concerns. He found agentic Glob and Grep search performed better, showing that tool use could beat indexing.

From “Building Claude Code with Boris Cherny”, Mar 4, 2026. [Watch the full episode](https://realalpha.app/v/julbw1JuAz0/)

## Transcript

Transcribed by machine (Whisper) from the episode’s audio, so a word may be off here and there.

[49:44](https://realalpha.app/v/julbw1JuAz0/?t=2984) is using RAG or not RAG retrieval augmented generation. And you mentioned how in the earlier version of Cloud Code, you use a local vector database to to get some to speed up search and you layer through this away can you talk about how this one because this was another example where i guess did the model get better yeah i mean this is one of those things where we try so many different things we try so many different tools and just statistically most of them we throw away even something like the spinner in quad code i think it's gone through like a hundred iterations i want to say oh just the spinner and you know out of those we've landed maybe like 10 or 20 in production and like 80 of them i probably just threw away because it didn't feel good enough so just statistically almost all the code we write we throw away because it's just so easy to write this code and try stuff and see

[50:32](https://realalpha.app/v/julbw1JuAz0/?t=3032) what feels good so for something like rag we tried a bunch of different approaches early on so the first one was rag for retrieval because i think this i was just like reading up like how people were doing retrieval and it seemed like all the papers were talking about rag and so the way i did it was it was like a local vector database i think it was like written in typescript and you just looked on the user machine uh and then i was using some like embedding uh model that was in the cloud to compute the embeddings before storing it um and that worked like pretty good but there's a lot of issues with rag um so for example i was finding that the code drifted out of sync like if i make a local function it's not yet indexed and so rag isn't going to find it there's also this question of like how exactly is the index permissioned so who can access it

[51:18](https://realalpha.app/v/julbw1JuAz0/?t=3078) I can access it. But then how do we like encode that in kind of permission policies? How do we make sure no one else can access it? How do we make sure that like if there's a rogue IT person within the company, they can't access someone else's data? This is really, really important that we think about this. And so we just decided like it was sort of working, but it also has a lot of downsides. And so we tried a bunch of other stuff.

[51:41](https://realalpha.app/v/julbw1JuAz0/?t=3101) One of them was just using the model to kind of index everything recursively. That was kind of a cool idea. There was another version where we just tried Glob and Grep. We tried a bunch of different stuff. It turned out that agentic search just outperformed everything. And when I say agentic search, it's a fancy word for Glob and Grep. That's all it is. Nice. So the model both got good enough and you realize that they can use these tools pretty efficiently.

[52:06](https://realalpha.app/v/julbw1JuAz0/?t=3126) Yeah. And this was partially inspired, honestly, by my experience at Instagram. Because at Instagram, click to definition didn't work. Because the dev stack was just borked like half the time. And I think now it's better. And so what engineers learned to do instead is, let's say you're looking for the definition of the function foo. Instead of click to definition, what you would do is you would use the global index, which is quite good at meta, and then you would search for foo per opening parentheses.

[52:32](https://realalpha.app/v/julbw1JuAz0/?t=3152) And this worked pretty well. And it's funny because this works for the model pretty well too.
