Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– AI Code Review & Documentation Agent

Python Streamlit CrewAI Google Gemini License: MIT

An intelligent multi-agent AI system powered by CrewAI and Google Gemini 2.5 Flash that automatically performs deep code reviews, detects security vulnerabilities, identifies bugs, and generates professional Markdown documentation for your codebase.


✨ Key Features

  • πŸ•΅οΈβ€β™‚οΈ Multi-Agent Architecture (CrewAI):
    • Senior Code Reviewer Agent: Inspects source code for security vulnerabilities, logic errors, edge cases, and performance bottlenecks.
    • Technical Documentation Writer Agent: Transforms technical findings into clear, structured Markdown reports with actionable code recommendations.
  • ⚑ Powered by Gemini 2.5 Flash: Utilizes Google's fast and state-of-the-art LLM model for high-accuracy analysis.
  • 🎨 Modern Streamlit Web UI:
    • Upload code files (.py, .java, .js, .ts, .html, .css, .cpp).
    • Direct code editor / text pasting options.
    • Multi-language support dropdown (Python, Java, JavaScript, TypeScript, C++, HTML/CSS, etc.).
  • πŸ“₯ One-Click Export: Download generated code review & documentation reports directly as .md files.
  • πŸ’» CLI & Web UI Modes: Flexible execution via command line terminal or interactive web dashboard.

πŸ—οΈ Architecture & Workflow

graph TD
    A[User Code Input / File Upload] --> B[Streamlit Web UI / CLI]
    B --> C[CrewAI Orchestrator]
    
    subgraph AI Architecture Crew
        C --> D[Agent 1: Senior Code Reviewer]
        D -->|Identifies Bugs & Security Issues| E[Agent 2: Tech Documentation Writer]
        E -->|Generates Markdown Report| F[Final Output Report]
    end
    
    D --- G[(Google Gemini 2.5 Flash)]
    E --- G
    
    F --> H[UI Display & Markdown File Download]
Loading

πŸ› οΈ Tech Stack

  • Framework: CrewAI (Sequential Multi-Agent Process)
  • LLM Engine: gemini-2.5-flash via Google Gemini API
  • Frontend / Web UI: Streamlit
  • Language: Python 3.10+
  • Environment Management: python-dotenv

πŸš€ Getting Started

Prerequisites

  • Python: 3.10 or higher installed.
  • Gemini API Key: Get a free API key from Google AI Studio.

Installation

  1. Clone the Repository:

    git clone https://github.com/chathunga2007/AI-Code-Review-Agent.git
    cd AI-Code-Review-Agent
  2. Create & Activate Virtual Environment:

    • Windows (PowerShell):
      python -m venv venv
      .\venv\Scripts\activate
    • macOS / Linux:
      python3 -m venv venv
      source venv/bin/activate
  3. Install Dependencies:

    pip install crewai streamlit python-dotenv
  4. Configure Environment Variables: Create a .env file in the root directory and add your API key:

    GEMINI_API_KEY=your_google_gemini_api_key_here

πŸ’» Usage

1. Launch the Streamlit Web Application (Recommended)

Run the following command in your terminal:

streamlit run app.py

This opens the interactive Web Application in your browser at http://localhost:8501.

How to use the Web App:

  1. Select your target programming language in the sidebar.
  2. Choose your input method (Upload Code File or Paste Code Text).
  3. Click πŸš€ Run AI Review & Generate Docs.
  4. View the live analysis report and click πŸ“₯ Download Markdown Report to save it!

2. Run in CLI Mode

You can also run the terminal script directly:

python agent.py

πŸ“ Project Structure

AI-Code-Review-Agent/
β”‚
β”œβ”€β”€ .env                # Environment variables (GEMINI_API_KEY)
β”œβ”€β”€ .gitignore          # Git ignore rules
β”œβ”€β”€ agent.py            # CLI entry point using CrewAI & Gemini
β”œβ”€β”€ app.py              # Streamlit Web App entry point
β”œβ”€β”€ sample.py           # Code snippet buffer for evaluation
└── README.md           # Project documentation

🀝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to open an issue or pull request.


πŸ“œ License

Distributed under the MIT License.


Developed By ❀️ Chathunga Bimsara

About

πŸ€– Multi-agent AI code reviewer & documentation generator powered by CrewAI, Google Gemini 2.5 Flash, and Streamlit.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages