logoalt Hacker News

neuzhoulast Friday at 10:24 PM5 repliesview on HN

Agreed. I've been working on a codebase with 400+ Python files and the difference is stark. With embedding-based RAG, the agent kept pulling irrelevant code snippets that happened to share vocabulary. Switched to just letting the agent browse the directory tree and read files on demand -- it figured out the module structure in about 30 seconds and started asking for the right files by path.

The directory hierarchy is already a human-curated knowledge graph. We just forgot that because we got excited about vector math.


Replies

jahalayesterday at 8:48 PM

I built tilth (https://github.com/jahala/tilth) much for this reason. Couldn't bother with RAG, but the agents kept using too many tokens - and too many turns - for finding what it needed. So I combined ripgrep and tree-sitter and some fiddly bits, and now agents find things faster and with ~40% less token use (benchmarked).

jimmySixDOFyesterday at 3:59 AM

There a lot of methods in IR/RAG that maintain structure as metadata used in a hybrid fusion to augment search. Graph databases is an extreme form but some RAG pipelines pull out and embed the metadata with the chunk together. In the specific case of code, other layered approaches like ColGrep (late interaction) show promise.... the point is most search most of the time will benefit from a combination approach not a silver bullet

show 1 reply
siva7yesterday at 2:20 AM

> Switched to just letting the agent browse the directory tree and read files on demand -- it figured out the module structure in about 30 seconds

You guess what's the difference between code and loosely structured text...

huflungdungyesterday at 1:18 AM

[dead]

pertymcpertyesterday at 7:20 AM

[flagged]

show 4 replies