Overview:
The Code Quality Intelligence Agent (CQIA) is a multi-agent system designed to automatically evaluate the quality of source code.
It combines static analysis, AST parsing, concurrent multi-agent evaluation, and a RAG-powered chatbot to provide deep insights into your project’s maintainability, security, and reliability.
CQIA leverages five specialized agents, each targeting a critical aspect of code quality:
-
Code Duplication Agent
Detects redundant or repeated logic across files and modules, improving maintainability. -
Security Agent
Flags unsafe functions, insecure dependencies, and potential vulnerabilities. -
Performance Agent
Highlights inefficient loops, heavy memory usage, and resource bottlenecks. -
Reliability & Fault Tolerance Agent
Reviews exception handling and recovery strategies to ensure system resilience. -
Complexity Agent
Uses AST-driven structural analysis (cyclomatic complexity, nesting depth) to measure readability and maintainability.
- Source files are ingested automatically.
- Each file is transformed into a payload containing:
- Raw Code – original source for direct inspection.
- AST (Abstract Syntax Tree) – structural representation of the code.
- Metadata – file paths, function boundaries, and contextual info.
- The payload is sent to all five agents concurrently, ensuring faster evaluations.
- Each agent produces issue reports specific to its domain.
- A Retrieval-Augmented Generation (RAG) chatbot is integrated for interactive exploration.
- It leverages embeddings of raw code, AST fragments, and metadata to:
- Describe project folder structures.
- Summarize detected issues.
- Provide natural language insights.
- All results are aggregated into a comprehensive quality report, combining duplication, security, performance, reliability, and complexity metrics.
- Structured JSON Reports for each agent.
- Consolidated Multi-Agent Report summarizing overall code quality.
- Interactive Chatbot to query project structure and issues in natural language.
To run this project, you will need to add the following environment variables to your .env file
GROQ_API_KEY
To deploy this project, clone the Repository and run the below commands
pip install -r requirements.txt streamlit run app.py