# karthik232916/fieldfix-ai-agent architecture

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

- Interactive diagram: https://gitdiagram.com/karthik232916/fieldfix-ai-agent
- Repository: https://github.com/karthik232916/fieldfix-ai-agent

## Overview

FieldFix combines an Expo mobile interface with a Python troubleshooting backend. The principal workflow is a technician submitting a device, severity, and problem description; the backend investigates device status and matching knowledge, then uses an AI diagnosis when knowledge is available or falls back to a basic diagnosis on errors. The Expo README describes a generic starter, so it does not document additional FieldFix capabilities. Some frontend and backend routing details were not excerpted; uncertain links are omitted or marked unverified.

Main entry points: [`backend/app/agent_service.py`](https://github.com/karthik232916/fieldfix-ai-agent/blob/master/backend/app/agent_service.py) (Investigation agent), [`backend/app/ai_service.py`](https://github.com/karthik232916/fieldfix-ai-agent/blob/master/backend/app/ai_service.py) (AI diagnosis), [`backend/app/issue_service.py`](https://github.com/karthik232916/fieldfix-ai-agent/blob/master/backend/app/issue_service.py) (Issue processing), [`backend/app/knowledge_service.py`](https://github.com/karthik232916/fieldfix-ai-agent/blob/master/backend/app/knowledge_service.py) (Knowledge search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Technician app"]
  node_issue_screen["Issue submission<br/>[index.tsx]"]
  node_api_client["Issue API client<br/>[api.ts]"]
end

subgraph group_api["Backend API"]
  node_api_entry["API entry point<br/>[main.py]"]
end

subgraph group_investigation["Issue investigation"]
  node_issue_service["Issue processing<br/>[issue_service.py]"]
  node_issue_model["Issue data model<br/>[models.py]"]
  node_agent["Investigation agent<br/>[agent_service.py]"]
  node_device_check["Device status check<br/>[device_service.py]"]
end

subgraph group_diagnosis["Knowledge and diagnosis"]
  node_knowledge_search["Knowledge search"]
  node_knowledge_files["Troubleshooting knowledge"]
  node_ai_service["AI diagnosis<br/>[ai_service.py]"]
  node_ai_client["AI client<br/>[ai_client.py]"]
end

node_technician(("Technician"))
node_ai_provider(("AI provider"))

node_technician -->|"submits issue"| node_issue_screen
node_issue_screen -->|"calls"| node_api_client
node_api_client -.->|"posts issue"| node_api_entry
node_api_entry -->|"routes to"| node_issue_service
node_issue_service -->|"investigates"| node_agent
node_agent -->|"checks status"| node_device_check
node_agent -->|"searches"| node_knowledge_search
node_knowledge_search -->|"reads"| node_knowledge_files
node_agent -->|"requests diagnosis"| node_ai_service
node_ai_service -->|"retrieves context"| node_knowledge_search
node_ai_service -->|"creates client"| node_ai_client
node_ai_client -.->|"connects"| node_ai_provider
node_issue_service -->|"accepts issue"| node_issue_model
node_agent -->|"uses issue"| node_issue_model
node_ai_service -->|"uses issue"| node_issue_model

click node_issue_screen "https://github.com/karthik232916/fieldfix-ai-agent/blob/master/src/app/index.tsx"
click node_api_client "https://github.com/karthik232916/fieldfix-ai-agent/blob/master/src/services/api.ts"
click node_api_entry "https://github.com/karthik232916/fieldfix-ai-agent/blob/master/backend/app/main.py"
click node_issue_service "https://github.com/karthik232916/fieldfix-ai-agent/blob/master/backend/app/issue_service.py"
click node_issue_model "https://github.com/karthik232916/fieldfix-ai-agent/blob/master/backend/app/models.py"
click node_agent "https://github.com/karthik232916/fieldfix-ai-agent/blob/master/backend/app/agent_service.py"
click node_device_check "https://github.com/karthik232916/fieldfix-ai-agent/blob/master/backend/app/device_service.py"
click node_knowledge_search "https://github.com/karthik232916/fieldfix-ai-agent/blob/master/backend/app/knowledge_service.py"
click node_knowledge_files "https://github.com/karthik232916/fieldfix-ai-agent/tree/master/backend/knowledge"
click node_ai_service "https://github.com/karthik232916/fieldfix-ai-agent/blob/master/backend/app/ai_service.py"
click node_ai_client "https://github.com/karthik232916/fieldfix-ai-agent/blob/master/backend/app/ai_client.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_issue_screen,node_api_client toneBlue
class node_api_entry toneAmber
class node_issue_service,node_issue_model,node_agent,node_device_check toneMint
class node_knowledge_search,node_knowledge_files,node_ai_service,node_ai_client toneRose
class node_technician,node_ai_provider toneIndigo
```

## Components

### Technician app

- [Issue submission](https://github.com/karthik232916/fieldfix-ai-agent/blob/master/src/app/index.tsx): `src/app/index.tsx`
- [Issue API client](https://github.com/karthik232916/fieldfix-ai-agent/blob/master/src/services/api.ts): `src/services/api.ts`

### Backend API

- [API entry point](https://github.com/karthik232916/fieldfix-ai-agent/blob/master/backend/app/main.py): `backend/app/main.py`

### Issue investigation

- [Issue processing](https://github.com/karthik232916/fieldfix-ai-agent/blob/master/backend/app/issue_service.py): `backend/app/issue_service.py`
- [Issue data model](https://github.com/karthik232916/fieldfix-ai-agent/blob/master/backend/app/models.py): `backend/app/models.py`
- [Investigation agent](https://github.com/karthik232916/fieldfix-ai-agent/blob/master/backend/app/agent_service.py): `backend/app/agent_service.py`
- [Device status check](https://github.com/karthik232916/fieldfix-ai-agent/blob/master/backend/app/device_service.py): `backend/app/device_service.py`

### Knowledge and diagnosis

- [Knowledge search](https://github.com/karthik232916/fieldfix-ai-agent/blob/master/backend/app/knowledge_service.py): `backend/app/knowledge_service.py`
- [Troubleshooting knowledge](https://github.com/karthik232916/fieldfix-ai-agent/tree/master/backend/knowledge): `backend/knowledge`
- [AI diagnosis](https://github.com/karthik232916/fieldfix-ai-agent/blob/master/backend/app/ai_service.py): `backend/app/ai_service.py`
- [AI client](https://github.com/karthik232916/fieldfix-ai-agent/blob/master/backend/app/ai_client.py): `backend/app/ai_client.py`

### Other components

- **Technician**
- **AI provider**

## Connections

- Technician → Issue submission: submits issue
- Issue submission → Issue API client: calls (evidence: `src/app/index.tsx`)
- Issue API client → API entry point: posts issue
- API entry point → Issue processing: routes to (evidence: `backend/app/main.py`)
- Issue processing → Investigation agent: investigates (evidence: `backend/app/issue_service.py`)
- Investigation agent → Device status check: checks status (evidence: `backend/app/agent_service.py`)
- Investigation agent → Knowledge search: searches (evidence: `backend/app/agent_service.py`)
- Knowledge search → Troubleshooting knowledge: reads (evidence: `backend/app/knowledge_service.py`)
- Investigation agent → AI diagnosis: requests diagnosis (evidence: `backend/app/agent_service.py`)
- AI diagnosis → Knowledge search: retrieves context (evidence: `backend/app/ai_service.py`)
- AI diagnosis → AI client: creates client (evidence: `backend/app/ai_service.py`)
- AI client → AI provider: connects
- Issue processing → Issue data model: accepts issue (evidence: `backend/app/issue_service.py`)
- Investigation agent → Issue data model: uses issue (evidence: `backend/app/agent_service.py`)
- AI diagnosis → Issue data model: uses issue (evidence: `backend/app/ai_service.py`)
