CodeQA is an intelligent, multi-tool AI agent designed to help developers understand, navigate, and debug any public GitHub repository. Built on top of LangGraph and Google Gemini, the system autonomously reasons about your natural language questions and decides which tools to use—such as reading files, listing directories, performing semantic code search, or finding symbol usages—to provide accurate, source-cited answers.
- Multi-Tool Autonomous Agent: Uses a LangGraph
ReactAgentcapable of recursive reasoning and tool execution. - Local Repository Exploration: Automatically clones GitHub repos locally to enable precise filesystem interactions.
- Semantic Vector Search: Integrates ChromaDB and HuggingFace embeddings for fast similarity matching of code snippets.
- Source Citations: The agent provides exact file paths and context to back up its answers.
- Graceful Error Handling: Politely declines non-codebase questions and handles missing files/symbols effectively.
codeQa-Partho.mp4
| Layer | Library / Tool / Component |
|---|---|
| Frontend | Streamlit |
| Agent Framework | LangGraph ReactAgent |
| LLM Integration | langchain-google-genai with Google Gemini |
| Embeddings | sentence-transformers/all-MiniLM-L6-v2 via langchain-community |
| Vector Database | ChromaDB |
| Local Repo Loader | GitPython + custom file extraction |
| Environment | python-dotenv |
Below is the internal workflow of the LangGraph ReactAgent routing your queries between the LLM reasoning core and the local filesystem tools:
Follow these instructions to run the project locally.
- Python 3.9+
- Git installed on your system.
You can set up the environment completely with a single command.
-
Clone the repository
git clone https://github.com/cspartho/codeqa cd codeqa -
Run the setup script
- On Linux/macOS (or Git Bash):
bash setup.sh
- On Windows:
setup.bat
The script will automatically create a virtual environment, install dependencies, and generate an
.envfile. - On Linux/macOS (or Git Bash):
-
Set up environment variables Open the
.envfile in the root directory and add your API keys:GEMINI_API_KEY=your_gemini_api_key_here GITHUB_PERSONAL_ACCESS_TOKEN=your_github_token_here # Optional for private repos/rate limits
You can get a free Gemini API key from Google AI Studio.
To launch the Streamlit application:
streamlit run app.pyOnce the app is running, enter a repository URL (e.g., https://github.com/langchain-ai/langchain) and wait for it to be cloned and indexed. Then, you can ask complex questions like:
- "What does the agent.py file do?"
Agent will use the
read_filetool to parse the file and summarize it. - "Where is the
search_codefunction defined?" Agent will usefind_usagesorsearch_codeto locate the exact definition. - "List all the files in the root directory."
Agent will use
list_directoryto explore the folder structure.
This agent can index any public GitHub repository. For testing purposes, you can try it out on:
http://github.com/mindsdb/mindsdbhttp://github.com/huggingface/transformershttp://github.com/fastai/fastaihttp://github.com/mlflow/mlflowhttp://github.com/openai/gymhttp://github.com/microsoft/LightGBMhttp://github.com/pallets/flaskhttp://github.com/psf/requestshttp://github.com/tqdm/tqdmhttp://github.com/celery/kombu
Built with ❤️ using LangGraph, Streamlit, and Gemini, Chatgpt, Claude.
