# kalebu/desktop-chatbot-app architecture

> Architecture diagram of the GitHub repository kalebu/desktop-chatbot-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kalebu/desktop-chatbot-app
- Repository: https://github.com/kalebu/desktop-chatbot-app

## Overview

This small Tkinter desktop chatbot accepts a message, finds the closest matching key in its knowledge dictionary, and displays either the associated reply or a fallback. The UI, matching logic, and transcript updates are implemented together in app.py; knowledge.json supplies the response data. Relationships are based on the shown app.py excerpt and README. No separate service or storage layer is present.

Main entry points: [`app.py`](https://github.com/kalebu/desktop-chatbot-app/blob/master/app.py) (Chat window), [`knowledge.json`](https://github.com/kalebu/desktop-chatbot-app/blob/master/knowledge.json) (Knowledge dictionary)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop interface"]
  node_chat_ui["Chat window<br/>[app.py]"]
end

subgraph group_chat["Chat response"]
  node_reply_logic["Reply matching<br/>[app.py]"]
  node_knowledge[("Knowledge dictionary<br/>[knowledge.json]")]
end

node_user(("User"))
node_tkinter["Tkinter"]

node_user -->|"enters message"| node_chat_ui
node_chat_ui -->|"invokes reply"| node_reply_logic
node_reply_logic -->|"loads and looks up"| node_knowledge
node_reply_logic -->|"adds transcript"| node_chat_ui
node_chat_ui -->|"builds interface"| node_tkinter

click node_chat_ui "https://github.com/kalebu/desktop-chatbot-app/blob/master/app.py"
click node_reply_logic "https://github.com/kalebu/desktop-chatbot-app/blob/master/app.py"
click node_knowledge "https://github.com/kalebu/desktop-chatbot-app/blob/master/knowledge.json"

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_chat_ui,node_user toneBlue
class node_reply_logic,node_knowledge toneAmber
class node_tkinter toneIndigo
```

## Components

### Desktop interface

- [Chat window](https://github.com/kalebu/desktop-chatbot-app/blob/master/app.py): `app.py`

### Chat response

- [Reply matching](https://github.com/kalebu/desktop-chatbot-app/blob/master/app.py): `app.py`
- [Knowledge dictionary](https://github.com/kalebu/desktop-chatbot-app/blob/master/knowledge.json): `knowledge.json`

### Other components

- **User**
- **Tkinter**

## Connections

- User → Chat window: enters message (evidence: `README.md`)
- Chat window → Reply matching: invokes reply (evidence: `app.py`)
- Reply matching → Knowledge dictionary: loads and looks up (evidence: `app.py`)
- Reply matching → Chat window: adds transcript (evidence: `app.py`)
- Chat window → Tkinter: builds interface (evidence: `app.py`)
