How azure-samples/netai-chat-with-your-data works
Main Components
• Frontend/UIs:
• Chat Application (located in src/ChatWYData.ChatApp) – built with Razor components; it provides the user chat interface.
• Document Manager Application (located in src/ChatWYData.DocsMngr) – for managing uploads, updates, and document browsing.
• Backend/API Services:
• ChatWYData.ApiServices, ChatWYData.DescriptionApi, ChatWYData.DocumentsApi, ChatWYData.MarkDown APIs, and VectorStore API – these provide endpoints for chat operations, document processing, Markdown handling, and vector search functionalities.
• Infrastructure/Provisioning:
• The “infra” directories (both at the root and under the AppHost) contain Bicep modules and YAML templates to provision Azure resources such as:
• Azure AI Search (azureaisearch module)
• Azure OpenAI (openai module)
• Azure Application Insights (appInsights module)
• Storage and SQL resources
• The AppHost (ChatWYData.AppHost) also ties resource configuration, local dev credentials, and orchestrates the provisioning (via Azure Developer CLI and .NET Aspire integration).
• Data Access and Entities:
• Projects like ChatWYData.DataEntities, ChatWYData.FileEntities, SearchEntities, and VectorEntities that define the data models and services for persistence and vector storage.
Relationships and Interactions
• End-User Interaction:
• Users input chat queries and document uploads via the UI components. These interfaces send requests to the corresponding backend API layer.
• API Gateway and Business Logic:
• The various API projects (DescriptionApi, DocumentsApi, MarkDown APIs, etc.) process requests and use domain-specific logic (for example, extracting document contents, converting Markdown, or managing chat sessions).
• Integration with Azure Services:
• API services leverage Azure AI Search to perform semantic searches and retrieval of document information.
• Azure OpenAI services (using models like gpt-4o and text-embedding-ada-002) process natural language queries and generate responses.
• Telemetry and monitoring are provided via Azure Application Insights and the .NET Aspire Dashboard.
• Infrastructure Provisioning:
• The infrastructure folder’s Bicep templates deploy the necessary Azure resources used by the solution (e.g., storage, search, openai endpoints).
• DevOps related files (azure.yaml, deployment scripts) are used for provisioning and deployment in GitHub Codespaces or locally.
Architectural Patterns & Technologies
• Full-stack separation: Clearly split the frontend (Blazor WebAssembly/Razor components) from backend services.
• API/Microservices pattern: Multiple API projects handle specialized functions.
• Infrastructure-as-Code: Bicep modules and YAML templates define cloud resource deployments.
• Cloud-Native Integration: Tight integration with Azure AI Search, Azure OpenAI, and Application Insights.
• .NET Aspire Integration: Provides telemetry, cloud provisioning, and monitoring capabilities.
• Data & Document Processing: Use of vector databases and semantic search to match user queries with document content.