# b2kproedit/b2kpro-ai-agent architecture

> Architecture diagram of the GitHub repository b2kproedit/b2kpro-ai-agent, 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/b2kproedit/b2kpro-ai-agent
- Repository: https://github.com/b2kproedit/b2kpro-ai-agent

## Overview

B2k AI Assistant PRO is a single-file desktop conversational assistant. The main workflow is user text or speech input, command handling and/or AI response generation with conversation history, then an in-app response; optional speech output and desktop actions extend that flow. The README is empty, so capabilities are identified from the source header and sampled code. Several implementation sections are omitted, so uncertain wiring is left out.

Main entry points: [`main.py`](https://github.com/b2kproedit/b2kpro-ai-agent/blob/main/main.py) (Assistant window)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Desktop interaction"]
  node_app["Assistant window<br/>[main.py]"]
  node_input["Input handling<br/>[main.py]"]
  node_response["Chat display<br/>[main.py]"]
end

subgraph group_conversation["Conversation runtime"]
  node_history["Chat history<br/>[main.py]"]
  node_ai["AI engine<br/>[main.py]"]
  node_log["Persistent chat log<br/>[main.py]"]
end

subgraph group_capabilities["Assistant features"]
  node_commands["Local commands<br/>[main.py]"]
  node_voice["Voice input<br/>[main.py]"]
  node_speechout["Voice feedback<br/>[main.py]"]
  node_palette["Command palette<br/>[main.py]"]
  node_settings["Settings panel<br/>[main.py]"]
  node_expressions["Avatar animation<br/>[main.py]"]
end

subgraph group_integrations["External integrations"]
  node_anthropic["Anthropic API"]
  node_speechrecognition["Speech recognition"]
  node_microphone["Microphone"]
  node_tts["Text-to-speech engine"]
  node_desktop["Desktop apps and web"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"dispatches text"| node_input
node_input -->|"records turn"| node_history
node_input -->|"checks command"| node_commands
node_input -->|"requests response"| node_ai
node_ai -.->|"calls API"| node_anthropic
node_input -->|"shows result"| node_response
node_app -->|"starts listening"| node_voice
node_voice -->|"captures audio"| node_microphone
node_voice -->|"recognizes speech"| node_speechrecognition
node_app -->|"speaks response"| node_speechout
node_speechout -.->|"synthesizes speech"| node_tts
node_commands -->|"opens target"| node_desktop
node_app -->|"opens palette"| node_palette
node_app -->|"opens settings"| node_settings
node_app -->|"updates expression"| node_expressions
node_history -->|"persists log"| node_log

click node_app "https://github.com/b2kproedit/b2kpro-ai-agent/blob/main/main.py"
click node_input "https://github.com/b2kproedit/b2kpro-ai-agent/blob/main/main.py"
click node_response "https://github.com/b2kproedit/b2kpro-ai-agent/blob/main/main.py"
click node_history "https://github.com/b2kproedit/b2kpro-ai-agent/blob/main/main.py"
click node_ai "https://github.com/b2kproedit/b2kpro-ai-agent/blob/main/main.py"
click node_commands "https://github.com/b2kproedit/b2kpro-ai-agent/blob/main/main.py"
click node_voice "https://github.com/b2kproedit/b2kpro-ai-agent/blob/main/main.py"
click node_speechout "https://github.com/b2kproedit/b2kpro-ai-agent/blob/main/main.py"
click node_palette "https://github.com/b2kproedit/b2kpro-ai-agent/blob/main/main.py"
click node_settings "https://github.com/b2kproedit/b2kpro-ai-agent/blob/main/main.py"
click node_expressions "https://github.com/b2kproedit/b2kpro-ai-agent/blob/main/main.py"
click node_log "https://github.com/b2kproedit/b2kpro-ai-agent/blob/main/main.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_app,node_input,node_response,node_user toneBlue
class node_history,node_ai,node_log toneAmber
class node_commands,node_voice,node_speechout,node_palette,node_settings,node_expressions toneMint
class node_anthropic,node_speechrecognition,node_microphone,node_tts,node_desktop toneRose
```

## Components

### Desktop interaction

- [Assistant window](https://github.com/b2kproedit/b2kpro-ai-agent/blob/main/main.py): `main.py`
- [Input handling](https://github.com/b2kproedit/b2kpro-ai-agent/blob/main/main.py): `main.py`
- [Chat display](https://github.com/b2kproedit/b2kpro-ai-agent/blob/main/main.py): `main.py`

### Conversation runtime

- [Chat history](https://github.com/b2kproedit/b2kpro-ai-agent/blob/main/main.py): `main.py`
- [AI engine](https://github.com/b2kproedit/b2kpro-ai-agent/blob/main/main.py): `main.py`
- [Persistent chat log](https://github.com/b2kproedit/b2kpro-ai-agent/blob/main/main.py): `main.py`

### Assistant features

- [Local commands](https://github.com/b2kproedit/b2kpro-ai-agent/blob/main/main.py): `main.py`
- [Voice input](https://github.com/b2kproedit/b2kpro-ai-agent/blob/main/main.py): `main.py`
- [Voice feedback](https://github.com/b2kproedit/b2kpro-ai-agent/blob/main/main.py): `main.py`
- [Command palette](https://github.com/b2kproedit/b2kpro-ai-agent/blob/main/main.py): `main.py`
- [Settings panel](https://github.com/b2kproedit/b2kpro-ai-agent/blob/main/main.py): `main.py`
- [Avatar animation](https://github.com/b2kproedit/b2kpro-ai-agent/blob/main/main.py): `main.py`

### External integrations

- **Anthropic API**
- **Speech recognition**
- **Microphone**
- **Text-to-speech engine**
- **Desktop apps and web**

### Other components

- **User**

## Connections

- User → Assistant window: uses
- Assistant window → Input handling: dispatches text
- Input handling → Chat history: records turn
- Input handling → Local commands: checks command
- Input handling → AI engine: requests response
- AI engine → Anthropic API: calls API
- Input handling → Chat display: shows result
- Assistant window → Voice input: starts listening
- Voice input → Microphone: captures audio
- Voice input → Speech recognition: recognizes speech
- Assistant window → Voice feedback: speaks response
- Voice feedback → Text-to-speech engine: synthesizes speech
- Local commands → Desktop apps and web: opens target
- Assistant window → Command palette: opens palette
- Assistant window → Settings panel: opens settings
- Assistant window → Avatar animation: updates expression
- Chat history → Persistent chat log: persists log
