# kanhaiya-bhayana/debuai architecture

> Architecture diagram of the GitHub repository kanhaiya-bhayana/debuai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kanhaiya-bhayana/debuai
- Repository: https://github.com/kanhaiya-bhayana/debuai

## Overview

DebugAI is a stack-trace analysis CLI: it accepts logs, extracts and parses traces, then presents structured diagnostics, optionally enriched with local source, AI analysis, and related GitHub issues. The graph reflects the CLI and supporting modules shown in sampled source; parser routing and the GitHub Action are documented capabilities whose internals were not sampled.

Main entry points: [`debugai/cli.py`](https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/cli.py) (CLI Workflow), [`debugai/parser/registry.py`](https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/parser/registry.py) (Parser Registry), [`debugai/ai_analyzer.py`](https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/ai_analyzer.py) (AI Orchestrator), [`action.yml`](https://github.com/kanhaiya-bhayana/debuai/blob/main/action.yml) (GitHub Action)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Input and CLI"]
  node_cli["CLI Workflow<br/>[cli.py]"]
  node_clipboard["Clipboard Reader<br/>[clipboard.py]"]
  node_github_action["GitHub Action<br/>[action.yml]"]
end

subgraph group_analysis["Trace Analysis"]
  node_analyzer["Trace Analyzer<br/>[analyzer.py]"]
  node_relevance["Trace Ranking<br/>[relevance.py]"]
  node_registry["Parser Registry<br/>[registry.py]"]
  node_python_parser["Python Parser<br/>[python.py]"]
  node_java_parser["Java Parser<br/>[java.py]"]
  node_go_parser["Go Parser<br/>[go.py]"]
  node_csharp_parser["C&#35; Parser<br/>[csharp.py]"]
  node_node_parser["Node Parser<br/>[node.py]"]
end

subgraph group_enrichment["Optional Enrichment"]
  node_context["Source Context<br/>[source_context.py]"]
  node_issues["Issue Search<br/>[issue_search.py]"]
  node_ai_orchestrator["AI Orchestrator<br/>[ai_analyzer.py]"]
  node_provider_base["Provider Contract<br/>[base.py]"]
  node_openai["OpenAI Provider<br/>[openai_provider.py]"]
  node_anthropic["Anthropic Provider"]
  node_nvidia["NVIDIA Provider<br/>[nvidia.py]"]
end

subgraph group_output["Providers and Results"]
  node_result["CLI / JSON Result<br/>[cli.py]"]
end

node_developer(("Developer"))
node_logs["Log Input"]
node_github_runner(("GitHub Actions"))
node_local_files["Local Source Files"]
node_github["GitHub Issues API"]
node_ai_services["AI APIs"]

node_developer -->|"invokes"| node_cli
node_logs -->|"provides input"| node_cli
node_cli -.->|"reads paste"| node_clipboard
node_github_runner -->|"runs"| node_github_action
node_github_action -->|"invokes"| node_cli
node_cli -->|"analyzes traces"| node_analyzer
node_cli -->|"selects trace"| node_relevance
node_analyzer -->|"selects parser"| node_registry
node_registry -->|"dispatches"| node_python_parser
node_registry -->|"dispatches"| node_java_parser
node_registry -->|"dispatches"| node_go_parser
node_registry -->|"dispatches"| node_csharp_parser
node_registry -->|"dispatches"| node_node_parser
node_cli -.->|"reads context"| node_context
node_context -.->|"reads lines"| node_local_files
node_cli -.->|"requests analysis"| node_ai_orchestrator
node_ai_orchestrator -.->|"uses contract"| node_provider_base
node_ai_orchestrator -.->|"selects provider"| node_openai
node_ai_orchestrator -.->|"selects provider"| node_anthropic
node_ai_orchestrator -.->|"selects provider"| node_nvidia
node_openai -.->|"sends prompt"| node_ai_services
node_anthropic -.->|"sends prompt"| node_ai_services
node_nvidia -.->|"sends prompt"| node_ai_services
node_cli -.->|"searches issues"| node_issues
node_issues -.->|"queries"| node_github
node_cli -->|"renders result"| node_result

click node_cli "https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/cli.py"
click node_clipboard "https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/clipboard.py"
click node_github_action "https://github.com/kanhaiya-bhayana/debuai/blob/main/action.yml"
click node_analyzer "https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/analyzer.py"
click node_relevance "https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/scorer/relevance.py"
click node_registry "https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/parser/registry.py"
click node_python_parser "https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/parser/python.py"
click node_java_parser "https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/parser/java.py"
click node_go_parser "https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/parser/go.py"
click node_csharp_parser "https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/parser/csharp.py"
click node_node_parser "https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/parser/node.py"
click node_context "https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/source_context.py"
click node_issues "https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/issue_search.py"
click node_ai_orchestrator "https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/ai_analyzer.py"
click node_provider_base "https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/providers/base.py"
click node_openai "https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/providers/openai_provider.py"
click node_anthropic "https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/providers/anthropic_provider.py"
click node_nvidia "https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/providers/nvidia.py"
click node_result "https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/cli.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_clipboard,node_github_action toneBlue
class node_analyzer,node_relevance,node_registry,node_python_parser,node_java_parser,node_go_parser,node_csharp_parser,node_node_parser toneAmber
class node_context,node_issues,node_ai_orchestrator,node_provider_base,node_openai,node_anthropic,node_nvidia,node_github,node_ai_services toneMint
class node_result toneRose
class node_developer,node_logs,node_github_runner,node_local_files toneIndigo
```

## Components

### Input and CLI

- [CLI Workflow](https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/cli.py): `debugai/cli.py`
- [Clipboard Reader](https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/clipboard.py): `debugai/clipboard.py`
- [GitHub Action](https://github.com/kanhaiya-bhayana/debuai/blob/main/action.yml): `action.yml`

### Trace Analysis

- [Trace Analyzer](https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/analyzer.py): `debugai/analyzer.py`
- [Trace Ranking](https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/scorer/relevance.py): `debugai/scorer/relevance.py`
- [Parser Registry](https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/parser/registry.py): `debugai/parser/registry.py`
- [Python Parser](https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/parser/python.py): `debugai/parser/python.py`
- [Java Parser](https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/parser/java.py): `debugai/parser/java.py`
- [Go Parser](https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/parser/go.py): `debugai/parser/go.py`
- [C# Parser](https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/parser/csharp.py): `debugai/parser/csharp.py`
- [Node Parser](https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/parser/node.py): `debugai/parser/node.py`

### Optional Enrichment

- [Source Context](https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/source_context.py): `debugai/source_context.py`
- [Issue Search](https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/issue_search.py): `debugai/issue_search.py`
- [AI Orchestrator](https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/ai_analyzer.py): `debugai/ai_analyzer.py`
- [Provider Contract](https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/providers/base.py): `debugai/providers/base.py`
- [OpenAI Provider](https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/providers/openai_provider.py): `debugai/providers/openai_provider.py`
- [Anthropic Provider](https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/providers/anthropic_provider.py): `debugai/providers/anthropic_provider.py`
- [NVIDIA Provider](https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/providers/nvidia.py): `debugai/providers/nvidia.py`

### Providers and Results

- [CLI / JSON Result](https://github.com/kanhaiya-bhayana/debuai/blob/main/debugai/cli.py): `debugai/cli.py`

### Other components

- **Developer**
- **Log Input**
- **GitHub Actions**
- **Local Source Files**
- **GitHub Issues API**
- **AI APIs**

## Connections

- Developer → CLI Workflow: invokes
- Log Input → CLI Workflow: provides input
- CLI Workflow → Clipboard Reader: reads paste
- GitHub Actions → GitHub Action: runs
- GitHub Action → CLI Workflow: invokes
- CLI Workflow → Trace Analyzer: analyzes traces
- CLI Workflow → Trace Ranking: selects trace
- Trace Analyzer → Parser Registry: selects parser
- Parser Registry → Python Parser: dispatches
- Parser Registry → Java Parser: dispatches
- Parser Registry → Go Parser: dispatches
- Parser Registry → C# Parser: dispatches
- Parser Registry → Node Parser: dispatches
- CLI Workflow → Source Context: reads context
- Source Context → Local Source Files: reads lines
- CLI Workflow → AI Orchestrator: requests analysis
- AI Orchestrator → Provider Contract: uses contract
- AI Orchestrator → OpenAI Provider: selects provider
- AI Orchestrator → Anthropic Provider: selects provider
- AI Orchestrator → NVIDIA Provider: selects provider
- OpenAI Provider → AI APIs: sends prompt
- Anthropic Provider → AI APIs: sends prompt
- NVIDIA Provider → AI APIs: sends prompt
- CLI Workflow → Issue Search: searches issues
- Issue Search → GitHub Issues API: queries
- CLI Workflow → CLI / JSON Result: renders result
