# mongodb-industry-solutions/manufacturing-car-manual-rag architecture

> Architecture diagram of the GitHub repository mongodb-industry-solutions/manufacturing-car-manual-rag, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mongodb-industry-solutions/manufacturing-car-manual-rag
- Repository: https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag

## Overview

Car Manual Explorer lets automotive technicians search structured manual content and images, inspect contextual results, and ask questions. The principal path is query entry through the frontend search service and API routes to retrieval, optional reranking, and MongoDB-backed results. Separate branches cover graph and multimodal retrieval, chunk/image access, and the documented RAG capability. Several repository and UI implementations were not excerpted; their presence is represented without guessing at internal calls.

Main entry points: [`backend/app/api/routes/search.py`](https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/api/routes/search.py) (Search routes), [`backend/app/db/mongodb.py`](https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/db/mongodb.py) (MongoDB connection), [`frontend/services/searchService.ts`](https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/frontend/services/searchService.ts) (Search client), [`backend/app/api/routes/graph_search.py`](https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/api/routes/graph_search.py) (Graph search route)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["User experience"]
  node_search_ui["Search interface<br/>[page.tsx]"]
  node_search_hooks["Search hooks<br/>[useSearch.ts]"]
  node_rag_hook["Question hook<br/>[useRAG.ts]"]
  node_search_client["Search client<br/>[searchService.ts]"]
  node_api_proxy["API proxy<br/>[route.ts]"]
end

subgraph group_api["API routing"]
  node_api_app["FastAPI app<br/>[main.py]"]
  node_search_routes["Search routes<br/>[search.py]"]
  node_graph_routes["Graph search route<br/>[graph_search.py]"]
  node_chunk_routes["Chunk routes<br/>[chunks.py]"]
  node_image_routes["Image routes<br/>[images.py]"]
  node_settings["Application settings<br/>[config.py]"]
end

subgraph group_retrieval["Retrieval services"]
  node_search_repo["Search pipelines<br/>[search_new.py]"]
  node_chunk_repo["Chunk repository<br/>[chunks.py]"]
  node_image_repo["Image repository<br/>[images.py]"]
end

subgraph group_data["Document data"]
  node_chunk_model["Chunk model<br/>[chunks.py]"]
  node_search_model["Search models<br/>[search.py]"]
  node_gridfs[("Image file store<br/>[gridfs_manager.py]")]
  node_mongodb[("MongoDB connection<br/>[mongodb.py]")]
end

subgraph group_integrations["AI integrations"]
  node_embedding["Text embeddings<br/>[embedding.py]"]
  node_multimodal_embedding["Multimodal embeddings"]
  node_reranker["Voyage reranker<br/>[reranker.py]"]
  node_rag_service["RAG answering<br/>[rag.py]"]
end

node_technician(("Technician"))
node_atlas[("MongoDB Atlas")]
node_voyage["Voyage AI"]

node_technician -->|"submits query"| node_search_ui
node_search_hooks -->|"calls search"| node_search_client
node_rag_hook -->|"asks question"| node_search_client
node_search_client -->|"posts requests"| node_api_proxy
node_search_client -->|"targets endpoints"| node_search_routes
node_search_client -->|"targets graph endpoint"| node_graph_routes
node_api_app -->|"registers routes"| node_search_routes
node_api_app -->|"registers routes"| node_graph_routes
node_api_app -->|"registers routes"| node_chunk_routes
node_api_app -->|"registers routes"| node_image_routes
node_search_routes -->|"runs retrieval"| node_search_repo
node_search_routes -->|"embeds queries"| node_embedding
node_search_routes -.->|"optionally reranks"| node_reranker
node_graph_routes -->|"runs graph search"| node_search_repo
node_graph_routes -->|"embeds queries"| node_embedding
node_graph_routes -->|"optionally reranks"| node_reranker
node_chunk_routes -->|"fetches chunks"| node_chunk_repo
node_chunk_routes -->|"embeds content"| node_embedding
node_image_routes -->|"retrieves image data"| node_image_repo
node_image_routes -->|"retrieves associated chunks"| node_chunk_repo
node_image_routes -->|"loads image files"| node_gridfs
node_search_repo -->|"uses connection"| node_mongodb
node_chunk_repo -.->|"uses connection"| node_mongodb
node_image_repo -.->|"uses connection"| node_mongodb
node_gridfs -->|"gets connection"| node_mongodb
node_mongodb -->|"stores documents"| node_atlas
node_multimodal_embedding -->|"requests embeddings"| node_voyage
node_search_repo -->|"shapes results"| node_chunk_model
node_search_routes -->|"validates responses"| node_search_model
node_settings -->|"configures connection"| node_mongodb
node_search_routes -.->|"creates image queries"| node_multimodal_embedding
node_rag_service -->|"uses chunk context"| node_chunk_model

click node_search_ui "https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/frontend/app/search/page.tsx"
click node_search_hooks "https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/frontend/hooks/useSearch.ts"
click node_rag_hook "https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/frontend/hooks/useRAG.ts"
click node_search_client "https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/frontend/services/searchService.ts"
click node_api_proxy "https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/frontend/app/api/v1/%5B...path%5D/route.ts"
click node_api_app "https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/main.py"
click node_search_routes "https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/api/routes/search.py"
click node_graph_routes "https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/api/routes/graph_search.py"
click node_chunk_routes "https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/api/routes/chunks.py"
click node_image_routes "https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/api/routes/images.py"
click node_search_repo "https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/db/repositories/search_new.py"
click node_chunk_repo "https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/db/repositories/chunks.py"
click node_image_repo "https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/db/repositories/images.py"
click node_embedding "https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/services/embedding.py"
click node_multimodal_embedding "https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/services/multimodal_embedding.py"
click node_reranker "https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/services/reranker.py"
click node_rag_service "https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/services/rag.py"
click node_chunk_model "https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/models/chunks.py"
click node_search_model "https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/models/search.py"
click node_gridfs "https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/db/gridfs_manager.py"
click node_mongodb "https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/db/mongodb.py"
click node_settings "https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/core/config.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_search_ui,node_search_hooks,node_rag_hook,node_search_client,node_api_proxy toneBlue
class node_api_app,node_search_routes,node_graph_routes,node_chunk_routes,node_image_routes,node_settings,node_atlas toneAmber
class node_search_repo,node_chunk_repo,node_image_repo toneMint
class node_chunk_model,node_search_model,node_gridfs,node_mongodb toneRose
class node_embedding,node_multimodal_embedding,node_reranker,node_rag_service,node_technician,node_voyage toneIndigo
```

## Components

### User experience

- [Search interface](https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/frontend/app/search/page.tsx): `frontend/app/search/page.tsx`
- [Search hooks](https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/frontend/hooks/useSearch.ts): `frontend/hooks/useSearch.ts`
- [Question hook](https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/frontend/hooks/useRAG.ts): `frontend/hooks/useRAG.ts`
- [Search client](https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/frontend/services/searchService.ts): `frontend/services/searchService.ts`
- [API proxy](https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/frontend/app/api/v1/%5B...path%5D/route.ts): `frontend/app/api/v1/[...path]/route.ts`

### API routing

- [FastAPI app](https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/main.py): `backend/main.py`
- [Search routes](https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/api/routes/search.py): `backend/app/api/routes/search.py`
- [Graph search route](https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/api/routes/graph_search.py): `backend/app/api/routes/graph_search.py`
- [Chunk routes](https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/api/routes/chunks.py): `backend/app/api/routes/chunks.py`
- [Image routes](https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/api/routes/images.py): `backend/app/api/routes/images.py`
- [Application settings](https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/core/config.py): `backend/app/core/config.py`

### Retrieval services

- [Search pipelines](https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/db/repositories/search_new.py): `backend/app/db/repositories/search_new.py`
- [Chunk repository](https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/db/repositories/chunks.py): `backend/app/db/repositories/chunks.py`
- [Image repository](https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/db/repositories/images.py): `backend/app/db/repositories/images.py`

### Document data

- [Chunk model](https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/models/chunks.py): `backend/app/models/chunks.py`
- [Search models](https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/models/search.py): `backend/app/models/search.py`
- [Image file store](https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/db/gridfs_manager.py): `backend/app/db/gridfs_manager.py`
- [MongoDB connection](https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/db/mongodb.py): `backend/app/db/mongodb.py`

### AI integrations

- [Text embeddings](https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/services/embedding.py): `backend/app/services/embedding.py`
- [Multimodal embeddings](https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/services/multimodal_embedding.py): `backend/app/services/multimodal_embedding.py`
- [Voyage reranker](https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/services/reranker.py): `backend/app/services/reranker.py`
- [RAG answering](https://github.com/mongodb-industry-solutions/manufacturing-car-manual-rag/blob/main/backend/app/services/rag.py): `backend/app/services/rag.py`

### Other components

- **Technician**
- **MongoDB Atlas**
- **Voyage AI**

## Connections

- Technician → Search interface: submits query (evidence: `README.md`)
- Search hooks → Search client: calls search (evidence: `frontend/hooks/useSearch.ts`)
- Question hook → Search client: asks question (evidence: `frontend/hooks/useRAG.ts`)
- Search client → API proxy: posts requests (evidence: `frontend/services/searchService.ts`)
- Search client → Search routes: targets endpoints (evidence: `frontend/services/searchService.ts`)
- Search client → Graph search route: targets graph endpoint (evidence: `frontend/services/searchService.ts`)
- FastAPI app → Search routes: registers routes (evidence: `backend/main.py`)
- FastAPI app → Graph search route: registers routes (evidence: `backend/main.py`)
- FastAPI app → Chunk routes: registers routes (evidence: `backend/main.py`)
- FastAPI app → Image routes: registers routes (evidence: `backend/main.py`)
- Search routes → Search pipelines: runs retrieval (evidence: `backend/app/api/routes/search.py`)
- Search routes → Text embeddings: embeds queries (evidence: `backend/app/api/routes/search.py`)
- Search routes → Voyage reranker: optionally reranks (evidence: `backend/app/api/routes/search.py`)
- Graph search route → Search pipelines: runs graph search (evidence: `backend/app/api/routes/graph_search.py`)
- Graph search route → Text embeddings: embeds queries (evidence: `backend/app/api/routes/graph_search.py`)
- Graph search route → Voyage reranker: optionally reranks (evidence: `backend/app/api/routes/graph_search.py`)
- Chunk routes → Chunk repository: fetches chunks (evidence: `backend/app/api/routes/chunks.py`)
- Chunk routes → Text embeddings: embeds content (evidence: `backend/app/api/routes/chunks.py`)
- Image routes → Image repository: retrieves image data (evidence: `backend/app/api/routes/images.py`)
- Image routes → Chunk repository: retrieves associated chunks (evidence: `backend/app/api/routes/images.py`)
- Image routes → Image file store: loads image files (evidence: `backend/app/api/routes/images.py`)
- Search pipelines → MongoDB connection: uses connection (evidence: `backend/app/db/repositories/search_new.py`)
- Chunk repository → MongoDB connection: uses connection
- Image repository → MongoDB connection: uses connection
- Image file store → MongoDB connection: gets connection (evidence: `backend/app/db/gridfs_manager.py`)
- MongoDB connection → MongoDB Atlas: stores documents (evidence: `README.md`)
- Multimodal embeddings → Voyage AI: requests embeddings (evidence: `backend/app/services/multimodal_embedding.py`)
- Search pipelines → Chunk model: shapes results (evidence: `backend/app/db/repositories/search_new.py`)
- Search routes → Search models: validates responses (evidence: `backend/app/api/routes/search.py`)
- Application settings → MongoDB connection: configures connection (evidence: `backend/app/db/mongodb.py`)
- Search routes → Multimodal embeddings: creates image queries (evidence: `backend/app/api/routes/search.py`)
- RAG answering → Chunk model: uses chunk context (evidence: `backend/app/services/rag.py`)
