π Abstract
π Multi-Agent System Analyzer: Complete Technical Documentation
π Table of Contents
1. Introduction
2. Understanding AI Agents in Code Analysis
3. What is the Multi-Agent System Analyzer?
4. Why Multi-Agent Intelligence for Code Analysis?
5. Evolution from Traditional Static Analysis to Agentic Systems
6. Core Components of the System
7. Agentic Architecture
8. Agentic Patterns Implemented
9. Agent Workflows
10. Implementation Guide
11. Real-World Use Cases
12. Benefits and Challenges
13. Resilience and Reliability
14. Future Enhancements
15. Conclusion
1οΈβ£ IntroductionΒ
Modern software development has evolved into a complex ecosystem where codebases grow exponentially, documentation becomes outdated within weeks, and maintaining code quality across distributed teams becomes increasingly challenging. Developers spend an estimatedΒ 30-40% of their timeΒ trying to understand existing code, navigate architectural decisions, and identify areas needing improvement.
Traditional static analysis tools like ESLint, Pylint, and SonarQube have been the industry standard for decades. While these tools excel at catching syntax errors and enforcing style guidelines, they fundamentally lack:
β’ Contextual Understanding: Unable to comprehend the "why" behind architectural decisions
β’ Holistic Analysis: Focus on individual files rather than repository-wide health
β’ Intelligent Reasoning: Cannot provide human-like suggestions for improvements
β’ Adaptive Learning: Follow rigid, predefined rules without understanding intent
TheΒ Multi-Agent System AnalyzerΒ represents a paradigm shift in how we approach code analysis. By leveraging the principles ofΒ Agentic AIβautonomous reasoning, tool usage, iterative refinement, and coordinated decision-makingβthis system transcends the limitations of traditional analyzers.
The Problem This System Solves
When joining a new project or auditing an existing codebase, developers face critical questions:
βΒ What does this project actually do?
βΒ How is the codebase structured and organized?
βΒ What improvements are urgently needed?
βΒ Where is the documentation incomplete or missing?
βΒ What are the hidden architectural weaknesses?
Answering these questions manually can take days or weeks. The Multi-Agent System Analyzer answers them in minutes.
2οΈβ£ Understanding AI Agents in Code AnalysisΒ
What are AI Agents?
AnΒ AI agentΒ is an intelligent software system that autonomously performs tasks to achieve specific goals by leveraging Large Language Models (LLMs), external tools, and reasoning frameworks.
Think of AI asΒ raw intelligenceβit possesses vast knowledge but needs direction. An AI agent is theΒ executorΒ that takes this intelligence and applies it to solve real-world problems.
Simple Analogy
Imagine you're a tech lead reviewing a codebase submitted by a junior developer:
β’ Traditional Tool: A linter flags 150 style violations but doesn't explain why the architecture is problematic.
β’ AI Agent: An intelligent assistant that:
β¦ Analyzes the entire repository structure
β¦ Identifies that the project lacks separation of concerns
β¦ Suggests refactoring patterns specific to your tech stack
β¦ Points out missing documentation with examples
β¦ Provides actionable, prioritized improvement recommendations
This is the difference betweenΒ knowingΒ something is wrong andΒ understandingΒ how to fix it.
AI Agent vs Traditional AI Systems
Aspect Traditional AI/ML Generative AI (LLMs) AI Agents
Knowledge Limited to training data Vast, but static Extended via tools & APIs
Reasoning Rule-based logic Pattern recognition Dynamic planning & decision-making
Autonomy Executes predefined tasks Responds to prompts Autonomous goal achievement
Tool Usage None Limited Extensive (APIs, databases, external systems)
Memory None Conversation context Short-term & long-term memory
Workflow Linear, fixed Single inference Iterative, multi-step processes
The Three Pillars of AI Agents
An AI agent operates on three fundamental principles:
1. UnderstandΒ β Perceive the environment and recognize the task
2. ThinkΒ β Process information and determine the best course of action
3. ActΒ β Execute tasks and deliver results
In the context of code analysis:
β’ Understand: Parse repository structure, read files, extract context
β’ Think: Analyze code quality, identify patterns, reason about improvements
β’ Act: Generate reports, suggest refactorings, flag critical issues
The Multi-Agent System Analyzer is a fully automated, AI-driven framework designed to:
β
Analyze software repositories with human-like understanding
β
Extract structured metadata (tech stack, dependencies, architecture)
β
Detect improvement opportunities with contextual reasoning
β
Evaluate documentation quality and completeness
β
Generate actionable, prioritized reports
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β USER INPUT β
β (Repository Path / GitHub URL) β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ORCHESTRATION LAYER (main.py) β
β Coordinates workflow, manages agent interactions, β
β aggregates results β
ββββββββ¬ββββββββββββββββββ¬ββββββββββββββββββ¬βββββββββββββββββββ
β β β
βΌ βΌ βΌ
ββββββββββββββ ββββββββββββββ βββββββββββββββ
β ANALYZER β β METADATA β β IMPROVER β
β AGENT β β AGENT β β AGENT β
ββββββββββββββ ββββββββββββββ ββββββββββββββββ
β β β
β β β
βββββββββββββββββββ΄ββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββ
β TOOLS & UTILITIES β
βββββββββββββββββββββββββ€
β β’ RepoReader β
β β’ Summarizer β
β β’ WebSearchTool β
β β’ Guardrails β
β β’ Monitoring β
β β’ Retry Logic β
βββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STRUCTURED OUTPUT β
β β’ Analysis Report β’ Metadata JSON β’ Improvements β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Figure 1: Multi-Agent System Architecture Overview
4οΈβ£ Why Multi-Agent Intelligence for Code Analysis?Β
The Power of Specialization
Instead of relying on a monolithic model attempting to do everything, this system employsΒ role-specialized agents, each responsible for a distinct reasoning layer:
Agent Responsibility Core Capability
AnalyzerAgent Code structure & issue detection Contextual code understanding
MetadataAgent Project-level insights extraction Structured data extraction
ImproverAgent Improvement suggestions Best practices reasoning
This mirrors how human code review teams operate:
β’ (MetadataAgent) β Understands high-level structure
β’ (AnalyzerAgent) β Deep-dives into implementation details
β’ (ImproverAgent) β Suggests improvements and best practices
3οΈβ£ Real-World Applications
This system is designed with practical, production-relevant use cases in mind:
β’ Automated Code Reviews β Accelerate pull request reviews by generating structured insights before human review.
β’ Repository Onboarding β Help new developers quickly understand unfamiliar codebases.
β’ Technical Debt Assessment β Identify architectural weaknesses, documentation gaps, and maintainability risks.
β’ Open-Source Quality Audits β Evaluate repository readiness for contributors and long-term maintenance.
β’ AI-Assisted Documentation Generation β Provide intelligent suggestions for missing or incomplete documentation.
These applications demonstrate the systemβs value beyond experimentation, positioning it as a developer productivity and quality-assurance tool.
4οΈβ£ System Requirements
π₯οΈ Technical Requirements
β’ Python 3.10+
β’ Minimum 4GB RAM (8GB recommended)
β’ Internet connectivity
β’ ~1GB disk space
π API Requirements
A .env file must be created containing:

π API Requirements
Create a .env file containing:

Implementation
π Project Structure
The Multi-Agent System is organized using a modular, agent-driven architecture. Each directory has a clear responsibility, enabling scalability, maintainability, and clean separation of concerns between agents, tools, UI, and utilities.

multi-agent-system/
β
βββ agents/ # π§ Autonomous AI Agents
β βββ analyzer_agent.py # Code analysis & issue detection
β βββ metadata_agent.py # Metadata extraction
β βββ improver_agent.py # Improvement suggestions
β
βββ tools/ # π οΈ Reusable Tools
β βββ repo_reader.py # Repository file traversal
β βββ summarizer.py # Result aggregation
β βββ web_search_tool.py # External knowledge lookup
β
βββ utils/ # βοΈ Reliability & Observability
β βββ guardrails.py # Input/output validation
β βββ retries.py # Fault-tolerant execution
β βββ monitoring.py # Logging & tracking
β βββ dummy_llm.py # Mock LLM for testing
β
βββ ui/ # π₯οΈ User Interface
β βββ app.py # Streamlit web application
β
βββ tests/ # β
Unit & Integration Tests
β
βββ sample_repo/ # π Demo Repository
β
βββ main.py # π Orchestration Entry Point
βββ requirements.txt # π¦ Dependencies
βββ .env # π Environment Variables
βββ README.md # π Documentation
Component Breakdown
π§ Agents (agents/)
Core Functionality:
class AnalyzerAgent:
def init(self, llm=None):
self.llm = llm or ChatOpenAI(model="gpt-4o-mini", temperature=0.4)
def analyze(self, repo_content: str) -> str:
"""
Analyzes repository structure and detects:
- Code quality issues
- Architectural inconsistencies
- Documentation gaps
- Naming convention violations
"""
Output Example:
{
"project_overview": "Python-based multi-agent system for code analysis...",
"detected_issues": [
"Missing comprehensive README documentation",
"Inconsistent naming conventions in utils/ module",
"No edge case handling in MetadataAgent",
"Environment variables not validated before initialization"
],
"documentation_gaps": [
"No installation guide for beginners",
"Missing architecture diagram",
"No API documentation for agents"
]
}
Core Functionality:
class MetadataAgent:
def extract_metadata(self, repo_content: str) -> dict:
"""
Extracts:
- Project name & description
- Tech stack (languages, frameworks)
- Dependencies
- Author information
- License type
- Repository structure
"""
Fallback Mechanism:
When LLM parsing fails, the agent uses rule-based extraction:
def _fallback_metadata(self, repo_text: str) -> dict:
lines = repo_text.splitlines()
title = lines[0].strip("# ").strip() if lines else "Untitled"
techs = [t for t in ["python", "java", "node"] if t in repo_text.lower()]
return {
"project_name": title,
"technologies": techs or ["unspecified"],
...
}
Core Functionality:
class ImproverAgent:
def suggest_improvements(self, repo_content: str) -> str:
"""
Provides:
- Code quality enhancements
- Documentation improvements
- Architecture recommendations
- Best practice adherence
"""
Output Example:
Improvement Suggestions:
π οΈ Tools (tools/)
Key Features:
Recursive directory traversal
File type filtering (.py, .md, .json, etc.)
Size limits to prevent memory overflow
GitHub README fallback for remote repositories
def read_repository(path: str, max_files: int = 50) -> str:
"""
Reads repository files and aggregates content.
Handles:
- Local directories
- GitHub URLs (via API)
- Binary file exclusion
- Error handling for inaccessible files
"""
def summarize_results(agent_outputs: dict) -> str:
"""
Creates unified summary from:
- AnalyzerAgent findings
- MetadataAgent extractions
- ImproverAgent suggestions
"""
βοΈ Utils (utils/)
def validate_input(text: str) -> bool:
"""Ensures input is non-empty and safe to process"""
def sanitize_input(text: str) -> str:
"""Prevents prompt injection attacks"""
text = html.escape(text)
text = re.sub(r"(?i)(delete|drop|sudo)", "[REDACTED]", text)
return text.strip()
def filter_output(output: str) -> str:
"""Redacts sensitive information from LLM responses"""
Retries (retries.py)
Purpose: Fault-tolerant execution with exponential backoff.
def retry(fn, retries=3, base_delay=1.0, exceptions=(Exception,)):
"""
Retries failed LLM API calls with exponential backoff.
Critical for handling:
Monitoring (monitoring.py)
Purpose: Structured logging for debugging and observability.
def log_event(level, message, extra=None):
"""
Logs agent actions, LLM calls, and errors.
Output: logs/system.log
"""
##Agentic Architecture
Three Essential Components
According to Google's Agents Whitepaper, every agentic system comprises three core components:
βββββββββββββββββββββββββββββββββββββββββββ
β AGENTIC SYSTEM β
βββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββββββββββββββββββββ β
β β 1. MODEL (LLM) β β
β β β’ Decision-making brain β β
β β β’ Task planning β β
β β β’ Reasoning frameworks β β
β βββββββββββββββββββββββββββββββββ β
β β
β βββββββββββββββββββββββββββββββββ β
β β 2. TOOLS β β
β β β’ APIs β β
β β β’ Databases β β
β β β’ External systems β β
β βββββββββββββββββββββββββββββββββ β
β β
β βββββββββββββββββββββββββββββββββ β
β β 3. ORCHESTRATION β β
β β β’ Workflow coordination β β
β β β’ Agent communication β β
β β β’ Result aggregation β β
β βββββββββββββββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββ
##Orchestration (Workflow Coordination)
File: main.py
Orchestration Strategy:
def run_workflow(repo_path: str, llm=None) -> dict:
# Step 1: Read repository
repo_content = read_repository(repo_path)
# Step 2: Initialize agents
analyzer = AnalyzerAgent(llm=llm)
metadata_agent = MetadataAgent(llm=llm)
improver = ImproverAgent(llm=llm)
# Step 3: Execute agents in parallel (future enhancement)
analysis = analyzer.analyze(repo_content)
metadata = metadata_agent.extract_metadata(repo_content)
improvements = improver.suggest_improvements(repo_content)
# Step 4: Aggregate results
summary = summarize_results({
"analysis": analysis,
"metadata": metadata,
"improvements": improvements
})
return {
"analysis": analysis,
"metadata": metadata,
"improvements": improvements,
"summary": summary
}
Orchestration Patterns:
1. Sequential ExecutionΒ (Current):
RepoReader β AnalyzerAgent β MetadataAgent β ImproverAgent β Summarizer
2. Parallel ExecutionΒ (Future):
RepoReader β [AnalyzerAgent, MetadataAgent, ImproverAgent] (concurrent) β Summarizer
3. Feedback Loop (Advanced):
AnalyzerAgent β ImproverAgent reviews analysis β AnalyzerAgent refines β Output
8οΈβ£ Agentic Patterns ImplementedΒ
The system implements multiple proven agentic patterns to enhance performance and reliability.
Pattern 1:Β Tool Use Pattern
Description: Agents access external tools to fetch information beyond the LLM's knowledge.
Implementation:
class AnalyzerAgent:
def init(self, llm, tools):
self.llm = llm
self.tools = tools # {repo_reader, web_search, etc.}
def analyze(self, repo_path):
# Tool usage
repo_content = self.tools['repo_reader'](repo_path)
# LLM reasoning
analysis = self.llm.invoke(f"Analyze: {repo_content}")
return analysis
Workflow:
ββββββββββββββββ
β User Query β
ββββββββ¬ββββββββ
β
βΌ
ββββββββββββββββ βββββββββββββββ
β Agent ββββββΆβ Tool 1 β
β β β (RepoReader)β
ββββββββ¬ββββββββ βββββββββββββββ
β
β βββββββββββββββ
ββββββββββββββΆβ Tool 2 β
β(WebSearch) β
βββββββββββββββ
Figure 5: Tool Use Pattern
Pattern 2:Β Reflection Pattern
Description: Agents iteratively improve outputs through self-critique.
def analyze_with_reflection(self, repo_content):
# Initial analysis
draft_analysis = self.llm.invoke(f"Analyze: {repo_content}")
# Self-reflection
critique = self.llm.invoke(
f"Review this analysis and identify weaknesses: {draft_analysis}"
)
# Refinement
final_analysis = self.llm.invoke(
f"Improve the analysis based on this critique: {critique}"
)
return final_analysis
Workflow:
Generate β Reflect β Improve β Generate v2 β Reflect β ... β Final Output
Pattern 3: Multi-Agent Collaboration
Description: Specialized agents work together, each handling a specific subtask.
Current Implementation:
AnalyzerAgent (Structure & Issues)
+
MetadataAgent (Metadata Extraction)
+
ImproverAgent (Suggestions)
β
Orchestrator (Aggregation)
Collaboration Strategy:
Shared Context: All agents analyze the same repo_content
Complementary Roles: Each focuses on a distinct aspect
No Circular Dependencies: Sequential execution prevents deadlocks
9οΈβ£ Agent WorkflowsΒ
High-Level Workflow
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β USER INTERACTION β
β (Streamlit UI or CLI) β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββ
β INPUT: Repository Path β
β β’ Local: ./my-repo β
β β’ Remote: github.com/... β
βββββββββββββββ¬ββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββ
β ORCHESTRATOR (main.py) β
β β’ Validates input β
β β’ Initializes agents β
β β’ Manages workflow β
βββββββββββββββ¬ββββββββββββββββ
β
βββββββββββββββ΄ββββββββββββββββ
β β
βΌ βΌ
ββββββββββββββββββ ββββββββββββββββββ
β TOOL: Repo β β GUARDRAILS β
β Reader β β β’ Validate β
β β’ Traverse β β β’ Sanitize β
β β’ Read files β β β
ββββββββββ¬ββββββββ ββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββ
β AGENT EXECUTION LAYER β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββββββββββββββββββββββββββ β
β β ANALYZER AGENT β β
β β β’ Analyzes structure β β
β β β’ Detects issues β β
β β β’ Identifies gaps β β
β ββββββββββββββββ¬βββββββββββββββββββββββ β
β β β
β ββββββββββββββββΌβββββββββββββββββββββββ β
β β METADATA AGENT β β
β β β’ Extracts tech stack β β
β β β’ Identifies structure β β
β β β’ Parses dependencies β β
β ββββββββββββββββ¬βββββββββββββββββββββββ β
β β β
β ββββββββββββββββΌβββββββββββββββββββββββ β
β β IMPROVER AGENT β β
β β β’ Suggests code improvements β β
β β β’ Recommends best practices β β
β β β’ Identifies missing docs β β
β ββββββββββββββββ¬βββββββββββββββββββββββ β
β β β
βββββββββββββββββββΌβββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββ
β SUMMARIZER β
β β’ Aggregates β
β β’ Formats output β
ββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββ
β MONITORING β
β β’ Logs events β
β β’ Tracks metrics β
ββββββββββ¬ββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββ
β STRUCTURED OUTPUT β
β { β
β "analysis": {...}, β
β "metadata": {...}, β
β "improvements": {...}, β
β "summary": "..." β
β } β
βββββββββββββββββββββββββββββββββββββββββββββββ
Figure 6: Complete System Workflow
Detailed Execution Flow
Step 1: Input Handling
repo_path = "./sample_repo" # or GitHub URL
repo_content = read_repository(repo_path)
if "β" in repo_content:
# Fallback to GitHub README
repo_content = read_github_readme(repo_path)
Step 2: Agent Initialization
analyzer = AnalyzerAgent(llm=custom_llm)
metadata_agent = MetadataAgent(llm=custom_llm)
improver = ImproverAgent(llm=custom_llm)
Step 3: Parallel Agent Execution (Current: Sequential)
analysis_result = analyzer.analyze(repo_content)
metadata_result = metadata_agent.extract_metadata(repo_content)
improvement_result = improver.suggest_improvements(repo_content)
Step 4: Result Aggregation
summary = summarize_results({
"analysis": analysis_result,
"metadata": metadata_result,
"improvements": improvement_result
})
Step 5: Output Delivery:
return {
"analysis": analysis_result,
"metadata": metadata_result,
"improvements": improvement_result,
"summary": summary
}
π Implementation Guide
Prerequisites
Technical Requirements:
Python: 3.10 or higher
RAM: Minimum 4GB, recommended 8GB
Disk Space: ~1GB for dependencies and logs
Internet: Required for LLM API calls
API Requirements:
OpenAI API Key (get from platform.openai.com)
Installation Steps
Step 1: Clone the Repository
Setting up the environment
Create a new virtual environment and install the dependencies using requirements.txt file.
requirements.txt

.env
Create a .env file and add your API key.
Security Best Practice:
echo ".env" >> .gitignore
Running the System
Option 1: Command-Line Interface (CLI)
Basic Usage:
python main.py
This analyzes the default ./sample_repo directory.
Analyze Custom Repository:
if name == "main":
repo_path = "./your-custom-repo" # Change this
result = run_workflow(repo_path)
print(json.dumps(result, indent=2))
Output:
{
"analysis": {
"project_overview": "Python-based CLI tool for data processing...",
"detected_issues": [
"Missing error handling in data_loader.py",
"No unit tests for core modules"
],
"documentation_gaps": [
"No API documentation",
"Installation steps unclear"
]
},
"metadata": {
"project_name": "DataPro",
"technologies": ["python", "pandas", "numpy"],
"author": "unknown",
"license": "MIT"
},
"improvements": {
"suggestions": [
"Add type hints to all functions",
"Implement comprehensive error handling",
"Create tests/ directory with pytest",
"Add CONTRIBUTING.md"
]
},
"summary": "DataPro is a Python CLI tool with strong data processing capabilities but lacks comprehensive testing and documentation."
}

Step 3 β Install Dependencies
π₯ ui/ β Streamlit User Interface
The UI layer provides an interactive interface for executing the multi-agent workflow.
β’ app.py
Allows users to upload repositories, trigger analysis, and view structured outputs in real time.
This component demonstrates end-user accessibility and practical applicability of the agentic system.
app.py
This is the main entry point of the application built in Streamlit. It uses requests to interact with the FastAPI endpoints at the backend.

BACKEND
π main.py β Orchestration Entry Point
The main execution file initializes agents, invokes tools, coordinates agent interactions, and aggregates results into a unified output. It acts as the central orchestrator for the multi-agent workflow.

π§© utils/ β Reliability, Safety, and Observability
This directory contains cross-cutting utilities that improve system robustness and production readiness.
β’ Guardrails (guardrails.py) β Input and output validation
β’ Retries (retries.py) β Fault-tolerant retry mechanisms
β’ Monitoring (monitoring.py) β Logging and execution tracking
β’ Dummy LLMs (dummy_llm.py, your_dummy_llm.py) β Mock models for offline testing and validation
These utilities ensure the system remains stable, debuggable, and resilient under failure scenarios.
-->utils.py
dummy_llm.py

guardrails.py

monitoring.py

retries.py

π Directory Breakdown
π§ agents/
Contains autonomous, role-based AI agents, each responsible for a specific reasoning task.
β’ analyzer_agent.py
o Analyzes repository structure and source code
o Detects architectural issues, gaps, and inconsistencies
β’ improver_agent.py
o Suggests enhancements for code quality, structure, and documentation
o Focuses on best practices and maintainability improvements
β’ metadata_agent.py
o Extracts high-level project metadata
o Identifies dependencies, configuration patterns, and repository context
This folder demonstrates agent specialization and collaborative intelligence, a core principle of agentic AI systems.
--> agents
analyzer_agent.py

improver_agent.py

metadata_agent.py

π tools/
Reusable tools that agents rely on to interact with external data and repositories.
β’ repo_reader.py
o Reads repository files and directories
o Handles file traversal and safe access
β’ summarizer.py
o Condenses agent outputs into structured summaries
β’ web_search_tool.py
o Supports external knowledge lookup when enabled
o Enhances reasoning with contextual information
-->tools
repo_reader.py

summarizer.py

web_search_tool.py

π§ͺ sample_repo/ β Demonstration & Validation Repository
A controlled example repository used to test and validate agent behavior without impacting real-world projects. This enables repeatable evaluation during certification review.
π¦ Supporting Infrastructure
β’ tests/ β Unit and integration tests
β’ config/ β Configuration files
β’ logs/ β Runtime logs and monitoring output
β’ requirements.txt β Dependency management
β’ .env β Environment variable configuration
β’ README.md β Documentation and usage guide



Screenshot Placeholder:
βββββββββββββββββββββββββββββββββββββββββββββββ
β π Multi-Agent Repository Analyzer β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β Enter local repository path: β
β βββββββββββββββββββββββββββββββββββββββ β
β β ./sample_repo β β
β βββββββββββββββββββββββββββββββββββββββ β
β β
β [ Analyze Repository ] β
β β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β β
Analysis complete! β
β β
β π Results: β
β { β
β "analysis": {...}, β
β "metadata": {...}, β
β ... β
β } β
βββββββββββββββββββββββββββββββββββββββββββββββ
Streamlit Web Interface
Launch UI:
cd ui
streamlit run app.py
Access:
Open browser at http://localhost:8501
UI Features:
π Input repository path (local or GitHub URL)
π Click "Analyze Repository"
π View structured results in JSON format
π₯ Download report as JSON

"metadata": {
"project_name": "Multi-Agent System Analyzer",
"description": "A modular multi-agent system built using Python, LangChain, and OpenAI models to automatically analyze repository contents, extract metadata, and generate structured recommendations.",
"technologies": [
"Python",
"LangChain",
"OpenAI GPT-4o-mini",
"Streamlit (optional UI)",
"dotenv",
"Logging utilities"
],
"author": "Unknown (not specified in repository)",
"tags": [
"multi-agent",
"AI agents",
"repository-analysis",
"automation",
"langchain"
],
"license": "MIT (or unspecified)",
"repo_structure": {
"root_files": [
"main.py",
"requirements.txt",
"README.md",
".env"
],
"directories": [
"agents/",
"tools/",
"utils/",
"ui/",
"tests/",
"logs/"
],
"agents": {
"AnalyzerAgent": "Performs repository content analysis and summarizes issues.",
"MetadataAgent": "Extracts structured metadata from README or repo content.",
"ImproverAgent": "Generates improvements and best-practice recommendations."
},
"raw_output": "{... full extracted JSON from model ...}"
}
},
"improvements": {
"code_quality": [
"Refactor repeated code into utility functions under utils/",
"Add type annotations across all agent methods",
"Use consistent snake_case naming convention",
"Improve exception handling around LLM API interactions",
"Introduce retry mechanisms for rate-limits"
],
"documentation": [
"Add comprehensive README.md including architecture diagram",
"Document each agent class with docstrings",
"Add examples of input and output in README",
"Include troubleshooting steps for API issues",
"Provide clear environment configuration guide"
],
"architecture": [
"Create dedicated Orchestrator class instead of mixing logic in main.py",
"Add agent registry for easier addition/removal of new agents",
"Introduce message bus or event system for cleaner communication",
"Implement caching layer for repeated LLM calls"
],
"best_practices": [
"Use .env.example template for sharing environment variables",
"Create CONTRIBUTING.md for open-source collaboration",
"Set up GitHub Actions for tests and lint checks",
"Add pre-commit hooks to enforce formatting and linting",
"Use semantic versioning for future releases"
]
},
"summary": {
"highlights": [
"The repository implements a multi-agent workflow using LangChain and OpenAI.",
"Agents collaborate to analyze code, extract metadata, and suggest improvements.",
"Documentation is the most critical missing component.",
"Architecture can be enhanced with better modularization and agent orchestration."
],
"overall_quality_score": 7.2,
"recommendation": "Add full documentation, improve consistency across modules, and enhance architecture for scalability."
}
}


π§© Key Concepts
β’ Role-specialized agents
β’ Shared memory
β’ LLM-driven reasoning
β’ Fault-tolerant pipelines
β’ Structured outputs
π Resilience, Observability & Reliability
To enhance production readiness, the system incorporates or recommends:
β’ Retry mechanisms for LLM API failures
β’ Timeout handling for long-running agent tasks
β’ Structured logging for agent decisions
β’ Graceful fallback agents to prevent workflow failure
β’ Clear error messaging for configuration issues
These features ensure stability, debuggability, and long-term maintainability.
β¨ Features
β Multi-Agent Reasoning Pipeline
β Automated Metadata Extraction
β Code Quality & Architecture Analysis
β Documentation Gap Detection
β Streamlit-Based Interactive UI
β Exportable JSON Reports
β Robust Error Handling
π Future Enhancements
β’ Agent memory persistence
β’ Plugin-based agent registry
β’ Caching layer for repeated LLM calls
β’ GitHub Actions integration
β’ Multi-repo batch analysis
π License
This project is licensed under theΒ MIT License.
MIT License
Copyright (c) 2025 Prantesh Dahikar
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software...
π Acknowledgments
Special thanks to:
β’ LangChain TeamΒ for the powerful agent framework
β’ OpenAIΒ for GPT-4o-mini and vision models
β’ StreamlitΒ for the intuitive UI framework
β’ Open-source communityΒ for inspiration and contributions
π Contact & Support
Author: Prantesh Dahikar
Email:Β pdahikar9@gmail.com
GitHub:Β https://github.com/pranteshdahikar/multi-agent-system