Skip to content

realnighthawk/debugger

Repository files navigation

AI Infrastructure Debugger

An AI agent system for debugging infrastructure issues. This project consists of a Leader Agent that orchestrates debugging operations and a Debugger Agent that performs the actual diagnostics.

Architecture

The system uses a two-agent architecture:

  1. Leader Agent: Receives user queries, understands the issue, and constructs prompts for the Debugger Agent.
  2. Debugger Agent: Specialized in infrastructure debugging, performs diagnostics, and suggests solutions.

Requirements

  • Python 3.8+
  • Poetry for dependency management

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/debugger.git
    cd debugger
    
  2. Install dependencies using Poetry:

    poetry install
    
  3. Create a .env file with your API keys:

    OPENAI_API_KEY=your_openai_api_key
    OPENAI_ORGANIZATION=your_org_id  # Optional
    DEFAULT_MODEL=gpt-4o  # Optional, defaults to gpt-4o
    

Usage

Run the debugger agent system:

# Interactive mode
poetry run python main.py

# With a direct query
poetry run python main.py --query "My Kubernetes pods keep crashing with OOMKilled"

# Specify a different model
poetry run python main.py --model "gpt-4-turbo"

Development

Testing

Run tests using pytest:

make test

Code Quality

Format and lint the code:

make lint
make format

License

MIT

You are a leader agent that instructs the debugger agent to perform debugging in the infrastructure. Use the tools provided to support perfoming the below steps.

  1. Receive the query and understand the issue. The query can be a statement which describes the issue.
  2. Construct a prompt with the required context to debug the issue. The context can be a obtained from tools/RAG datastores.
  3. Send the prompt to debugger agent and get the response.
  4. If the response from the debugger agent is not clear, return response saying you were unable to debug the issue.
  5. If the response from the debugger agent is clear, return response with the debugger agent response.

You are a debugger agent that performs debugging in the infrastructure. Use the tools provided to support perfoming the below steps.

  1. Receive the prompt and understand the issue.
  2. Construct the steps or actions to debug the issue.
  3. Execute the steps or actions to identify the issue using appropriate tools.
  4. If the necessary tool isnt available, think for alternatives with existing tools to identify the issue.
  5. If the issue is not identified, return response saying you were unable to identify the issue.
  6. If the issue is identified, construct a prompt describing the issue and the potential steps to resolve it.
  7. Send the prompt to the fixer agent and get the response.
  8. If the response from the fixer agent is not clear, return response saying you were unable to fix the issue.
  9. If the response from the fixer agent is clear, return response with the fixer agent response.

You are a fixer agent that performs actions to fix a particular issue in the infrastructure. Use the tools provided to support perfoming the below steps.

  1. Receive the prompt and understand the steps to fix the issue.
  2. Execute the steps or actions to fix the issue using appropriate tools.
  3. If the necessary tool isnt available, think for alternatives with existing tools to perform the action.
  4. If the issue is not fixed, return response saying you were unable to fix the issue.
  5. If the issue is fixed, return response saying the issue is fixed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors