Ask HN: How to set up a RAG app for understanding Codebases?

2 points by alwinaugustin 7 months ago | 0 comments
I'm working on multiple Python codebases for web applications and want to set up a Retrieval-Augmented Generation (RAG) application to better understand my codebases. The goal is to have it suggest improvements, generate code for new features and tests, and answer workflow-related questions. Also I would like to use the same for automating code reviews.

Due to privacy concerns, I prefer using open-source models hosted locally on my MacBook M3 (e.g., using Ollama). While I already have a GitHub Copilot subscription provided by my company, it often fails to fully understand the context of the entire codebase, leading to generated code that doesn't align with the project's structure.

I’ve experimented with LangChain and Chroma DB for this, but the answers are often unrelated to the context, likely due to issues with the embeddings.

Does anyone have resources or tips on how to effectively feed a codebase into an LLM and set up a reliable solution? How can I ensure the embeddings are accurate and aligned with my requirements?