# ayaz-microsoft/chat-with-your-data-solution-accelerator architecture

> Architecture diagram of the GitHub repository ayaz-microsoft/chat-with-your-data-solution-accelerator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ayaz-microsoft/chat-with-your-data-solution-accelerator
- Repository: https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator

## Overview

Chat with Your Data is an Azure-hosted document-grounded chat product. Users ingest uploaded files or web pages through the admin experience; a separate Functions worker parses, chunks, embeds, and indexes content. In chat, the backend retrieves relevant passages, grounds and streams model answers with citations, and persists conversation history. The README documents the major capabilities and deployment-time provider choices; sampled source clarifies ingestion orchestration, but unsampled runtime wiring is represented only where the README explicitly describes it.

Main entry points: [`src/backend/app.py`](https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/backend/app.py) (FastAPI API), [`src/functions/batch_push/handler.py`](https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/functions/batch_push/handler.py) (Blob processing), [`src/backend/core/providers/search/base.py`](https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/backend/core/providers/search/base.py) (Search providers), [`src/backend/core/pipelines/chat.py`](https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/backend/core/pipelines/chat.py) (Grounded chat pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_frontend["Chat and admin SPA<br/>[App.tsx]"]
  node_ingest_ui["Ingest controls<br/>[IngestData.tsx]"]
  node_speech_ui["Speech input"]
end

subgraph group_api["Backend API"]
  node_backend_app["FastAPI API<br/>[app.py]"]
  node_conversation["Conversation service<br/>[conversation.py]"]
  node_chat_pipeline["Grounded chat pipeline<br/>[chat.py]"]
  node_admin_service["Admin service<br/>[admin.py]"]
  node_ingestion_service["Ingestion service<br/>[ingestion.py]"]
  node_history["Chat history<br/>[health.py]"]
  node_speech_api["Speech endpoint<br/>[health.py]"]
end

subgraph group_ingestion["Document ingestion"]
  node_batch_start["Batch fan-out<br/>[handler.py]"]
  node_batch_push["Blob processing<br/>[handler.py]"]
  node_url_ingest["Web-page ingestion<br/>[handler.py]"]
  node_search_skill["Search embedding skill<br/>[handler.py]"]
end

subgraph group_providers["Provider layer"]
  node_parsers["Document parsers<br/>[base.py]"]
  node_embedders["Embedding providers<br/>[registry.py]"]
  node_search_provider["Search providers<br/>[base.py]"]
  node_orchestrators["Chat orchestrators<br/>[registry.py]"]
end

subgraph group_services["Azure services"]
  node_foundry{{"Azure AI Foundry"}}
  node_content_safety{{"Content Safety"}}
  node_speech_service{{"Azure Speech"}}
  node_storage[("Blob and queue storage")]
  node_azure_search[("Azure AI Search")]
  node_cosmos[("Cosmos DB history")]
  node_postgres[("PostgreSQL pgvector")]
end

node_user(("User"))

node_user -->|"uses"| node_frontend
node_frontend -->|"calls API"| node_backend_app
node_frontend -->|"opens admin"| node_ingest_ui
node_ingest_ui -->|"submits documents"| node_ingestion_service
node_backend_app -->|"serves chat"| node_conversation
node_backend_app -->|"serves admin"| node_admin_service
node_conversation -->|"runs grounding"| node_chat_pipeline
node_chat_pipeline -->|"retrieves and answers"| node_foundry
node_chat_pipeline -->|"screens content"| node_content_safety
node_backend_app -->|"persists history"| node_history
node_backend_app -->|"provides speech config"| node_speech_api
node_speech_ui -->|"requests token"| node_backend_app
node_speech_ui -->|"recognizes speech"| node_speech_service
node_ingestion_service -->|"uploads and enqueues"| node_storage
node_ingestion_service -->|"delegates URL work"| node_url_ingest
node_storage -->|"triggers processing"| node_batch_start
node_batch_start -->|"enqueues blob jobs"| node_storage
node_storage -->|"delivers queue jobs"| node_batch_push
node_batch_push -->|"parses blobs"| node_parsers
node_batch_push -->|"embeds chunks"| node_embedders
node_batch_push -->|"writes documents"| node_search_provider
node_url_ingest -->|"parses fetched pages"| node_parsers
node_url_ingest -->|"embeds chunks"| node_embedders
node_url_ingest -->|"writes documents"| node_search_provider
node_search_skill -->|"embeds records"| node_embedders
node_backend_app -->|"retrieves passages"| node_search_provider
node_batch_push -->|"uses AI services"| node_foundry
node_search_provider -->|"selects index"| node_azure_search
node_search_provider -->|"selects index"| node_postgres
node_backend_app -->|"stores history"| node_cosmos
node_backend_app -->|"stores history"| node_postgres
node_chat_pipeline -->|"uses selected orchestration"| node_orchestrators

click node_frontend "https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/frontend/src/App.tsx"
click node_ingest_ui "https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/frontend/src/pages/admin/IngestData/IngestData.tsx"
click node_speech_ui "https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/frontend/src/hooks/useSpeechRecognition.tsx"
click node_backend_app "https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/backend/app.py"
click node_conversation "https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/backend/services/conversation.py"
click node_chat_pipeline "https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/backend/core/pipelines/chat.py"
click node_admin_service "https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/backend/services/admin.py"
click node_ingestion_service "https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/backend/services/ingestion.py"
click node_history "https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/backend/services/health.py"
click node_speech_api "https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/backend/services/health.py"
click node_batch_start "https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/functions/batch_start/handler.py"
click node_batch_push "https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/functions/batch_push/handler.py"
click node_url_ingest "https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/functions/add_url/handler.py"
click node_search_skill "https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/functions/search_skill/handler.py"
click node_parsers "https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/backend/core/providers/parsers/base.py"
click node_embedders "https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/backend/core/providers/embedders/registry.py"
click node_search_provider "https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/backend/core/providers/search/base.py"
click node_orchestrators "https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/backend/core/providers/orchestrators/registry.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_frontend,node_ingest_ui,node_speech_ui,node_user toneBlue
class node_backend_app,node_conversation,node_chat_pipeline,node_admin_service,node_ingestion_service,node_history,node_speech_api toneAmber
class node_batch_start,node_batch_push,node_url_ingest,node_search_skill toneMint
class node_parsers,node_embedders,node_search_provider,node_orchestrators toneRose
class node_foundry,node_content_safety,node_speech_service,node_storage,node_azure_search,node_cosmos,node_postgres toneIndigo
```

## Components

### User experience

- [Chat and admin SPA](https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/frontend/src/App.tsx): `src/frontend/src/App.tsx`
- [Ingest controls](https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/frontend/src/pages/admin/IngestData/IngestData.tsx): `src/frontend/src/pages/admin/IngestData/IngestData.tsx`
- [Speech input](https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/frontend/src/hooks/useSpeechRecognition.tsx): `src/frontend/src/hooks/useSpeechRecognition.tsx`

### Backend API

- [FastAPI API](https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/backend/app.py): `src/backend/app.py`
- [Conversation service](https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/backend/services/conversation.py): `src/backend/services/conversation.py`
- [Grounded chat pipeline](https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/backend/core/pipelines/chat.py): `src/backend/core/pipelines/chat.py`
- [Admin service](https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/backend/services/admin.py): `src/backend/services/admin.py`
- [Ingestion service](https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/backend/services/ingestion.py): `src/backend/services/ingestion.py`
- [Chat history](https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/backend/services/health.py): `src/backend/services/health.py`
- [Speech endpoint](https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/backend/services/health.py): `src/backend/services/health.py`

### Document ingestion

- [Batch fan-out](https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/functions/batch_start/handler.py): `src/functions/batch_start/handler.py`
- [Blob processing](https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/functions/batch_push/handler.py): `src/functions/batch_push/handler.py`
- [Web-page ingestion](https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/functions/add_url/handler.py): `src/functions/add_url/handler.py`
- [Search embedding skill](https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/functions/search_skill/handler.py): `src/functions/search_skill/handler.py`

### Provider layer

- [Document parsers](https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/backend/core/providers/parsers/base.py): `src/backend/core/providers/parsers/base.py`
- [Embedding providers](https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/backend/core/providers/embedders/registry.py): `src/backend/core/providers/embedders/registry.py`
- [Search providers](https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/backend/core/providers/search/base.py): `src/backend/core/providers/search/base.py`
- [Chat orchestrators](https://github.com/ayaz-microsoft/chat-with-your-data-solution-accelerator/blob/main/src/backend/core/providers/orchestrators/registry.py): `src/backend/core/providers/orchestrators/registry.py`

### Azure services

- **Azure AI Foundry**
- **Content Safety**
- **Azure Speech**
- **Blob and queue storage**
- **Azure AI Search**
- **Cosmos DB history**
- **PostgreSQL pgvector**

### Other components

- **User**

## Connections

- User → Chat and admin SPA: uses (evidence: `README.md`)
- Chat and admin SPA → FastAPI API: calls API (evidence: `README.md`)
- Chat and admin SPA → Ingest controls: opens admin (evidence: `README.md`)
- Ingest controls → Ingestion service: submits documents (evidence: `src/frontend/src/pages/admin/IngestData/IngestData.tsx`)
- FastAPI API → Conversation service: serves chat (evidence: `README.md`)
- FastAPI API → Admin service: serves admin
- Conversation service → Grounded chat pipeline: runs grounding (evidence: `README.md`)
- Grounded chat pipeline → Azure AI Foundry: retrieves and answers (evidence: `README.md`)
- Grounded chat pipeline → Content Safety: screens content (evidence: `README.md`)
- FastAPI API → Chat history: persists history (evidence: `README.md`)
- FastAPI API → Speech endpoint: provides speech config (evidence: `README.md`)
- Speech input → FastAPI API: requests token (evidence: `src/frontend/src/hooks/useSpeechRecognition.tsx`)
- Speech input → Azure Speech: recognizes speech (evidence: `README.md`)
- Ingestion service → Blob and queue storage: uploads and enqueues (evidence: `src/backend/services/ingestion.py`)
- Ingestion service → Web-page ingestion: delegates URL work (evidence: `src/backend/services/ingestion.py`)
- Blob and queue storage → Batch fan-out: triggers processing (evidence: `README.md`)
- Batch fan-out → Blob and queue storage: enqueues blob jobs (evidence: `src/functions/batch_start/handler.py`)
- Blob and queue storage → Blob processing: delivers queue jobs (evidence: `README.md`)
- Blob processing → Document parsers: parses blobs (evidence: `src/functions/batch_push/handler.py`)
- Blob processing → Embedding providers: embeds chunks (evidence: `src/functions/batch_push/handler.py`)
- Blob processing → Search providers: writes documents (evidence: `src/functions/batch_push/handler.py`)
- Web-page ingestion → Document parsers: parses fetched pages (evidence: `src/functions/add_url/handler.py`)
- Web-page ingestion → Embedding providers: embeds chunks (evidence: `src/functions/add_url/handler.py`)
- Web-page ingestion → Search providers: writes documents (evidence: `src/functions/add_url/handler.py`)
- Search embedding skill → Embedding providers: embeds records (evidence: `src/functions/search_skill/handler.py`)
- FastAPI API → Search providers: retrieves passages (evidence: `README.md`)
- Blob processing → Azure AI Foundry: uses AI services (evidence: `README.md`)
- Search providers → Azure AI Search: selects index (evidence: `README.md`)
- Search providers → PostgreSQL pgvector: selects index (evidence: `README.md`)
- FastAPI API → Cosmos DB history: stores history (evidence: `README.md`)
- FastAPI API → PostgreSQL pgvector: stores history (evidence: `README.md`)
- Grounded chat pipeline → Chat orchestrators: uses selected orchestration (evidence: `README.md`)
