How querying works
Once your repository is indexed, you can ask questions in natural language. RepoRAGX uses a RAG (Retrieval-Augmented Generation) pipeline to answer:Query embedding
Your question is converted into a vector embedding using the same Sentence Transformers model (
all-MiniLM-L6-v2) used during indexing.Similarity search
ChromaDB performs a cosine similarity search to find the top-K most relevant code chunks (default: 5 chunks).
Context retrieval
The most relevant code snippets are retrieved along with their file path metadata and similarity scores.
Asking questions
At the main prompt, type your question and press Enter:Types of effective queries
RepoRAGX works best with specific, code-focused questions:Location queries
Ask where specific functionality is implemented:Implementation queries
Ask how something works:Discovery queries
Find out what exists in the codebase:Explanation queries
Get explanations of existing code:Understanding retrieval results
Retrieval parameters
The RAG retriever uses these default parameters (defined insrc/rag/rag_retriever.py:7):
- top_k:
5- Number of most relevant chunks to retrieve - score_threshold:
0.0- Minimum similarity score (0-1 range)
similarity_score = 1 - distance.
Context provided to LLM
Each retrieved chunk includes:- File path: The source file location (e.g.,
src/rag/github_codebase_loader.py) - Content: The actual code snippet
- Similarity score: How relevant the chunk is to your query
- Rank: Position in the results (1-5 by default)
No results found
If your query doesn’t match any code in the repository, you’ll see:Continuous interaction
After each answer, you’ll see the prompt again:Exiting the session
To end your session and exit the application, typeexit:
EXIT, Exit, and exit all work.
Best practices
Be specific with terminology
Be specific with terminology
Use terms that are likely to appear in the actual code. If you’re looking for database functionality, use terms like “database”, “connection”, “query” rather than vague terms.
Ask one thing at a time
Ask one thing at a time
Break complex questions into smaller, focused queries. Instead of “How does the entire RAG pipeline work?”, ask about specific components like “How are documents chunked?” then “How are embeddings generated?”
Reference specific files when known
Reference specific files when known
If you know a file exists, mention it: “What does the main.py file do?” or “Explain the GitHubCodeBaseLoader class”
Use code-related language
Use code-related language
Iterate on unclear answers
Iterate on unclear answers
If an answer isn’t clear or complete, ask follow-up questions to drill deeper into specific aspects.