Search
This is an example search page!
Reference:
- Talk to github repo using AI
-
Leveraging AIChat for RAG with ILIMA THOUGHTS §
Leveraging AIChat for RAG with a GitHub Repository
This guide demonstrates how to use AIChat’s built-in vector database and full-text search capabilities to create a knowledge base from an entire GitHub repository. This enables Retrieval-Augmented Generation (RAG), allowing AIChat to provide more informed and contextually relevant responses based on the repository’s content.
Creating a RAG Knowledge Base from a GitHub Repository
Follow these steps to create a RAG knowledge base using AIChat:
-
Initiate RAG: Use the following command within AIChat, replacing
ilima-thoughts
with your desired RAG name:> .rag ilima-thoughts
-
Configure Embedding Model: AIChat will prompt you to select an embedding model. Choose the appropriate model based on your needs. For example:
> Select embedding model: gemini:text-embedding-004 (max-tokens:2048; max-batch:100; price:0)
-
Set Chunk Size and Overlay: Configure the chunk size and overlay for optimal retrieval performance. Experiment with these values to find what works best for your repository.
> Set chunk size: 1500 > Set chunk overlay: 100
-
Add Documents: Specify the paths to the relevant directories within your GitHub repository. This example uses the
unapologetic-thoughts
repository. Adjust the paths to match your repository’s structure. Use the**
wildcard to include all files within the specified directories.> Add documents: https://github.com/igorlima/unapologetic-thoughts/tree/master/_posts/**; https://github.com/igorlima/unapologetic-thoughts/tree/master/snippets/**; https://github.com/igorlima/unapologetic-thoughts/tree/master/pages/**; https://github.com/igorlima/unapologetic-thoughts/tree/master/notebooks/**
-
Exit RAG Configuration: Once you’ve added all the desired documents, exit the RAG configuration mode.
@ilima-thoughts> .exit rag
Managing Your RAG Knowledge Base
AIChat provides several commands for managing your RAG knowledge base:
-
View Citation Sources: After a query, use the following command to see the sources used in the last query:
.sources rag
This helps you understand where AIChat is getting its information.
-
Edit Documents: Add or remove documents from an existing RAG knowledge base:
.edit rag-docs
-
Rebuild RAG: After making changes to the documents in your repository, rebuild the RAG knowledge base to reflect those changes:
.rebuild rag
-
Show RAG Information: View information about your RAG knowledge base, such as the number of documents and the embedding model used:
.info rag
Further Resources
- AIChat RAG Guide: For a more in-depth explanation, refer to the official AIChat RAG Guide +.
- Leveraging AIChat RAG with Your RC File: Configuration Assistance Made Easy
- Leveraging AIChat RAG with ILIMA SNIPPETS
-
- the following vim hint is helpful when enabling the option to include the matches -
includeMatches: true
.- to move the cursor to a match position, use the one character in the search pattern
/.
and then move theN
characters ahead by repeating the last search from the cursor’s position.- to go to the
Nth
match in the file: type the amount of movement to go ahead, then press then
- eg.78n
250n
. - the dot
.
matches any character except the new line.
- to go to the
- to move the cursor to a match position, use the one character in the search pattern
Search
Config
JSON
Results