How azure-samples/chat-with-your-data-solution-accelerator works
Based on our detailed analysis of both the file tree and the README, this repository is a solution accelerator called “Chat with your data.” It’s a full-stack application built with a Python backend and a TypeScript/Vite frontend that implements a Retrieval Augmented Generation (RAG) pattern. Its purpose is to provide a conversational interface for users to interact with their own unstructured data by leveraging Azure OpenAI, Azure Cognitive Search, document ingestion pipelines, and multiple database options (PostgreSQL or Cosmos DB). It deploys a wide range of Azure services and uses modern orchestration mechanisms (for example, via Prompt Flow, LangChain, or Semantic Kernel) to process and answer natural language queries over ingested documents.
Primary components
• Frontend UI – The “code/frontend” folder contains a React-based web application (with testing configuration, mocks, and public assets) that serves as the user-facing chat interface.
• Backend API & Batch Processing – Residing in “code/backend” and further subdivided into general API endpoints (e.g., “api/chat_history”) and batch processing functions (in “code/backend/batch”) that handle ingestion, processing, embeddings, and conversation responses.
• Orchestration & Utilities – Multiple utilities are present in “code/backend/batch/utilities” covering document chunking, document loading, search handling, integrated vectorization, and orchestration strategies (including layers for using Azure OpenAI functions, LangChain, and Semantic Kernel).
• Admin & Configuration – There is an “Admin.py” along with pages for configuration and ingestion (see “code/backend/pages/04_Configuration.py”) which facilitate managing data ingestion, prompt configuration, and document administration.
• External Services – The solution integrates with several Azure products:
• Azure OpenAI for natural language understanding and generation.
• Azure Cognitive Search for search/indexing.
• Azure Blob Storage, CosmosDB, and PostgreSQL for data storage.
• Azure Functions (including Dockerized and Bicep-deployed functions) for serverless processing.
• Azure Bot/Teams (noted in the “extensions/teams” folder) to support Teams integration.
• Infrastructure Deployment – The “infra” directory includes Bicep and ARM templates for deploying various resources (web app, functions, databases, search, storage, and monitoring). Also present are Docker files (“docker”) and container orchestrations.
• Testing & CI/CD – Both the “code/tests” and “tests/integration” directories (with Cypress for UI integration tests) show a dedicated testing infrastructure. GitHub Actions workflows are defined in “.github/workflows” for continuous integration, container builds, and release creation.
Relationships and interactions
• User interactions on the frontend send requests (chat queries, file uploads, etc.) to the backend via well-defined API endpoints.
• The backend processes these requests by interacting with document ingestion pipelines (batch processing), orchestration modules, and querying an index built by Azure Cognitive Search.
• The response flow includes transmitting conversation responses by integrating the output of Azure OpenAI’s LLM with document search results.
• The admin interface also leverages these APIs to manage and configure data ingestion, prompt engineering, and chat history.
• The entire solution uses Infrastructure as Code (Bicep files, Docker compose) to ensure that all resources (compute, databases, search, storage, and authentication mechanisms) are clearly defined and deployed.
Architectural patterns and design principles
• Separation of Concerns – There is a clear segmentation between the presentation layer (frontend), business logic (backend API and batch processing), and infrastructure deployment.
• Modular Design – Distinct modules for document processing (chunking, loading), search integration, and tool orchestration provide extensibility.
• RAG Pattern – The architecture is purposefully designed around a retrieval augmented generation paradigm, where retrieval (via Azure Cognitive Search and document ingestion) is tightly coupled with generation (using Azure OpenAI).
• Scalability & Flexibility – With dual database options and containerized/deployment options (Docker, Azure Functions), the design is built to evolve with different deployment needs.
Relevant technologies
• Python (backend API, batch processing, orchestration functions)
• TypeScript/React/Vite (frontend)
• Bicep/ARM (infrastructure as code for Azure deployment)
• Docker (containerization of frontend, backend, and admin components)
• Azure Services including OpenAI, Cognitive Search, Blob Storage, CosmosDB, PostgreSQL, Application Insights for monitoring, and Teams integration.