# immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management architecture

> Architecture diagram of the GitHub repository immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management
- Repository: https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management

## Overview

This is a garage-management chatbot for automobile sales and after-sales support. A customer enters a message through the console; the LangGraph harness routes it to sales advice, discount review, contract guidance, or maintenance support, then returns the assistant response. Sales and maintenance can invoke tools, which access in-memory car, discount, and maintenance repositories. The graph also checkpoints conversation state by session thread ID. The README is high-level; the detailed workflow and integrations shown here are supported by the sampled source files.

Main entry points: [`agent_nodes.py`](https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/agent_nodes.py) (Tool Executor), [`db_repositories.py`](https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/db_repositories.py) (In-Memory Repositories), [`graph_builder.py`](https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/graph_builder.py) (Graph Harness), [`main.py`](https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/main.py) (Chat Console)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_conversation["Conversation Runtime"]
  node_console["Chat Console<br/>[main.py]"]
  node_harness["Graph Harness<br/>[graph_builder.py]"]
end

subgraph group_stages["Service Stages"]
  node_router["Stage Router<br/>[agent_nodes.py]"]
  node_sales["Sales Advice<br/>[agent_nodes.py]"]
  node_discount_review["Discount Review<br/>[agent_nodes.py]"]
  node_contract["Contract Guidance<br/>[agent_nodes.py]"]
  node_maintenance["Maintenance Advice<br/>[agent_nodes.py]"]
end

subgraph group_tools["Tools and Data Access"]
  node_tool_executor["Tool Executor<br/>[agent_nodes.py]"]
  node_search_cars["Search Cars<br/>[tools.py]"]
  node_car_price["Get Car Price<br/>[tools.py]"]
  node_request_discount["Request Discount<br/>[tools.py]"]
  node_lookup_maintenance["Lookup Maintenance<br/>[tools.py]"]
  node_repositories[("In-Memory Repositories<br/>[db_repositories.py]")]
end

subgraph group_state["Session State"]
  node_state_schema["Harness State<br/>[harness_state.py]"]
  node_checkpoint[("Memory Checkpointer<br/>[graph_builder.py]")]
end

node_customer(("Customer"))
node_llm{{"OpenAI Chat Model"}}

node_customer -->|"sends message"| node_console
node_console -->|"builds and invokes"| node_harness
node_harness -->|"starts workflow"| node_router
node_router -->|"routes by stage"| node_sales
node_router -->|"routes by stage"| node_discount_review
node_router -->|"routes by stage"| node_contract
node_router -->|"routes by stage"| node_maintenance
node_sales -->|"requests response"| node_llm
node_maintenance -->|"requests response"| node_llm
node_discount_review -->|"requests response"| node_llm
node_contract -->|"requests response"| node_llm
node_sales -->|"dispatches tool calls"| node_tool_executor
node_maintenance -->|"dispatches tool calls"| node_tool_executor
node_tool_executor -->|"executes selected tool"| node_search_cars
node_tool_executor -->|"executes selected tool"| node_car_price
node_tool_executor -->|"executes selected tool"| node_request_discount
node_tool_executor -->|"executes selected tool"| node_lookup_maintenance
node_search_cars -->|"searches cars"| node_repositories
node_car_price -->|"looks up car"| node_repositories
node_request_discount -->|"reads car; creates request"| node_repositories
node_lookup_maintenance -->|"reads maintenance data"| node_repositories
node_discount_review -->|"reads latest request"| node_repositories
node_harness -->|"saves session state"| node_checkpoint
node_harness -->|"passes workflow state"| node_state_schema

click node_console "https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/main.py"
click node_harness "https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/graph_builder.py"
click node_router "https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/agent_nodes.py"
click node_sales "https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/agent_nodes.py"
click node_discount_review "https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/agent_nodes.py"
click node_contract "https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/agent_nodes.py"
click node_maintenance "https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/agent_nodes.py"
click node_tool_executor "https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/agent_nodes.py"
click node_search_cars "https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/tools.py"
click node_car_price "https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/tools.py"
click node_request_discount "https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/tools.py"
click node_lookup_maintenance "https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/tools.py"
click node_repositories "https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/db_repositories.py"
click node_state_schema "https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/harness_state.py"
click node_checkpoint "https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/graph_builder.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_console,node_harness toneBlue
class node_router,node_sales,node_discount_review,node_contract,node_maintenance toneAmber
class node_tool_executor,node_search_cars,node_car_price,node_request_discount,node_lookup_maintenance,node_repositories toneMint
class node_state_schema,node_checkpoint toneRose
class node_customer,node_llm toneIndigo
```

## Components

### Conversation Runtime

- [Chat Console](https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/main.py): `main.py`
- [Graph Harness](https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/graph_builder.py): `graph_builder.py`

### Service Stages

- [Stage Router](https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/agent_nodes.py): `agent_nodes.py`
- [Sales Advice](https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/agent_nodes.py): `agent_nodes.py`
- [Discount Review](https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/agent_nodes.py): `agent_nodes.py`
- [Contract Guidance](https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/agent_nodes.py): `agent_nodes.py`
- [Maintenance Advice](https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/agent_nodes.py): `agent_nodes.py`

### Tools and Data Access

- [Tool Executor](https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/agent_nodes.py): `agent_nodes.py`
- [Search Cars](https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/tools.py): `tools.py`
- [Get Car Price](https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/tools.py): `tools.py`
- [Request Discount](https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/tools.py): `tools.py`
- [Lookup Maintenance](https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/tools.py): `tools.py`
- [In-Memory Repositories](https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/db_repositories.py): `db_repositories.py`

### Session State

- [Harness State](https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/harness_state.py): `harness_state.py`
- [Memory Checkpointer](https://github.com/immanuel-khang/personalized-chatbot-for-auto-request-response-supporting-automobile-garage-management/blob/main/graph_builder.py): `graph_builder.py`

### Other components

- **Customer**
- **OpenAI Chat Model**

## Connections

- Customer → Chat Console: sends message
- Chat Console → Graph Harness: builds and invokes
- Graph Harness → Stage Router: starts workflow
- Stage Router → Sales Advice: routes by stage
- Stage Router → Discount Review: routes by stage
- Stage Router → Contract Guidance: routes by stage
- Stage Router → Maintenance Advice: routes by stage
- Sales Advice → OpenAI Chat Model: requests response
- Maintenance Advice → OpenAI Chat Model: requests response
- Discount Review → OpenAI Chat Model: requests response
- Contract Guidance → OpenAI Chat Model: requests response
- Sales Advice → Tool Executor: dispatches tool calls
- Maintenance Advice → Tool Executor: dispatches tool calls
- Tool Executor → Search Cars: executes selected tool
- Tool Executor → Get Car Price: executes selected tool
- Tool Executor → Request Discount: executes selected tool
- Tool Executor → Lookup Maintenance: executes selected tool
- Search Cars → In-Memory Repositories: searches cars
- Get Car Price → In-Memory Repositories: looks up car
- Request Discount → In-Memory Repositories: reads car; creates request
- Lookup Maintenance → In-Memory Repositories: reads maintenance data
- Discount Review → In-Memory Repositories: reads latest request
- Graph Harness → Memory Checkpointer: saves session state
- Graph Harness → Harness State: passes workflow state
