Repository navigation
Does autocompletion automatically include project context? #153
|
Every time I start the extension, it does RAG indexing, but it is unclear from documentation, how this mechanism works with the chosen embedding model and whether completion model uses it at all. The embedding model starts when the env starts and after the RAG completes. I also looked at the source code of the RAG indexing and it seems to just generate the inputs for the embedding model for each file, but doesn't put anything to a vector database. I know what embedding models do, but I have no idea how they are utilized in an extension like this. The autocomplete suggestions do not seem to adhere to conventions of my codebase, so I assume the completion model does not get my codebase as context? If not, is there some way to include it? |
Replies: 1 comment 5 replies
|
@megakoresh Yes, autocompletion automatically includes project context. This context is created dynamically - when you code, open a file, etc.. and it takes some time until it collects enough chunks (max number of context chunks is determined by Ring_n_chunks setting). I guess after some time the completions will start to adhere to conventions of your codebase. If you want to see the context, which is sent to the LLM for code completion - copy it to the buffer by pressing Ctrl+Shift+, and after that paste it in a text file. See the "Extra context:" section. RAG and embeddings are used for the agents, not for code completion. There is no vector database (for simplicity). Indexing on opening the project creates the chunks from the files. When context is needed, the RAG chunks are filtered by keywords (BM25 algorithm), only for the most relevant (i.e. 50, configurable by Rag_max_bm25_filter_chunks setting), the embeddings are calculated and with cosine similarity the top 5 (configurable by Rag_max_embedding_filter_chunks setting) most relevant are found and sent to the LLM. |
@megakoresh Yes, autocompletion automatically includes project context. This context is created dynamically - when you code, open a file, etc.. and it takes some time until it collects enough chunks (max number of context chunks is determined by Ring_n_chunks setting). I guess after some time the completions will start to adhere to conventions of your codebase.
If you want to see the context, which is sent to the LLM for code completion - copy it to the buffer by pressing Ctrl+Shift+, and after that paste it in a text file. See the "Extra context:" section.
RAG and embeddings are used for the agents, not for code completion. There is no vector database (for simplicity). Indexing on openin…