Skip to content

itsokayyybro/MultiAgentic_Debbuger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

12 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– Multi-Agentic Debugger

An AI-powered collaborative debugging system that leverages multiple specialized agents to analyze, diagnose, and resolve software bugs efficiently.

MIT License Python 3.9+ GitHub Stars


๐Ÿ“‹ Table of Contents


๐ŸŽฏ Overview

Multi-Agentic Debugger is an innovative debugging system that employs multiple AI agents working collaboratively to identify and resolve software bugs. Unlike traditional debugging tools that provide single-threaded analysis, this system orchestrates specialized agents that examine code from different perspectives simultaneously, mimicking how expert debugging teams approach complex problems.

Why Multi-Agentic Debugging?

  • Faster Resolution: Multiple agents analyzing simultaneously reduces debugging time by 40-60%
  • Comprehensive Analysis: Different agents bring specialized expertise (error patterns, code flow, root cause analysis)
  • Intelligent Collaboration: Agents share findings and challenge hypotheses, reducing false positives
  • Learning System: Improves over time by learning from previously solved bugs

๐Ÿ” Problem Statement

Software debugging consumes 30-50% of development time, with complex issues often requiring days to resolve. Traditional debugging faces several challenges:

  • Single-threaded analysis misses patterns that require multi-domain expertise
  • Context switching between logs, stack traces, and code flow is cognitively overwhelming
  • Pattern recognition limitations in identifying subtle bugs across large codebases
  • Knowledge silos prevent collaborative problem-solving

Our Solution: A multi-agent system where specialized AI agents collaborate to provide comprehensive, multi-perspective debugging analysis.


โœจ Features

  • ๐ŸŽฏ Orchestrated Agent Coordination - Central orchestrator manages multiple specialized debugging agents
  • ๐Ÿ”„ Parallel Analysis - Multiple agents analyze different aspects of bugs simultaneously
  • ๐Ÿง  Root Cause Intelligence - Advanced algorithms identify underlying issues, not just symptoms
  • ๐Ÿ’ก Solution Generation - Automatically proposes fixes with explanations
  • ๐Ÿ“Š Visual Debugging Flows - Interactive visualization of error propagation and analysis
  • ๐Ÿ” Context-Aware Learning - Learns from historical debugging sessions
  • โšก Real-time Collaboration - Agents communicate and share insights dynamically
  • ๐Ÿ“ Detailed Reports - Comprehensive debugging reports with step-by-step analysis

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    USER INTERFACE LAYER                     โ”‚
โ”‚         (CLI / Jupyter Notebook / Web Interface)            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                         โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  ORCHESTRATOR AGENT                         โ”‚
โ”‚   โ€ข Task Delegation  โ€ข Result Synthesis  โ€ข Coordination     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
      โ”‚                โ”‚                โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Error    โ”‚   โ”‚   Code    โ”‚   โ”‚Root Cause  โ”‚   โ”‚Solution โ”‚
โ”‚ Analyst   โ”‚   โ”‚  Tracer   โ”‚   โ”‚  Analyzer  โ”‚   โ”‚Generatorโ”‚
โ”‚  Agent    โ”‚   โ”‚   Agent   โ”‚   โ”‚   Agent    โ”‚   โ”‚  Agent  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜
      โ”‚                โ”‚                โ”‚               โ”‚
      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                         โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    DATA LAYER                               โ”‚
โ”‚   โ€ข Code Repository  โ€ข Error Logs  โ€ข Stack Traces          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿš€ Installation

Prerequisites

  • Python 3.9 or higher
  • pip package manager
  • API key for OpenAI or Anthropic (for LLM backend)

Setup

  1. Clone the repository

    git clone https://github.com/itsokayyybro/MultiAgentic_Debbuger.git
    cd MultiAgentic_Debbuger
  2. Create virtual environment

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Configure API keys

    cp .env.example .env
    # Edit .env and add your API keys

    Required environment variables:

    OPENAI_API_KEY=your_openai_key_here
    # OR
    ANTHROPIC_API_KEY=your_anthropic_key_here
    
  5. Run the system

    # CLI Mode
    python -m agentic_debugger.cli
    
    # Jupyter Notebook Mode
    jupyter notebook Multi_Agentic_Debugger.ipynb

๐Ÿ’ป Usage

Basic Example

from agentic_debugger import MultiAgenticDebugger

# Initialize the debugger
debugger = MultiAgenticDebugger()

# Provide buggy code and error context
code = """
def calculate_average(numbers):
    total = sum(numbers)
    return total / len(numbers)

result = calculate_average([])
"""

error_message = "ZeroDivisionError: division by zero"

# Run debugging analysis
result = debugger.debug(
    code=code,
    error_message=error_message,
    stack_trace=stack_trace  # Optional
)

# View results
print(result.root_cause)
print(result.proposed_solutions)
print(result.agent_analysis)

CLI Usage

# Debug a Python file
python -m agentic_debugger debug --file buggy_code.py --error "IndexError: list index out of range"

# Interactive mode
python -m agentic_debugger interactive

# With custom agent configuration
python -m agentic_debugger debug --file code.py --agents error,tracer,root_cause --verbose

๐Ÿ”„ How It Works

Debugging Flow

  1. Input Phase

    • User submits buggy code, error messages, and optional context
    • System parses and structures input data
  2. Orchestration Phase

    • Orchestrator analyzes the problem complexity
    • Creates a debugging plan and assigns tasks to specialized agents
  3. Parallel Analysis Phase

    • Error Analyst Agent: Parses error messages and identifies error patterns
    • Code Tracer Agent: Analyzes execution flow and variable states
    • Root Cause Analyzer: Correlates findings to identify underlying issues
    • Solution Generator: Proposes fixes based on analysis
  4. Synthesis Phase

    • Orchestrator collects agent findings
    • Resolves conflicts and builds comprehensive analysis
    • Ranks solutions by confidence and feasibility
  5. Output Phase

    • Presents debugging report with explanations
    • Provides step-by-step solution guidance
    • Offers validation and testing recommendations

๐Ÿค Agent Roles

๐ŸŽฏ Orchestrator Agent

Responsibility: Coordinates all agent activities, manages workflow, synthesizes results

  • Creates debugging plans
  • Assigns tasks to specialized agents
  • Resolves conflicts between agent findings
  • Produces final comprehensive report

๐Ÿ” Error Analyst Agent

Responsibility: Analyzes error messages, logs, and stack traces

  • Parses exception types and messages
  • Identifies error patterns and commonalities
  • Extracts relevant context from logs
  • Compares with historical error database

๐Ÿ“Š Code Tracer Agent

Responsibility: Tracks code execution flow and data flow

  • Analyzes function call sequences
  • Traces variable state changes
  • Identifies problematic code paths
  • Maps dependencies and interactions

๐Ÿง  Root Cause Analyzer Agent

Responsibility: Identifies underlying issues beyond surface symptoms

  • Correlates findings from multiple agents
  • Applies causal reasoning
  • Distinguishes symptoms from root causes
  • Provides confidence scores for hypotheses

๐Ÿ’ก Solution Generator Agent

Responsibility: Proposes fixes and improvements

  • Generates multiple solution approaches
  • Provides code patches
  • Explains trade-offs of each solution
  • Suggests preventive measures

โœ… Validator Agent

Responsibility: Tests and validates proposed solutions

  • Runs proposed fixes in isolated environments
  • Verifies solutions resolve the issue
  • Checks for side effects
  • Provides validation reports

๐Ÿ› ๏ธ Technology Stack

Core Framework

  • Python 3.9+ - Primary programming language
  • LangChain / CrewAI - Agent orchestration framework
  • OpenAI GPT-4 / Anthropic Claude - Large Language Models for agent intelligence

Code Analysis

  • AST (Abstract Syntax Tree) - Code structure parsing
  • Python ast module - Syntax tree manipulation
  • PyFlakes / Pylint - Static code analysis

Development Tools

  • Jupyter Notebook - Interactive development and testing
  • FastAPI - Web API (planned)
  • Streamlit - Web UI (planned)

Supporting Libraries

  • langchain - LLM application framework
  • openai / anthropic - LLM API clients
  • pydantic - Data validation
  • pytest - Testing framework

๐Ÿ“ Project Structure

MultiAgentic_Debbuger/
โ”œโ”€โ”€ agentic_debugger/          # Main package
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ orchestrator.py        # Orchestrator agent logic
โ”‚   โ”œโ”€โ”€ agents/                # Individual agent implementations
โ”‚   โ”‚   โ”œโ”€โ”€ error_analyst.py
โ”‚   โ”‚   โ”œโ”€โ”€ code_tracer.py
โ”‚   โ”‚   โ”œโ”€โ”€ root_cause.py
โ”‚   โ”‚   โ”œโ”€โ”€ solution_generator.py
โ”‚   โ”‚   โ””โ”€โ”€ validator.py
โ”‚   โ”œโ”€โ”€ utils/                 # Utility functions
โ”‚   โ”‚   โ”œโ”€โ”€ code_parser.py
โ”‚   โ”‚   โ”œโ”€โ”€ error_parser.py
โ”‚   โ”‚   โ””โ”€โ”€ visualizer.py
โ”‚   โ”œโ”€โ”€ cli.py                 # Command-line interface
โ”‚   โ””โ”€โ”€ config.py              # Configuration management
โ”œโ”€โ”€ tests/                     # Test suite
โ”‚   โ”œโ”€โ”€ test_orchestrator.py
โ”‚   โ”œโ”€โ”€ test_agents.py
โ”‚   โ””โ”€โ”€ test_integration.py
โ”œโ”€โ”€ examples/                  # Usage examples
โ”‚   โ”œโ”€โ”€ basic_debugging.py
โ”‚   โ”œโ”€โ”€ complex_scenario.py
โ”‚   โ””โ”€โ”€ batch_debugging.py
โ”œโ”€โ”€ docs/                      # Documentation
โ”‚   โ”œโ”€โ”€ architecture.md
โ”‚   โ”œโ”€โ”€ agent_protocols.md
โ”‚   โ””โ”€โ”€ api_reference.md
โ”œโ”€โ”€ Multi_Agentic_Debugger.ipynb  # Jupyter notebook demo
โ”œโ”€โ”€ requirements.txt           # Python dependencies
โ”œโ”€โ”€ .env.example              # Environment variables template
โ”œโ”€โ”€ REFACTORING_REPORT.md     # Refactoring documentation
โ”œโ”€โ”€ LICENSE                   # MIT License
โ””โ”€โ”€ README.md                 # This file

๐Ÿ”ฎ Future Enhancements

Short-Term (Q1 2025)

  • IDE Integration (VS Code, IntelliJ, PyCharm plugins)
  • Web-based UI with real-time debugging visualization
  • Support for JavaScript, Java, and C++
  • Enhanced error pattern database
  • Performance optimization and caching

Medium-Term (Q2-Q3 2025)

  • Real-time production monitoring integration
  • Team collaboration features (multi-developer debugging)
  • Auto-patching system with automated testing
  • Security vulnerability detection agents
  • Integration with issue tracking systems (Jira, GitHub Issues)

Long-Term (Q4 2025+)

  • Fine-tuned domain-specific LLMs for debugging
  • Predictive bug detection (identify bugs before they occur)
  • Formal verification integration
  • Cross-platform mobile debugging support
  • Enterprise-grade deployment options

๐Ÿค Contributing

We welcome contributions from the community! Here's how you can help:

Ways to Contribute

  • ๐Ÿ› Report bugs and issues
  • ๐Ÿ’ก Suggest new features or enhancements
  • ๐Ÿ“ Improve documentation
  • ๐Ÿ”ง Submit pull requests
  • โญ Star the repository if you find it useful

Development Setup

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Write or update tests
  5. Ensure all tests pass (pytest)
  6. Commit your changes (git commit -m 'Add amazing feature')
  7. Push to the branch (git push origin feature/amazing-feature)
  8. Open a Pull Request

Code Standards

  • Follow PEP 8 style guidelines
  • Write docstrings for all functions and classes
  • Include unit tests for new features
  • Update documentation as needed

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ‘ฅ Contributors


๐Ÿ“ง Contact & Support


๐Ÿ™ Acknowledgments

  • Inspired by research in multi-agent systems and collaborative AI
  • Built with LangChain and OpenAI
  • Special thanks to the open-source community

๐Ÿ“Š Project Stats

GitHub repo size GitHub issues GitHub pull requests GitHub last commit


Made with โค๏ธ by the Multi-Agentic Debugger Team

If you find this project useful, please consider giving it a โญ!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •