# hamdane1548/agent_location_voiture architecture

> Architecture diagram of the GitHub repository hamdane1548/agent_location_voiture, 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/hamdane1548/agent_location_voiture
- Repository: https://github.com/hamdane1548/agent_location_voiture

## Overview

Opoo Car Rental is a React chat interface backed by a FastAPI rental assistant. A customer submits a question with recent conversation history; the API builds a retrieval query, searches rental-document context in Chroma, and asks an OpenRouter model to produce a response using both retrieved information and the documented vehicle catalog. The backend also contains PDF embedding and vector-save functionality. The README documents the frontend-to-API connection; some ingestion details are supported by module references rather than a shown end-to-end ingestion route.

Main entry points: [`agent_backend/src/agent/agentConnect.py`](https://github.com/hamdane1548/agent_location_voiture/blob/master/agent_backend/src/agent/agentConnect.py) (Answer generation), [`SupportClient/src/pages/Agent.tsx`](https://github.com/hamdane1548/agent_location_voiture/blob/master/SupportClient/src/pages/Agent.tsx) (Chat page), [`SupportClient/src/Router/router.tsx`](https://github.com/hamdane1548/agent_location_voiture/blob/master/SupportClient/src/Router/router.tsx) (Chat route), [`SupportClient/src/Layout/Main-Layout.tsx`](https://github.com/hamdane1548/agent_location_voiture/blob/master/SupportClient/src/Layout/Main-Layout.tsx) (Page layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Chat interface"]
  node_app["React application<br/>[App.tsx]"]
  node_router["Chat route<br/>[router.tsx]"]
  node_layout["Page layout<br/>[Main-Layout.tsx]"]
  node_header["Header and logo<br/>[Header.tsx]"]
  node_footer["Footer<br/>[Footer.tsx]"]
  node_logo["Interactive logo<br/>[Logo.tsx]"]
  node_chat["Chat page<br/>[Agent.tsx]"]
  node_avatar["Assistant avatar<br/>[shdr-19.tsx]"]
end

subgraph group_api["Assistant API"]
  node_chatapi["Chat endpoint<br/>[agentConnect.py]"]
  node_answer["Answer generation<br/>[agentConnect.py]"]
  node_catalog["Rental catalog prompt<br/>[agentConnect.py]"]
end

subgraph group_rag["Document retrieval"]
  node_embeddings["Text embeddings<br/>[Embedding.py]"]
  node_chunks["Chunk model<br/>[Chunks.py]"]
  node_vectorservice["Vector search and save"]
end

subgraph group_infra["Configuration and storage"]
  node_settings["Backend settings<br/>[Settings.py]"]
  node_chromaconnection["Chroma connection<br/>[chromedb.py]"]
end

subgraph group_external["External services"]
  node_chromadb[("Chroma Cloud")]
  node_openrouter["OpenRouter model"]
end

node_customer(("Customer"))

node_customer -->|"asks"| node_chat
node_app -->|"provides routes"| node_router
node_router -->|"renders"| node_layout
node_router -->|"renders"| node_chat
node_layout -->|"renders"| node_header
node_layout -->|"renders"| node_footer
node_header -->|"renders"| node_logo
node_chat -->|"renders"| node_avatar
node_chat -->|"posts question"| node_chatapi
node_chatapi -->|"generates answer"| node_answer
node_answer -->|"embeds query"| node_embeddings
node_embeddings -->|"queries vectors"| node_vectorservice
node_vectorservice -->|"gets client"| node_chromaconnection
node_chromaconnection -->|"queries collection"| node_chromadb
node_answer -->|"builds prompt"| node_catalog
node_answer -->|"requests completion"| node_openrouter
node_chromaconnection -->|"reads credentials"| node_settings
node_chatapi -->|"reads model key"| node_settings
node_embeddings -.->|"processes document chunks"| node_chunks

click node_app "https://github.com/hamdane1548/agent_location_voiture/blob/master/SupportClient/src/App.tsx"
click node_router "https://github.com/hamdane1548/agent_location_voiture/blob/master/SupportClient/src/Router/router.tsx"
click node_layout "https://github.com/hamdane1548/agent_location_voiture/blob/master/SupportClient/src/Layout/Main-Layout.tsx"
click node_header "https://github.com/hamdane1548/agent_location_voiture/blob/master/SupportClient/src/Components/ui/Header.tsx"
click node_footer "https://github.com/hamdane1548/agent_location_voiture/blob/master/SupportClient/src/Components/ui/Footer.tsx"
click node_logo "https://github.com/hamdane1548/agent_location_voiture/blob/master/SupportClient/src/Components/Logo.tsx"
click node_chat "https://github.com/hamdane1548/agent_location_voiture/blob/master/SupportClient/src/pages/Agent.tsx"
click node_avatar "https://github.com/hamdane1548/agent_location_voiture/blob/master/SupportClient/src/Components/ui/shdr-19.tsx"
click node_chatapi "https://github.com/hamdane1548/agent_location_voiture/blob/master/agent_backend/src/agent/agentConnect.py"
click node_answer "https://github.com/hamdane1548/agent_location_voiture/blob/master/agent_backend/src/agent/agentConnect.py"
click node_catalog "https://github.com/hamdane1548/agent_location_voiture/blob/master/agent_backend/src/agent/agentConnect.py"
click node_embeddings "https://github.com/hamdane1548/agent_location_voiture/blob/master/agent_backend/src/Embeddings/Embedding.py"
click node_chunks "https://github.com/hamdane1548/agent_location_voiture/blob/master/agent_backend/src/Model/Chunks.py"
click node_vectorservice "https://github.com/hamdane1548/agent_location_voiture/blob/master/agent_backend/src/Services/ChromaDBServices.py"
click node_settings "https://github.com/hamdane1548/agent_location_voiture/blob/master/agent_backend/src/Settings.py"
click node_chromaconnection "https://github.com/hamdane1548/agent_location_voiture/blob/master/agent_backend/src/infrastructure/chromedb.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_router,node_layout,node_header,node_footer,node_logo,node_chat,node_avatar toneBlue
class node_chatapi,node_answer,node_catalog toneAmber
class node_embeddings,node_chunks,node_vectorservice toneMint
class node_settings,node_chromaconnection toneRose
class node_chromadb,node_openrouter,node_customer toneIndigo
```

## Components

### Chat interface

- [React application](https://github.com/hamdane1548/agent_location_voiture/blob/master/SupportClient/src/App.tsx): `SupportClient/src/App.tsx`
- [Chat route](https://github.com/hamdane1548/agent_location_voiture/blob/master/SupportClient/src/Router/router.tsx): `SupportClient/src/Router/router.tsx`
- [Page layout](https://github.com/hamdane1548/agent_location_voiture/blob/master/SupportClient/src/Layout/Main-Layout.tsx): `SupportClient/src/Layout/Main-Layout.tsx`
- [Header and logo](https://github.com/hamdane1548/agent_location_voiture/blob/master/SupportClient/src/Components/ui/Header.tsx): `SupportClient/src/Components/ui/Header.tsx`
- [Footer](https://github.com/hamdane1548/agent_location_voiture/blob/master/SupportClient/src/Components/ui/Footer.tsx): `SupportClient/src/Components/ui/Footer.tsx`
- [Interactive logo](https://github.com/hamdane1548/agent_location_voiture/blob/master/SupportClient/src/Components/Logo.tsx): `SupportClient/src/Components/Logo.tsx`
- [Chat page](https://github.com/hamdane1548/agent_location_voiture/blob/master/SupportClient/src/pages/Agent.tsx): `SupportClient/src/pages/Agent.tsx`
- [Assistant avatar](https://github.com/hamdane1548/agent_location_voiture/blob/master/SupportClient/src/Components/ui/shdr-19.tsx): `SupportClient/src/Components/ui/shdr-19.tsx`

### Assistant API

- [Chat endpoint](https://github.com/hamdane1548/agent_location_voiture/blob/master/agent_backend/src/agent/agentConnect.py): `agent_backend/src/agent/agentConnect.py`
- [Answer generation](https://github.com/hamdane1548/agent_location_voiture/blob/master/agent_backend/src/agent/agentConnect.py): `agent_backend/src/agent/agentConnect.py`
- [Rental catalog prompt](https://github.com/hamdane1548/agent_location_voiture/blob/master/agent_backend/src/agent/agentConnect.py): `agent_backend/src/agent/agentConnect.py`

### Document retrieval

- [Text embeddings](https://github.com/hamdane1548/agent_location_voiture/blob/master/agent_backend/src/Embeddings/Embedding.py): `agent_backend/src/Embeddings/Embedding.py`
- [Chunk model](https://github.com/hamdane1548/agent_location_voiture/blob/master/agent_backend/src/Model/Chunks.py): `agent_backend/src/Model/Chunks.py`
- [Vector search and save](https://github.com/hamdane1548/agent_location_voiture/blob/master/agent_backend/src/Services/ChromaDBServices.py): `agent_backend/src/Services/ChromaDBServices.py`

### Configuration and storage

- [Backend settings](https://github.com/hamdane1548/agent_location_voiture/blob/master/agent_backend/src/Settings.py): `agent_backend/src/Settings.py`
- [Chroma connection](https://github.com/hamdane1548/agent_location_voiture/blob/master/agent_backend/src/infrastructure/chromedb.py): `agent_backend/src/infrastructure/chromedb.py`

### External services

- **Chroma Cloud**
- **OpenRouter model**

### Other components

- **Customer**

## Connections

- Customer → Chat page: asks (evidence: `SupportClient/src/pages/Agent.tsx`)
- React application → Chat route: provides routes (evidence: `SupportClient/src/App.tsx`)
- Chat route → Page layout: renders (evidence: `SupportClient/src/Router/router.tsx`)
- Chat route → Chat page: renders (evidence: `SupportClient/src/Router/router.tsx`)
- Page layout → Header and logo: renders (evidence: `SupportClient/src/Layout/Main-Layout.tsx`)
- Page layout → Footer: renders (evidence: `SupportClient/src/Layout/Main-Layout.tsx`)
- Header and logo → Interactive logo: renders (evidence: `SupportClient/src/Components/ui/Header.tsx`)
- Chat page → Assistant avatar: renders (evidence: `SupportClient/src/pages/Agent.tsx`)
- Chat page → Chat endpoint: posts question (evidence: `SupportClient/src/pages/Agent.tsx`)
- Chat endpoint → Answer generation: generates answer (evidence: `agent_backend/src/agent/agentConnect.py`)
- Answer generation → Text embeddings: embeds query (evidence: `agent_backend/src/agent/agentConnect.py`)
- Text embeddings → Vector search and save: queries vectors (evidence: `agent_backend/src/Embeddings/Embedding.py`)
- Vector search and save → Chroma connection: gets client (evidence: `agent_backend/src/Services/ChromaDBServices.py`)
- Chroma connection → Chroma Cloud: queries collection (evidence: `agent_backend/src/infrastructure/chromedb.py`)
- Answer generation → Rental catalog prompt: builds prompt (evidence: `agent_backend/src/agent/agentConnect.py`)
- Answer generation → OpenRouter model: requests completion (evidence: `agent_backend/src/agent/agentConnect.py`)
- Chroma connection → Backend settings: reads credentials (evidence: `agent_backend/src/infrastructure/chromedb.py`)
- Chat endpoint → Backend settings: reads model key (evidence: `agent_backend/src/agent/agentConnect.py`)
- Text embeddings → Chunk model: processes document chunks
