logoalt Hacker News

emporasyesterday at 8:34 PM0 repliesview on HN

I am writing a Context Retrieval and Context Minimization program for Rust code. I am trying to automate my own workflow in how I use LLMs.

The program is gonna do, what I am currently doing by hand, opening files and copying function/method signatures usually, from files all over the place.

The key here is to fetch into the context window only what is needed for one-question/one-answer and no more, hence the Context Minimization. Context fetched is gonna be specified by the programmer, for example sig(function) fetches only the signature, while @function captures the whole body. sig(Struct) is gonna fetch the fields and signatures of all of it's methods. sig(Trait) similarly.

In my view, giving the A.I. more information than needed, only confuses it and accuracy degrades. It is also slower and more expensive but that's a side effect.

The project is in early stages, for the moment it calls ast-grep under the hood, but eventually, if it works as it is supposed to, I plan to move to tree-sitter queries.

If there is a similar project somewhere I would appreciate a pointer to it, but I am not interested in implementations of agents. My program does not give the A.I. a whole view of the codebase, only the necessary points specified by the programmer.