# giriprasad-05/homerepair-ai architecture

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

- Interactive diagram: https://gitdiagram.com/giriprasad-05/homerepair-ai
- Repository: https://github.com/giriprasad-05/homerepair-ai

## Overview

HomeRepair AI coordinates appliance registration, issue reporting, AI investigation, and repair follow-up. The main workflow runs from the React interface through FastAPI to the LangGraph agent, which uses history and persistent memory to choose an investigation path, gather evidence with diagnostic tools, and produce a diagnosis. Appliance, issue, symptom, repair, and memory records support ongoing history and outcome tracking. The README documents capabilities beyond the sampled backend excerpts; those links are represented as documented relationships, not as claims that unsampled code was inspected.

Main entry points: [`backend/app/agent/nodes.py`](https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/agent/nodes.py) (Reasoning and Decisions), [`backend/app/database/session.py`](https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/database/session.py) (SQL Database), [`frontend/src/App.jsx`](https://github.com/giriprasad-05/homerepair-ai/blob/main/frontend/src/App.jsx) (React App), [`frontend/src/services/api.js`](https://github.com/giriprasad-05/homerepair-ai/blob/main/frontend/src/services/api.js) (API Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User Interface"]
  node_app["React App<br/>[App.jsx]"]
  node_appliance_page["Appliance Management"]
  node_issues_page["Issue Tracking"]
  node_investigation_page["AI Investigation"]
  node_frontend_api["API Client<br/>[api.js]"]
end

subgraph group_api["API and Services"]
  node_fastapi["FastAPI Application<br/>[main.py]"]
  node_appliance_routes["Appliance Routes<br/>[appliances.py]"]
  node_issue_routes["Issue Routes<br/>[issues.py]"]
  node_agent_routes["Agent Route<br/>[agent.py]"]
  node_appliance_service["Appliance Service"]
  node_issue_service["Issue Service<br/>[issue_service.py]"]
  node_repair_service["Repair Service<br/>[repair_service.py]"]
end

subgraph group_agent["Diagnosis Agent"]
  node_agent_graph["LangGraph Workflow<br/>[graph.py]"]
  node_agent_nodes["Reasoning and Decisions<br/>[nodes.py]"]
  node_llm["OpenRouter LLM<br/>[llm.py]"]
  node_history_match["History Matching"]
  node_memory_service["Persistent Memory<br/>[memory_service.py]"]
  node_history_tool["Appliance History Tool"]
  node_outcome_tool["Repair Outcome Tool"]
  node_warranty_tool["Warranty Tool<br/>[warranty_tool.py]"]
  node_pattern_tool["Symptom Pattern Tool"]
  node_manual_tool["Manual Lookup Tool"]
end

subgraph group_domain["Repair Records"]
  node_appliance_records["Appliance Records<br/>[appliance.py]"]
  node_issue_records["Issue and Symptoms<br/>[issue.py]"]
  node_repair_records["Repair History<br/>[repair.py]"]
  node_memory_records["Memory Records<br/>[memory.py]"]
end

subgraph group_storage["Persistence"]
  node_database[("SQL Database<br/>[session.py]")]
end

node_user(("Homeowner"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_appliance_page
node_app -->|"routes to"| node_issues_page
node_app -.->|"routes to"| node_investigation_page
node_appliance_page -->|"requests data"| node_frontend_api
node_issues_page -->|"requests data"| node_frontend_api
node_investigation_page -->|"requests diagnosis"| node_frontend_api
node_frontend_api -->|"sends API requests"| node_fastapi
node_fastapi -->|"registers routes"| node_appliance_routes
node_appliance_routes -->|"delegates"| node_appliance_service
node_appliance_routes -->|"delegates"| node_issue_service
node_issue_routes -.->|"delegates"| node_issue_service
node_agent_routes -.->|"starts investigation"| node_agent_graph
node_agent_graph -.->|"runs workflow"| node_agent_nodes
node_agent_nodes -.->|"checks history"| node_history_match
node_agent_nodes -.->|"retrieves memory"| node_memory_service
node_agent_nodes -.->|"selects tool"| node_history_tool
node_agent_nodes -.->|"selects tool"| node_outcome_tool
node_agent_nodes -.->|"selects tool"| node_warranty_tool
node_agent_nodes -.->|"selects tool"| node_pattern_tool
node_agent_nodes -.->|"selects tool"| node_manual_tool
node_agent_nodes -.->|"generates diagnosis"| node_llm
node_appliance_service -->|"reads and writes"| node_appliance_records
node_issue_service -->|"reads and writes"| node_issue_records
node_repair_service -->|"validates issue"| node_issue_service
node_repair_service -->|"writes repair"| node_repair_records
node_history_match -->|"compares incidents"| node_issue_records
node_history_match -->|"checks outcomes"| node_repair_records
node_memory_service -->|"reads and writes"| node_memory_records
node_fastapi -->|"initializes tables"| node_database
node_appliance_records -.->|"stored in"| node_database
node_issue_records -.->|"stored in"| node_database
node_repair_records -.->|"stored in"| node_database
node_memory_records -.->|"stored in"| node_database

click node_app "https://github.com/giriprasad-05/homerepair-ai/blob/main/frontend/src/App.jsx"
click node_appliance_page "https://github.com/giriprasad-05/homerepair-ai/blob/main/frontend/src/pages/MyAppliancesPage.jsx"
click node_issues_page "https://github.com/giriprasad-05/homerepair-ai/blob/main/frontend/src/pages/RepairIssuesPage.jsx"
click node_investigation_page "https://github.com/giriprasad-05/homerepair-ai/blob/main/frontend/src/pages/AIInvestigationPage.jsx"
click node_frontend_api "https://github.com/giriprasad-05/homerepair-ai/blob/main/frontend/src/services/api.js"
click node_fastapi "https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/main.py"
click node_appliance_routes "https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/api/appliances.py"
click node_issue_routes "https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/api/issues.py"
click node_agent_routes "https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/api/agent.py"
click node_appliance_service "https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/services/appliance_service.py"
click node_issue_service "https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/services/issue_service.py"
click node_repair_service "https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/services/repair_service.py"
click node_agent_graph "https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/agent/graph.py"
click node_agent_nodes "https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/agent/nodes.py"
click node_llm "https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/agent/llm.py"
click node_history_match "https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/services/history_matching_service.py"
click node_memory_service "https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/services/memory_service.py"
click node_history_tool "https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/tools/appliance_history_tool.py"
click node_outcome_tool "https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/tools/repair_outcome_tool.py"
click node_warranty_tool "https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/tools/warranty_tool.py"
click node_pattern_tool "https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/tools/symptom_pattern_tool.py"
click node_manual_tool "https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/tools/manual_lookup_tool.py"
click node_appliance_records "https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/models/appliance.py"
click node_issue_records "https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/models/issue.py"
click node_repair_records "https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/models/repair.py"
click node_memory_records "https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/models/memory.py"
click node_database "https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/database/session.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_appliance_page,node_issues_page,node_investigation_page,node_frontend_api toneBlue
class node_fastapi,node_appliance_routes,node_issue_routes,node_agent_routes,node_appliance_service,node_issue_service,node_repair_service toneAmber
class node_agent_graph,node_agent_nodes,node_llm,node_history_match,node_memory_service,node_history_tool,node_outcome_tool,node_warranty_tool,node_pattern_tool,node_manual_tool toneMint
class node_appliance_records,node_issue_records,node_repair_records,node_memory_records toneRose
class node_database,node_user toneIndigo
```

## Components

### User Interface

- [React App](https://github.com/giriprasad-05/homerepair-ai/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Appliance Management](https://github.com/giriprasad-05/homerepair-ai/blob/main/frontend/src/pages/MyAppliancesPage.jsx): `frontend/src/pages/MyAppliancesPage.jsx`
- [Issue Tracking](https://github.com/giriprasad-05/homerepair-ai/blob/main/frontend/src/pages/RepairIssuesPage.jsx): `frontend/src/pages/RepairIssuesPage.jsx`
- [AI Investigation](https://github.com/giriprasad-05/homerepair-ai/blob/main/frontend/src/pages/AIInvestigationPage.jsx): `frontend/src/pages/AIInvestigationPage.jsx`
- [API Client](https://github.com/giriprasad-05/homerepair-ai/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### API and Services

- [FastAPI Application](https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/main.py): `backend/app/main.py`
- [Appliance Routes](https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/api/appliances.py): `backend/app/api/appliances.py`
- [Issue Routes](https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/api/issues.py): `backend/app/api/issues.py`
- [Agent Route](https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/api/agent.py): `backend/app/api/agent.py`
- [Appliance Service](https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/services/appliance_service.py): `backend/app/services/appliance_service.py`
- [Issue Service](https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/services/issue_service.py): `backend/app/services/issue_service.py`
- [Repair Service](https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/services/repair_service.py): `backend/app/services/repair_service.py`

### Diagnosis Agent

- [LangGraph Workflow](https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/agent/graph.py): `backend/app/agent/graph.py`
- [Reasoning and Decisions](https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/agent/nodes.py): `backend/app/agent/nodes.py`
- [OpenRouter LLM](https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/agent/llm.py): `backend/app/agent/llm.py`
- [History Matching](https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/services/history_matching_service.py): `backend/app/services/history_matching_service.py`
- [Persistent Memory](https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/services/memory_service.py): `backend/app/services/memory_service.py`
- [Appliance History Tool](https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/tools/appliance_history_tool.py): `backend/app/tools/appliance_history_tool.py`
- [Repair Outcome Tool](https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/tools/repair_outcome_tool.py): `backend/app/tools/repair_outcome_tool.py`
- [Warranty Tool](https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/tools/warranty_tool.py): `backend/app/tools/warranty_tool.py`
- [Symptom Pattern Tool](https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/tools/symptom_pattern_tool.py): `backend/app/tools/symptom_pattern_tool.py`
- [Manual Lookup Tool](https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/tools/manual_lookup_tool.py): `backend/app/tools/manual_lookup_tool.py`

### Repair Records

- [Appliance Records](https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/models/appliance.py): `backend/app/models/appliance.py`
- [Issue and Symptoms](https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/models/issue.py): `backend/app/models/issue.py`
- [Repair History](https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/models/repair.py): `backend/app/models/repair.py`
- [Memory Records](https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/models/memory.py): `backend/app/models/memory.py`

### Persistence

- [SQL Database](https://github.com/giriprasad-05/homerepair-ai/blob/main/backend/app/database/session.py): `backend/app/database/session.py`

### Other components

- **Homeowner**

## Connections

- Homeowner → React App: uses (evidence: `README.md`)
- React App → Appliance Management: routes to (evidence: `frontend/src/App.jsx`)
- React App → Issue Tracking: routes to (evidence: `frontend/src/App.jsx`)
- React App → AI Investigation: routes to
- Appliance Management → API Client: requests data
- Issue Tracking → API Client: requests data (evidence: `frontend/src/pages/RepairIssuesPage.jsx`)
- AI Investigation → API Client: requests diagnosis (evidence: `frontend/src/pages/AIInvestigationPage.jsx`)
- API Client → FastAPI Application: sends API requests (evidence: `README.md`)
- FastAPI Application → Appliance Routes: registers routes (evidence: `backend/app/main.py`)
- Appliance Routes → Appliance Service: delegates (evidence: `backend/app/api/appliances.py`)
- Appliance Routes → Issue Service: delegates (evidence: `backend/app/api/appliances.py`)
- Issue Routes → Issue Service: delegates
- Agent Route → LangGraph Workflow: starts investigation (evidence: `README.md`)
- LangGraph Workflow → Reasoning and Decisions: runs workflow (evidence: `README.md`)
- Reasoning and Decisions → History Matching: checks history (evidence: `README.md`)
- Reasoning and Decisions → Persistent Memory: retrieves memory (evidence: `README.md`)
- Reasoning and Decisions → Appliance History Tool: selects tool (evidence: `README.md`)
- Reasoning and Decisions → Repair Outcome Tool: selects tool (evidence: `README.md`)
- Reasoning and Decisions → Warranty Tool: selects tool (evidence: `README.md`)
- Reasoning and Decisions → Symptom Pattern Tool: selects tool (evidence: `README.md`)
- Reasoning and Decisions → Manual Lookup Tool: selects tool (evidence: `README.md`)
- Reasoning and Decisions → OpenRouter LLM: generates diagnosis (evidence: `README.md`)
- Appliance Service → Appliance Records: reads and writes (evidence: `backend/app/services/appliance_service.py`)
- Issue Service → Issue and Symptoms: reads and writes (evidence: `backend/app/services/issue_service.py`)
- Repair Service → Issue Service: validates issue (evidence: `backend/app/services/repair_service.py`)
- Repair Service → Repair History: writes repair (evidence: `backend/app/services/repair_service.py`)
- History Matching → Issue and Symptoms: compares incidents (evidence: `backend/app/services/history_matching_service.py`)
- History Matching → Repair History: checks outcomes (evidence: `backend/app/services/history_matching_service.py`)
- Persistent Memory → Memory Records: reads and writes (evidence: `backend/app/services/memory_service.py`)
- FastAPI Application → SQL Database: initializes tables (evidence: `backend/app/main.py`)
- Appliance Records → SQL Database: stored in (evidence: `README.md`)
- Issue and Symptoms → SQL Database: stored in (evidence: `README.md`)
- Repair History → SQL Database: stored in (evidence: `README.md`)
- Memory Records → SQL Database: stored in (evidence: `README.md`)
