An autonomous multi-agent system for intelligent code maintenance, debugging, and automated fixes. This application combines multiple specialized AI agents to detect bugs, analyze root causes, generate fixes, validate changes, and create pull requestsβall without manual intervention.
-
Multi-Agent Architecture: Specialized agents for different stages of the debugging pipeline
- π Log Agent: Parses and analyzes application logs
- π RCA Agent: Root Cause Analysis using AI
- π§ Fix Agent: Generates code fixes automatically
- β Validation Agent: Validates fixes against test suites
- π PR Agent: Creates pull requests with detailed explanations
-
Self-Learning Memory System:
- FAISS vector store for semantic search of past issues
- Learn from historical debugging patterns
-
Multi-LLM Support:
- OpenAI (GPT-4o, GPT-4o-mini, GPT-4-turbo)
- Claude (Sonnet, Haiku, Opus)
- Google Gemini (2.0 Flash, 1.5 Pro)
-
Interactive Streamlit Dashboard:
- Dark-themed premium UI
- Step-by-step pipeline visualization
- Real-time execution tracing
- Log preview and analysis
-
Built-in Mock Data:
- Sample logs from microservices
- Test data for order, payment, and user services
- Pre-configured test suites
.
βββ app.py # Streamlit dashboard (main entry point)
βββ config.py # Centralized configuration
βββ llm_provider.py # LLM abstraction layer
βββ requirements.txt # Python dependencies
β
βββ agents/ # Multi-agent system
β βββ __init__.py
β βββ orchestrator.py # Pipeline coordinator
β βββ log_agent.py # Log analysis
β βββ rca_agent.py # Root cause analysis
β βββ fix_agent.py # Code fix generation
β βββ validation_agent.py # Fix validation
β βββ pr_agent.py # Pull request creation
β
βββ memory/ # Vector store for learning
β βββ __init__.py
β βββ vector_store.py # FAISS-based memory
β βββ store/
β βββ faiss.index # Vector database
β βββ meta.json # Metadata
β
βββ mock_data/ # Sample data for testing
β βββ codebase/ # Mock microservices
β β βββ order_service.py
β β βββ payment_service.py
β β βββ user_service.py
β βββ logs/ # Sample application logs
β β βββ order_service_logs.json
β β βββ payment_service_logs.json
β β βββ user_service_logs.json
β βββ tests/ # Test suites
β βββ order_service_tests.json
β βββ payment_service_tests.json
β βββ user_service_tests.json
β
βββ utils/ # Utility functions
β βββ __init__.py
β βββ helpers.py
β
βββ static/ # UI assets
βββ style.css # Streamlit styling
# Clone the repository
git clone <your-repo-url>
cd "AI-Powered Debugging Agent"
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtCreate a .env file in the project root:
# Choose at least one LLM provider
OPENAI_API_KEY=your_openai_key_here
ANTHROPIC_API_KEY=your_claude_key_here
GOOGLE_API_KEY=your_gemini_key_herestreamlit run app.pyThe application will open at http://localhost:8501
- Select LLM Provider: Choose from OpenAI, Claude, or Gemini
- Enter API Key: Provide your API key for the selected provider
- Select Model: Pick the specific model version
- Choose Log Source:
- Use sample logs from mock data
- Or upload your own log file (JSON format)
- Preview Logs: Inspect the selected log file
- Execute Pipeline: Click run to start the debugging process
- View Results: Monitor step-by-step execution with real-time tracing
from llm_provider import get_llm
from agents.orchestrator import Orchestrator
from memory.vector_store import MemoryStore
# Initialize LLM
llm = get_llm(provider="OpenAI", model="gpt-4o-mini", api_key="your_key")
# Initialize memory
memory = MemoryStore()
# Create orchestrator
orchestrator = Orchestrator(llm, memory)
# Run pipeline
results = orchestrator.execute_pipeline(
log_path="path/to/logs.json",
codebase_path="path/to/codebase"
)Key settings in config.py:
# Agent behavior
AGENT_TEMPERATURE = 0.3 # Lower = more deterministic fixes
MAX_FIX_LINES = 50 # Maximum lines to change per patch
# Severity thresholds
SEVERITY_THRESHOLDS = {
"CRITICAL": 100,
"HIGH": 50,
"MEDIUM": 20,
"LOW": 1,
}
# LLM providers
PROVIDERS = {
"OpenAI": {...},
"Claude": {...},
"Gemini": {...},
}The orchestrator executes the following pipeline:
π Logs β π Detect β π Analyze β π§ Fix β β
Validate β π PR β πΎ Memory
- Log Agent: Parses and extracts errors/issues from logs
- RCA Agent: Analyzes logs with memory context for root cause analysis
- Fix Agent: Generates code fixes for identified issues
- Validation Agent: Runs fixes against test suites
- PR Agent: Creates detailed pull requests with explanations
- Memory: Stores patterns for future reference
- Framework: Streamlit (UI)
- LLMs: OpenAI, Anthropic, Google
- Vector Store: FAISS (fast similarity search)
- Embeddings: Sentence Transformers
- Utilities: Python-dotenv, NumPy
See requirements.txt for complete list with versions.
- API keys are handled via environment variables
- Sensitive data is not logged
- FAISS index is stored locally
- Consider implementing secrets management for production
The project includes realistic mock data:
- Services: Order, Payment, User microservices
- Logs: JSON formatted application logs with errors/warnings
- Tests: Comprehensive test suites for each service
Use this data to test the agent pipeline without real codebases.
- Create
agents/my_agent.py - Inherit from base agent class
- Register in
orchestrator.py - Add to pipeline steps
The vector store supports:
- Semantic search of past issues
- Custom metadata storage
- Similarity-based recommendations
Modify static/style.css and app.py for dashboard customization.
| Issue | Solution |
|---|---|
| "API key not found" | Check .env file and environment variables |
| "FAISS index not found" | Memory is initialized on first run |
| "Streamlit not found" | Run pip install streamlit |
| "LLM response timeout" | Increase timeout in config.py or select faster model |
[Add your license here]
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Submit a pull request
For issues, questions, or suggestions, please open an issue on GitHub.
- Support for additional LLM providers (LLaMA, Qwen)
- Database persistence for memory
- Integration with Git/GitHub APIs
- Advanced metrics and analytics dashboard
- Batch processing for multiple services
- Custom agent creation UI
- Kubernetes deployment templates
Built with β€οΈ for autonomous code maintenance