I built Realtime-Source-Code-Analyzer, a Flask web app that clones a public GitHub repository, indexes its Python source, and lets people ask questions about the codebase in plain English. The README identifies the repository as a Jupyter Notebook project, while describing a Flask app and a separate research notebook for prototyping. My GitHub profile also lists the repository in its project catalog: github profile.
My Realtime-Source-Code-Analyzer repository is on @sauravyadav7721's GitHub.
My Realtime-Source-Code-Analyzer repository is a Jupyter Notebook project, started 2026-10 and last updated 2026-10.
The app has two phases. During ingestion, it clones a repository into repo/, loads **/*.py files with a Python-aware LanguageParser, splits source into overlapping chunks, embeds the chunks locally with HuggingFace MiniLM, and persists vectors in ChromaDB under db/. During question answering, an MMR retriever selects relevant chunks and sends them with the question and chat history to a Groq-hosted model. ConversationalRetrievalChain and ConversationSummaryMemory support follow-up questions. The implementation targets Python only; support for more languages and file types is a proposed improvement.
My source-code analyzer splits Python code into 2000-character chunks with 200-character overlap.
My source-code analyzer retrieves the 8 most relevant code chunks for a question using MMR search.
My source-code analyzer uses the Groq model openai/gpt-oss-120b to answer codebase questions.
My source-code analyzer uses the locally run HuggingFace embedding model all-MiniLM-L6-v2.
The Flask app serves its UI at /, accepts repository URLs or a clearing command at /chatbot, and accepts chat questions at /get. The URL form displays status messages; users can type clear to delete the downloaded repository, its index, and conversation memory. Loading another URL without clearing also replaces the previous repository. The index and repository are shared by everyone using the server, with no per-user sessions.
My source-code analyzer runs on port 8080 by default.
The main implementation files are app.py for Flask routes, the LLM and retrieval chain, and clearing logic; src/helper.py for cloning, loading, splitting, and embeddings; and store_index.py for command-line indexing. src/prompt.py is reserved for custom prompts and is currently empty. research/trials.ipynb prototyped loading, splitting, and embedding. The frontend is in templates/index.html, with styling in static/style.css; the page loads jQuery from a CDN. Generated repo/ and db/ are excluded from Git.
My source-code analyzer requires Python 3.10 or later.
To run the app, I need Git on PATH, internet access, and a Groq API key stored as GROQ_API_KEY in an uncommitted .env file. The README's setup uses pip install -r requrirements.txt inside a virtual environment, followed by python app.py. The first start is slow because the embedding model must be downloaded. The README gives the browser address as http://<redacted>:8080 and does not disclose the deployment host.
- Operational notes and limitations:
My Realtime-Source-Code-Analyzer is released under the MIT License, with copyright (c) 2026 Saurav Yadav.
My source-code analyzer exposes GET / to serve the web UI.
My source-code analyzer's POST /get endpoint accepts msg=<your question or "clear"> and answers about the indexed code or clears everything.
An example indexing response from my source-code analyzer reports 5 chunks: Indexed 5 chunks from https://github.com/<user>/<repo>.
My source-code analyzer's store_index.py can be run with python store_index.py https://github.com/<user>/<repo> to index a repository from the command line.
My source-code analyzer's store_index.py uses a default sample URL from the file when run without an argument.
My source-code analyzer's UI sends repository URLs to /chatbot and chat messages to /get.
My source-code analyzer requires a free Groq API key.
My source-code analyzer requires Git installed and available on my PATH.
My source-code analyzer needs internet access for GitHub, Groq, and the first-time embedding-model download.
My source-code analyzer's .env file must not be committed; it is already in .gitignore.
My source-code analyzer's src/helper.py now clears repo/ before cloning, addressing the old destination path 'repo' already exists issue.
My source-code analyzer's dependencies are installed with pip install -r requrirements.txt inside the activated virtual environment.
My source-code analyzer's generated repo/ and db/ directories are excluded from Git via .gitignore.
My source-code analyzer is released under the MIT License.
- Only public repositories can be cloned because authentication is not configured; only Python files are indexed, not notebooks, documentation, or other languages.
- A large repository can take a long time to embed. If answers appear to use an old repository, type
clearand load the URL again. - A missing or misnamed
GROQ_API_KEYcan cause a startupTypeError; aModuleNotFoundErrormay require reinstalling dependencies in the activated environment. - A failed index often indicates a bad or private URL or a network problem. If the Send button does nothing, check the CDN-loaded jQuery connection.
- The README warns that
debug=Trueand the configured host are for development and should not be exposed publicly as-is. - Proposed improvements include indexing JS, Java, Markdown, and notebooks; private-repository support using a GitHub token; per-user sessions and separate indexes; source filenames alongside answers; custom prompts; and Docker deployment.