Add RAG search for Ask With AI with project conext#56
Merged
Conversation
…embeddings for RAG. search.
…ier to filter them.
…n case of problem with embeddings server. If embeddings server endpoint is not available - shows message and uses only BM25 filtering.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use Ctrl+Shift+; or select from llama.vscode menu "Ask with AI with project context", enter the question and press enter.
The program will search for chunks of text which are close to the query, and send the top 5 to the AI together with the query.
The chunks are created on opening the project, they are in memory and are lost on closing VS Code.
The chunks are filtered on 2 steps - first by using BM25 (keywords are extracted with a REST request to the chat model) and the result is filtered by comparing embeddings of the chunks and query.
Embeddings server (property endpoint_embeddings, default http://127.0.0.1:8010) and Chat server (property endpoint_chat, default http://127.0.0.1:8011) need to run to use this functionality. Tested with all-MiniLM-L6-v2 - a very small embedding server.
rag_* properties could be configured to fine tune the RAG search.
Another pull request for webui will improve the user experience (the request will be sent immediately, no need to click Send button from webui).