Skip to content
This repository was archived by the owner on Jan 2, 2025. It is now read-only.

Conversation

@rmuller-ml
Copy link
Contributor

@rmuller-ml rmuller-ml commented Dec 16, 2023

Some queries benefit from basic navigation (go to ref, go to def). Since adding a new tool to the agent makes the agent too complicated, we expand chunks retrieved by code search and proc with chunks containing definitions and references to symbols in the original chunks. To decide which symbol to add def/refs, we list all of the symbols in the original chunks, filter by some heuristics and use a basic LLM classifier to select a single symbol.

Pipeline

  • code search retrieves 10 chunks

  • we call get_related_chunks to get 3 additional chunks

    • we list all symbols from the original chunks in extract_symbols
    • we filter local symbols, symbols with no ref/defs and symbol with too many (>5) in extract_symbols
    • we use a llm classifier in filter_stmbols to select a symbol to expand
    • we expand the symbol into snippets in expand_symbol_into_chunks
  • same things is done in proc

Implementation

agent/symbol.rs is the main file with the changes
hoverable endpoint is used to collect all symbols from a file
token-info endpoint is used to get refs/defs for a given symbol

Remaining things to do

  • revert path filter in proc back to text search (instead of keyword search)
  • handle errors by cleaning the code from unwraps
    • llm call fails
    • function call json fails
    • selected symbol alias not in the set of symbols
    • list of symbols is empty
  • [x ] make it faster (load documents a single time per chunk)

@gitpod-io
Copy link

gitpod-io bot commented Dec 18, 2023

symbol tool

add metadata to code tool chunks

showing metadata

add github to repo

filter empty symbols

fixing some bugs, dedup

fmt

adding aliases

add code to symbol tool

new prompt

add chunk to exchanges

adding symbol ids

save work

now working

adding filter

save work

saving work

remove function call

get ref def outside of exchange

impl agent

refdef to chunks

clean chunk generation

filter_chunks

filter_chunks in new file

fix repo_ref

add to proc

delete symbol tool

warnings

adding constants

relative_path field revert to text

user query simplified

repo_ref to accept github and local

remove filter action, make a function for llm call

better naming and adding comments

fmt

adding some error handling
@rmuller-ml rmuller-ml marked this pull request as ready for review December 18, 2023 23:10
Copy link
Contributor

@ggordonhall ggordonhall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a detailed description of the approach in a comment in symbol.rs?

@ggordonhall ggordonhall self-requested a review January 8, 2024 14:02
@rmuller-ml rmuller-ml merged commit 1998fff into main Jan 8, 2024
@rmuller-ml rmuller-ml deleted the ref_def_proc branch January 8, 2024 14:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants