-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: repo map #496
feat: repo map #496
Conversation
6ec3362
to
5429d77
Compare
181bddb
to
866f6f3
Compare
This PR is still in rapid iteration and is not yet ready for review. |
7644a37
to
910c397
Compare
You could probably use the aider queries for treesitter. |
we are iterating a lot atm, and will consider refactor the query later. |
910c397
to
7ffaaa2
Compare
aider's queries return all class/function definitions in the file, but I only need the externally exposed classes/functions (similar to a C header file), so their code doesn't suit my requirements. |
f347f5a
to
a431056
Compare
a431056
to
37fbad8
Compare
Here's an update for everyone: Actually, this PR was completed a long time ago. The functionality tests are all normal and the results are very good, but it consumes a large number of tokens (to test this PR, my Anthropic quota has already been exhausted 😢). We are currently considering how to optimize this aspect. |
fbbeb81
to
5fd8fb9
Compare
Is the consumed token amount similar to what is consumed when using something like Aider (and adding all files in a project)? |
The core issue seems to be that the current implementation is using the entire repomap instead of focusing on the most relevant tags. A potential solution would involve finding a way to rank the tags produced by tree-sitter. In Python ecosystems, libraries like NetworkX (used in aider) can represent these tags as nodes in a graph and then apply algorithms like PageRank to rank them effectively. |
afaik nvim has binding to python, but it is kinda slow. Maybe we can do reranking through colbert from rust/c++ or sth. |
Pagerank might work better than colbert as it's well-suited for treesitter's tag structure, but using rust/c++ is a great idea. petgraph might work well |
Thanks for the knowledge sharing, will take a look into this |
In my local tests, aider's repo map tends to be inaccurate, bringing in unrelated files while ignoring related ones. |
PageRank likely overweights common utilities. For a more localized context BFS might be best. |
40b6235
to
32222ae
Compare
32222ae
to
6059f59
Compare
273fdac
to
ad2da9a
Compare
#122