Skip to content

Repository files navigation

🤖 CodeQA Agentic Q&A System

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.

🚀 Features

  • Multi-Tool Autonomous Agent: Uses a LangGraph ReactAgent capable 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.

📸 Project Demo

codeQa-Partho.mp4

🛠️ Tech Stack

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

🏗️ Architecture

Below is the internal workflow of the LangGraph ReactAgent routing your queries between the LLM reasoning core and the local filesystem tools:

LangGraph Architecture

🛠️ Setup & Installation

Follow these instructions to run the project locally.

Prerequisites

  • Python 3.9+
  • Git installed on your system.

Installation

You can set up the environment completely with a single command.

  1. Clone the repository

    git clone https://github.com/cspartho/codeqa
    cd codeqa
  2. 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 .env file.

  3. Set up environment variables Open the .env file 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.

▶️ Usage

To launch the Streamlit application:

streamlit run app.py

Example Queries

Once 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:

  1. "What does the agent.py file do?" Agent will use the read_file tool to parse the file and summarize it.
  2. "Where is the search_code function defined?" Agent will use find_usages or search_code to locate the exact definition.
  3. "List all the files in the root directory." Agent will use list_directory to explore the folder structure.

📂 Chosen Repository

This agent can index any public GitHub repository. For testing purposes, you can try it out on:

  • http://github.com/mindsdb/mindsdb
  • http://github.com/huggingface/transformers
  • http://github.com/fastai/fastai
  • http://github.com/mlflow/mlflow
  • http://github.com/openai/gym
  • http://github.com/microsoft/LightGBM
  • http://github.com/pallets/flask
  • http://github.com/psf/requests
  • http://github.com/tqdm/tqdm
  • http://github.com/celery/kombu

Built with ❤️ using LangGraph, Streamlit, and Gemini, Chatgpt, Claude.

About

Github code review agent

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages