An intelligent code review tool powered by Reactive AI Agents that adapt and specialize based on your code's specific needs. The system automatically analyzes your code and routes it to the most appropriate AI specialists for review and optimization.
- Adaptive Intelligence: AI agents analyze code complexity and route to specialized reviewers
- Dynamic Specialization: Automatic selection of security, performance, or architecture specialists
- Self-Correcting Workflows: Quality assessment with automatic refinement loops
- Context-Aware Optimization: Optimizers adapt based on review findings and code characteristics
- 📄 File Upload: Single Python file analysis
- 📝 Code Paste: Direct code input
- 📁 Folder Analysis: Batch processing of multiple files
- 🔗 GitHub Integration: Clone and analyze repositories with PR creation
- Intelligent Routing: AI determines the best review strategy automatically
- Specialized Agents: Security, performance, architecture, and general code specialists
- Quality Assurance: Built-in assessment and refinement mechanisms
- Comprehensive Reports: Detailed analysis with comparison scores and recommendations
- Python 3.8+
- Azure OpenAI API access
- GitHub Personal Access Token (optional, for GitHub features)
-
Clone and Setup
git clone <repository-url> cd updated_code_review python -m venv venv venv\Scripts\activate # Windows # source venv/bin/activate # Linux/Mac
-
Install Dependencies
pip install -r requirements.txt
Or use the automated setup script:
python setup.py
-
Configure Environment
Copy
.env.template
to.env
and configure:# Azure OpenAI Configuration AZURE_OPENAI_API_KEY=your_api_key AZURE_OPENAI_ENDPOINT=your_endpoint AZURE_OPENAI_API_VERSION=2024-12-01-preview AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4o AZURE_OPENAI_MODEL_NAME=gpt-4o # GitHub Configuration (Optional) GITHUB_TOKEN=your_github_token GITHUB_USERNAME=your_username # LangChain Configuration (Optional) LANGCHAIN_TRACING_V2=true LANGCHAIN_API_KEY=your_langchain_key LANGCHAIN_PROJECT=Code-Review-New
streamlit run streamlit_app.py
Open your browser to http://localhost:8501
Code Input → Analyzer Agent → Router Agent → [Specialist Agent] → Implementer → Quality Assessor → [Refinement Loop] → Final Report
Available Review Specialists:
- 🔒 Security Specialist: Input validation, auth issues, injection attacks
- ⚡ Performance Specialist: Algorithm efficiency, caching, async processing
- 🏗️ Architecture Specialist: Design patterns, SOLID principles, scalability
- 🔧 General Reviewer: Overall code quality and best practices
Review Results → Optimization Analyzer → Router → [Optimization Specialist] → Assessor → [Refinement Loop] → Optimized Code
Available Optimization Specialists:
- 🚀 Performance Optimizer: Time complexity, vectorization, parallel processing
- 💾 Memory Optimizer: Memory allocation, generators, efficient data structures
- 📈 Scalability Optimizer: Async patterns, connection pooling, microservices
- 🏛️ Architecture Optimizer: SOLID principles, design patterns, modularity
updated_code_review/
├── streamlit_app.py # Main Streamlit application
├── workflow_reactive_review.py # Reactive review workflow
├── workflow_reactive_optimize.py # Reactive optimization workflow
├── prompts.py # AI prompts for all agents
├── state.py # Workflow state management
├── github_integration.py # GitHub API integration
├── interconn_updated.py # Code interconnection analysis
├── utils.py # Utility functions
├── requirements.txt # Dependencies
├── .env.template # Environment template
└── README.md # This file
Choose your preferred input method and select specialization focus.
The system automatically:
- Analyzes code complexity and characteristics
- Routes to the most appropriate specialist agent
- Generates comprehensive review reports
- Self-corrects if quality is insufficient
Based on review findings:
- Analyzes optimization opportunities
- Selects the best optimization strategy
- Applies specialized improvements
- Validates and refines results
- Download optimized code
- Create GitHub pull requests (for repositories)
- View detailed before/after comparisons
For GitHub repositories, the tool can:
- Clone repositories automatically
- Create feature branches
- Commit optimized code
- Generate pull requests with detailed descriptions
Requirements:
- GitHub Personal Access Token with
repo
scope - Push access to the target repository (or fork workflow for external repos)
- Azure OpenAI Errors: Verify API credentials and quota
- GitHub Integration: Check token permissions and repository access
- File Processing: Ensure valid Python syntax and file permissions
- Check Streamlit error messages in the UI
- Review console output for detailed errors
- Verify all environment variables are set correctly
- Fork the repository
- Create a feature branch
- Implement your changes
- Test with various code samples
- Submit a pull request
MIT License - see LICENSE file for details.
Powered by Reactive AI Agents 🤖✨