Skip to content

About

AI-Powered Debugging Agent is an intelligent tool that automatically detects, analyzes, and helps fix software bugs. It identifies error causes, suggests solutions, and improves code quality, enabling developers to debug faster and reduce development time

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– AI-Powered Debugging Agent

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.


✨ Features

  • 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

πŸ“‹ Project Structure

.
β”œβ”€β”€ 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

πŸš€ Quick Start

1. Clone & Setup

# 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.txt

2. Configure Environment

Create 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_here

3. Run the Dashboard

streamlit run app.py

The application will open at http://localhost:8501


πŸ’» Usage

Via Dashboard

  1. Select LLM Provider: Choose from OpenAI, Claude, or Gemini
  2. Enter API Key: Provide your API key for the selected provider
  3. Select Model: Pick the specific model version
  4. Choose Log Source:
    • Use sample logs from mock data
    • Or upload your own log file (JSON format)
  5. Preview Logs: Inspect the selected log file
  6. Execute Pipeline: Click run to start the debugging process
  7. View Results: Monitor step-by-step execution with real-time tracing

Via Python API

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"
)

πŸ”§ Configuration

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": {...},
}

🧠 Agent Pipeline

The orchestrator executes the following pipeline:

πŸ“‹ Logs β†’ πŸ” Detect β†’ πŸ“Š Analyze β†’ πŸ”§ Fix β†’ βœ… Validate β†’ πŸ”€ PR β†’ πŸ’Ύ Memory
  1. Log Agent: Parses and extracts errors/issues from logs
  2. RCA Agent: Analyzes logs with memory context for root cause analysis
  3. Fix Agent: Generates code fixes for identified issues
  4. Validation Agent: Runs fixes against test suites
  5. PR Agent: Creates detailed pull requests with explanations
  6. Memory: Stores patterns for future reference

πŸ“¦ Dependencies

  • 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.


πŸ” Security

  • API keys are handled via environment variables
  • Sensitive data is not logged
  • FAISS index is stored locally
  • Consider implementing secrets management for production

πŸ“Š Mock Data

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.


πŸ› οΈ Development

Add a New Agent

  1. Create agents/my_agent.py
  2. Inherit from base agent class
  3. Register in orchestrator.py
  4. Add to pipeline steps

Extend Memory

The vector store supports:

  • Semantic search of past issues
  • Custom metadata storage
  • Similarity-based recommendations

Customize UI

Modify static/style.css and app.py for dashboard customization.


πŸ› Troubleshooting

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

πŸ“ License

[Add your license here]


πŸ‘₯ Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Submit a pull request

πŸ“§ Support

For issues, questions, or suggestions, please open an issue on GitHub.


🎯 Roadmap

  • 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

About

AI-Powered Debugging Agent is an intelligent tool that automatically detects, analyzes, and helps fix software bugs. It identifies error causes, suggests solutions, and improves code quality, enabling developers to debug faster and reduce development time

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages