Live data from Hacker News

Show HN: How we leapfrogged traditional vector based RAG with a 'language map'

twitter.com

21–30 of 62 posts

Re: Show HN: How we leapfrogged traditional vector based RAG with a 'language map'

#21
Looks similar to what we're doing in Pythagora with CodeMonkey agent (prompt: https://github.com/Pythagora-io/gpt-pilot/blob/main/core/pro..., code: https://github.com/Pythagora-io/gpt-pilot/blob/main/core/age...)

I think everyone who's seriously tackled the "code RAG" problem is aware a naive vector approach doesn't work, and some hybrid approach is needed (see also Paul's comments on Aider).

Intuitively, I expect a combo of lsp/treesitter directed by LLM + vector-RAG over "wiki" / metadata would be a viable approach.

Very exciting to see all the research into this!

Re: Show HN: How we leapfrogged traditional vector based RAG with a 'language map'

#22
Nice job on this, it’s a really interesting approach. I’ve been developing an open-source coding agent over the past year, and RAG just wasn’t working at all. I switched to a repo map approach (which sounds similar to what aider is doing) and that helped a bit but still wasn’t great.

However, a few weeks ago I built an agent that takes in a new GitHub issue and is given a variety of tools to do research on the background information to complete the issue. The tools include internet searches or clarifying questions to ask the person who wrote the ticket. But the most useful tool is the ability to look at the codebase and create a detailed markdown file of various files, explanations of what each file does, relevant code samples or snippets from the files, etc..

It’s still early, but anecdotally I’ve seen a huge increase in the quality of the code that uses this research as part of the context (along with the repo map and other details). It’s also able to tackle much more complex issues than it could before.

I definitely think you’re on to something here with this wiki approach. I’ll be curious to dig in and see the details of how you are creating these. Here is my research code if you’re interested: https://github.com/jacob-ai-bot/jacob/blob/feature/agent/src...

And here’s an example of the research output (everything past the exit criteria section): https://github.com/kleneway/jacob/issues/62

Re: Show HN: How we leapfrogged traditional vector based RAG with a 'language map'

#23
I've been curious about this use case, so cool to see, and more so, to know it worked!

This is essentially a realization of how graph RAG flavor systems work under the hood. Basically you create hierarchical summary indexes, such as topical cross-document ones, and tune the summaries to your domain. At retrieval time, one question will be able to leverage richer multi-hop concepts that span ideas that are individually distinct & lexically, but get used together. Smarter retrievers can choose to dynamically expand on this (agentic: 'follow links') or work more in bulk on the digests ('map/reduce over summaries') without having to run every chunk through the LLM.

Once you understand what is going on in core graph rag, you can even add non-vector relationships to the indexing and retrieval steps, such as from a static code analysis, which afaict is the idea here. For a given domain, likewise, you can do custom templates to tune what is in each summary, like different wiki page styles for different topics. (Note: despite the name & vendor advertising, no graph DB nor knowledge graph is needed for graph RAG, which makes its relationship to autowiki etc concepts less obvious.)

We are building out some tech here to deal with core production issues like to update/add items without reindexing everything and making larger ingests faster+cheaper. Eg, imagine monitoring a heavy feed or quickly changing repo. If of interest to any, please ping - we are putting together design partner cohorts for the RAG phase of louie.ai .

Re: Show HN: How we leapfrogged traditional vector based RAG with a 'language map'

#24

I agree that many AI coding tools have rushed to adopt naive RAG on code. Have you done any quantitative evaluation of your wiki style code summaries? My first impression is that they might be too wordy and not deliver valuable context in a token efficient way. Aider uses a repository map [0] to deliver code context. Relevant code is identified using a graph optimization on the repository's AST & call graph, not vect…

I had forgotten that Aider uses tree-sitter for syntactic analysis. Happy to found you've got the tree-sitter queries ready, to retrieve code information from source. I was researching how to write the queries myself, for exactly the same purpose as Aider.

Re: Show HN: How we leapfrogged traditional vector based RAG with a 'language map'

#26

So no free lunch? Making a detailed wiki of all the code would take several developer-years for us, and we're just a handful of developers. Or is the wiki generated somehow?

(edited) I think mutable is generating an auto-wiki of your repo.

Separately - would like to know if wiki can be auto-generated from a large corpus of text. Should be a much simpler problem? Any answers would be much appreciated!

Re: Show HN: How we leapfrogged traditional vector based RAG with a 'language map'

#27

So no free lunch? Making a detailed wiki of all the code would take several developer-years for us, and we're just a handful of developers. Or is the wiki generated somehow?

(edited) I think mutable is generating an auto-wiki of your repo. Separately - would like to know if wiki can be auto-generated from a large corpus of text. Should be a much simpler problem? Any answers would be much appreciated!

Given that the company is called Mutable AI and they called the product (?) Auto Wiki then I have to assume that they auto-generated the wiki. But I agree that the wording is ambiguous and could be interpreted as "we manually created the wiki".

> So we went back to step 1, let’s understand the code, let’s do our homework, and for us, that meant actually putting an understanding of the codebase down in a document — a Wikipedia-style article — called Auto Wiki. The wiki features diagrams and citations to your codebase.

(Edit) Homepage makes it clear they're talking about ML-generated wiki https://mutable.ai/

Re: Show HN: How we leapfrogged traditional vector based RAG with a 'language map'

#28

Earlier quoted context omitted.

(edited) I think mutable is generating an auto-wiki of your repo. Separately - would like to know if wiki can be auto-generated from a large corpus of text. Should be a much simpler problem? Any answers would be much appreciated!

Given that the company is called Mutable AI and they called the product (?) Auto Wiki then I have to assume that they auto-generated the wiki. But I agree that the wording is ambiguous and could be interpreted as "we manually created the wiki". > So we went back to step 1, let’s understand the code, let’s do our homework, and for us, that meant actually putting an understanding of the codebase down in a document — a…

Yeah I mean when I read "for us, that meant actually putting an understanding of the codebase down in a document" I assume that's a person. For me, current AI's don't have any understanding as such.

But yeah, upon closer inspection I see in the sidebar it says "Create your own wiki - AI-generated instantly". So that clears up my confusion.

Re: Show HN: How we leapfrogged traditional vector based RAG with a 'language map'

#29
I've been working on Webwright[1] for a month after having prototyped a few different terminal solutions for a coding agents. Webwright manifests in a psuedo terminal in Powershell or terminal on MacOS.

Using Claude.AI, I determined the `ast` package would be suitable (for Python scanning), so had Webwright author a new function module to scan the project and assemble a list of functions, function calls, imports, and decorators. I then installed the function module and relaunched the app.

It produced the following as a request to explain how the system works for y'all:

WebWright uses modular function calls to handle various tasks such as user input processing, file operations, git management, and AI interactions. The main application routes commands to specific functions, which in turn perform discrete tasks like reading files, managing containers, and querying AI APIs. This architecture ensures clear separation of concerns, maintainability, and scalability while efficiently handling complex operations asynchronously.

The heavy lifting in WebWright is primarily done in the AI handlers and utility modules:

1. AI Handlers (`lib.aifunc`):

   - The core AI functionality, like processing user queries and interacting with AI APIs (OpenAI, Anthropic), performs the most computationally intensive tasks.    
   
   - Managing asynchronous API calls, error handling, and processing large datasets.
2. Utility Modules:

   - Modules like lib.functions.filesystem, lib.functions.git_*, and lib.functions.manage_app_container handle substantial operations such as file I/O, version control, and Docker container management.
These components shoulder the bulk of the computational and I/O work, ensuring efficient task execution and resource management.

[1] https://github.com/MittaAI/webwright

Re: Show HN: How we leapfrogged traditional vector based RAG with a 'language map'

#30

I agree that many AI coding tools have rushed to adopt naive RAG on code. Have you done any quantitative evaluation of your wiki style code summaries? My first impression is that they might be too wordy and not deliver valuable context in a token efficient way. Aider uses a repository map [0] to deliver code context. Relevant code is identified using a graph optimization on the repository's AST & call graph, not vect…

I tried using Aider but my codebase is a mix of Clojure Clojurescript and Java . I gave up making it work for me it as it created more issues for me. What I really hated about Aider was that it made code changes without my approval.
Post reply on HN