{"id":13465288,"url":"https://github.com/Azure/GPT-RAG","last_synced_at":"2025-03-25T16:31:37.028Z","repository":{"id":176698514,"uuid":"659267694","full_name":"Azure/GPT-RAG","owner":"Azure","description":"Sharing the learning along the way we been gathering to enable Azure OpenAI at enterprise scale in a secure manner. GPT-RAG core is a Retrieval-Augmented Generation pattern running in Azure, using Azure Cognitive Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q\u0026A experiences.","archived":false,"fork":false,"pushed_at":"2025-03-13T03:18:43.000Z","size":44749,"stargazers_count":964,"open_issues_count":16,"forks_count":216,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-03-17T00:00:47.475Z","etag":null,"topics":["azd-templates","azure","gpt-3","gpt-4","openai"],"latest_commit_sha":null,"homepage":"https://azure.microsoft.com/en-us/products/cognitive-services/openai-service","language":"Bicep","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Azure.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-27T13:23:44.000Z","updated_at":"2025-03-13T19:32:09.000Z","dependencies_parsed_at":"2024-01-26T13:46:28.861Z","dependency_job_id":"25ff815c-4002-472a-a896-318c0a67b37d","html_url":"https://github.com/Azure/GPT-RAG","commit_stats":{"total_commits":502,"total_committers":20,"mean_commits":25.1,"dds":0.5916334661354581,"last_synced_commit":"cadfb471fe1a5e9764dbaa5f578aec007fa0ef26"},"previous_names":["azure/gpt-rag"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2FGPT-RAG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2FGPT-RAG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2FGPT-RAG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2FGPT-RAG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Azure","download_url":"https://codeload.github.com/Azure/GPT-RAG/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245187059,"owners_count":20574557,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azd-templates","azure","gpt-3","gpt-4","openai"],"created_at":"2024-07-31T15:00:25.909Z","updated_at":"2025-03-25T16:31:37.018Z","avatar_url":"https://github.com/Azure.png","language":"Bicep","funding_links":[],"categories":["azure","Project Submissions","5. Retrieval-Augmented Generation (RAG) \u0026 Knowledge","SDK, Libraries, Frameworks","**Section 2** : Azure OpenAI and Reference Architecture","开源工具","Python","Code Samples \u0026 Workshops"],"sub_categories":["Python","**Azure Reference Architectures**","RAG框架"],"readme":"\u003c!-- \npage_type: sample\nlanguages:\n- azdeveloper\n- powershell\n- bicep\nproducts:\n- azure\n- azure-openai\n- azure-ai-search\nurlFragment: GPT-RAG\nname: Multi-repo ChatGPT and Enterprise data with Azure OpenAI and AI Search\ndescription: GPT-RAG core is a Retrieval-Augmented Generation pattern running in Azure, using Azure AI Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q\u0026A experiences.\n--\u003e\n\u003c!-- YAML front-matter schema: https://review.learn.microsoft.com/en-us/help/contribute/samples/process/onboarding?branch=main#supported-metadata-fields-for-readmemd --\u003e\n\n\n\u003cimg src=\"media/logo.png\" alt=\"Enterprise RAG Logo\" width=\"80\" align=\"left\"/\u003e\n\n# GPT-RAG Solution Accelerator\n\nThe **RAG pattern** enables businesses to use the reasoning capabilities of LLMs, using their existing models to process and generate responses based on new data. RAG facilitates periodic data updates without the need for fine-tuning, thereby streamlining the integration of LLMs into businesses. \n\nThe **Enterprise RAG** Solution Accelerator (GPT-RAG) offers a robust architecture tailored for enterprise-grade deployment of the RAG pattern. It ensures grounded responses and is built on Zero-trust security and Responsible AI, ensuring availability, scalability, and auditability. Ideal for organizations transitioning from exploration and PoC stages to full-scale production and MVPs.\n\n✨ See our [User \u0026 Admin Guide](docs/GUIDE.md) for complete setup and usage details.\n\n## Application Components\n\nGPT-RAG follows a modular approach, consisting of three components, each with a specific function.\n\n* **[Data Ingestion](https://github.com/Azure/gpt-rag-ingestion)** - Optimizes data chunking and indexing for the RAG retrieval step.\n\n* **Orchestrator** - Manages information retrieval and response generation. Choose between **[Functional](https://github.com/Azure/gpt-rag-orchestrator)** using Semantic Kernel functions or **[Agentic](https://github.com/Azure/gpt-rag-agentic)** powered by AutoGen. Refer to the deployment instructions to switch.\n\n* **[App Front-End](https://github.com/Azure/gpt-rag-frontend)** - Uses the [Backend for Front-End](https://learn.microsoft.com/en-us/azure/architecture/patterns/backends-for-frontends) pattern to provide a scalable and efficient web interface.\n\n\u003c!-- * [Teams-BOT](https://github.com/Azure/gpt-rag-bot) Constructed using Azure BOT Services, this platform enables users to engage with the Orchestrator seamlessly through the Microsoft Teams interface. --\u003e\n\n\u003c!-- \nRemoving temporarily while not finished\n## GPT-RAG Integration HUB\n* [SQL Integration](https://github.com/Azure/gpt-rag-int-sql) Connect the GPT-RAG Infrastructure to SQL using NL2SQL. --\u003e\n\n## Concepts\n\nIf you want to learn more about the RAG Pattern and GPT-RAG architecture.\n\n* [RAG Pattern: What and Why?](docs/RAG_CONCEPTS.md)\n\n* [Solution Architecture Overview](docs/ARCHITECTURE.md)\n\n\u003c!-- ![Architecture Overview](media/GPT-RAG-ZeroTrust.png) --\u003e\n\n*  [Enterprise RAG +Prompt Engineering+Finetuning+Train (Video in Spanish)](https://www.youtube.com/watch?v=ICsf4yirieA)\n\n\u003c!-- ## Administration Guide\n\nFor detailed instructions on managing and configuring the system, please refer to the [Administration Guide](docs/ADMINISTRATION_GUIDE.md) 📖. --\u003e\n\n\u003c!-- \u003ca href=\"https://www.youtube.com/watch?v=ICsf4yirieA\"\u003e\u003cimg src=\"https://img.youtube.com/vi/ICsf4yirieA/0.jpg\" alt=\"Alt text\" width=\"480\"/\u003e\u003c/a\u003e --\u003e\n\n\n## Setup Guide\n\n1) **Basic Architecture Deployment:** *for quick demos with no network isolation*⚙️\n\nLearn how to **quickly set up** the basic architecture for scenarios without network isolation. [Click the link to proceed](#basic-architecture-deployment).\n\n2) **Standard Zero-Trust Architecture Deployment:** *fastest Zero-Trust deployment option*⚡\n\nDeploy the solution accelerator using the standard zero-trust architecture with pre-configured solution settings. No customization needed. [Click the link to proceed](#zero-trust-architecture-deployment).\n\n3) **Custom Zero-Trust Architecture Setup:** *most used* ⭐\n\nExplore options for customizing the deployment of the solution accelerator with a zero-trust architecture, adjusting solution settings to your needs. [Click the link to proceed](docs/AUTOMATED_INSTALLATION.md).\n\n4) **Step-by-Step Manual Setup: Zero-Trust Architecture:** *hands-on approach* 🛠️**\n\nFor those who prefer complete control, follow this detailed guide to manually set up the solution accelerator with a zero-trust architecture. [Click the link to proceed](docs/MANUAL_INSTALLATION.md).\n\n\n## Getting Started\n\nThis guide will walk you through the deployment process of Enterprise RAG. There are two deployment options available, **Basic Architecture** and **Zero Trust Architecture**. Before beginning the deployment, please ensure you have prepared all the necessary tools and services as outlined in the **Pre-requisites** section.\n\n**Pre-requisites**\n\n- Azure Developer CLI: [Download azd for Windows](https://azdrelease.azureedge.net/azd/standalone/release/1.5.0/azd-windows-amd64.msi), [Other OS's](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/install-azd).\n - Powershell 7+ (Windows only): [Powershell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.4#installing-the-msi-package).\n - Git: [Download Git](https://git-scm.com/downloads).\n - Node.js 16+ [windows/mac](https://nodejs.dev/en/download/)  [linux/wsl](https://nodejs.dev/en/download/package-manager/)\n - Python 3.11: [Download Python](https://www.python.org/downloads/release/python-3118/).\n - Initiate an [Azure AI services creation](https://portal.azure.com/#create/Microsoft.CognitiveServicesAllInOne) and agree to the Responsible AI terms **\n\n\u003c!-- [AZ Module](https://learn.microsoft.com/en-us/powershell/azure/what-is-azure-powershell?view=azps-11.6.0#the-az-powershell-module) --\u003e\n\n** If you have not created an Azure AI service resource in the subscription before\n\n### Basic Architecture Deployment\n\nFor quick demonstrations or proof-of-concept projects without network isolation requirements, you can deploy the accelerator using its basic architecture.\n![Basic Architecture](media/architecture-GPT-RAG-Basic.png)\n\nThe deployment procedure is quite simple, just install the prerequisites mentioned above and follow these four steps using [Azure Developer CLI (azd)](https://aka.ms/azure-dev/install) in a terminal:\n\n\n**1** Download the Repository:\n\n```sh\nazd init -t azure/gpt-rag\n```\n\n\u003e **Note**: Add `-b agentic` if using the Agentic AutoGen-based orchestrator.\n\u003e ```sh\n\u003e azd init -t azure/gpt-rag -b agentic\n\u003e ```\n\n**2** Login to Azure:\n\n**2.a** Azure Developer CLI:\n\n```sh\nazd auth login\n```\n\n**2.b** Azure CLI:\n\n```sh\naz login\n```\n\n**3** Start Building the infrastructure and components deployment:\n\n```sh\nazd up\n```\n\n**4** Add source documents to object storage\n\nUpload your documents to the 'documents' folder located in the storage account. The name of this account should start with 'strag'. This is the default storage account, as shown in the sample image below.\n\n ![storage_sample](media/readme-storage_sample.png)\n\n\u003e [!Note]\n\u003e If you want to upload documents for ingestion into the GPT-RAG storage account, you must have the **Storage Blob Data Contributor** role assigned in Azure Entra ID.\n\n**Done! Basic deployment is completed.**\n\n**Recommended**: [Add app authentication](https://learn.microsoft.com/en-us/azure/app-service/scenario-secure-app-authentication-app-service). [Watch this quick tutorial](https://youtu.be/sA-an25jMB4) for step-by-step guidance.\n\n\n### Zero Trust Architecture Deployment\n\nFor more secure and isolated deployments, you can opt for the Zero Trust architecture. This architecture is ideal for production environments where network isolation and stringent security measures are highly valued.\n\n ![Zero Trust Architecture](media/architecture-GPT-RAG-ZeroTrust-LZ.png)\n\nBefore deploying the Zero Trust architecture, make sure to review the prerequisites. It's important to note that you will only need Node.js and Python for the second part of the process, which will be carried out on the VM created during the deployment of this architecture.\n\nThe deployment procedure is similar to that of the Basic Architecture, but with some additional steps. For a detailed guide on deploying this option, refer to the instructions below:\n\n**1** Download the Repository\n\n```sh\nazd init -t azure/gpt-rag\n```\n\n\u003e **Note**: Add `-b agentic` if using the Agentic AutoGen-based orchestrator.\n\u003e ```sh\n\u003e azd init -t azure/gpt-rag -b agentic\n\u003e ```\n\n**2** Enable network isolation\n   \n```sh  \nazd env set AZURE_NETWORK_ISOLATION true  \n```  \n \n**3** Login to Azure:\n\n**2.a** Azure Developer CLI:\n\n```sh\nazd auth login\n```\n\n**2.b** Azure CLI:\n\n```sh\naz login\n```\n\n**4** Start Building the infrastructure and components deployment:\n\n```sh\nazd provision\n```\n\u003e [!TIP]  \n\u003e The regions we test most often are  `eastus`, `eastus2`, `westus3`.\n\n**5** Next, you will use the Virtual Machine with the Bastion connection (created during step 4) to continue the deployment.  \n   \nLog into the created VM with the user **gptrag** and authenticate with the password stored in the keyvault, similar to the figure below:  \n\n\u003cBR\u003e   \n\u003cimg src=\"media/readme-keyvault-login.png\" alt=\"Keyvault Login\" width=\"1024\"\u003e\n   \n**6**  Upon accessing Windows, install [Powershell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.4#installing-the-msi-package), as the other prerequisites are already installed on the VM.  \n   \n**7** Open the command prompt and run the following command to update azd to the latest version:  \n   \n```  \nchoco upgrade azd  \n```  \n   \nAfter updating azd, simply close and reopen the terminal.  \n   \n**8** Create a new directory, for example, `deploy` then enter the created directory.  \n   \n```  \nmkdir deploy  \ncd deploy  \n```  \nTo finalize the procedure, execute the subsequent commands in the command prompt to successfully complete the deployment:\n\n```  \nazd init -t azure/gpt-rag  \nazd auth login\naz login \nazd env refresh\nazd deploy  \n```  \n   \n\u003e Note: when running the ```azd init ...``` and ```azd env refresh```, use the same environment name, subscription, and region used in the initial provisioning of the infrastructure.  \n   \n**Done! Zero trust deployment is completed.**\n\n\u003e [!Note]\n\u003e If you want to upload documents for ingestion into the GPT-RAG storage account, you must have the **Storage Blob Data Contributor** role assigned in Azure Entra ID.\n\n**Recommended**: [Add app authentication](https://learn.microsoft.com/en-us/azure/app-service/scenario-secure-app-authentication-app-service). [Watch this quick tutorial](https://youtu.be/sA-an25jMB4) for step-by-step guidance.\n\n## How to?\n\nThis section provides quick guides for customizing, managing, and troubleshooting your deployment.\n\n### Customize Your Deployment\n\nThe standard deployment process sets up Azure resources and deploys the accelerator components with a standard configuration. To tailor the deployment to your specific needs, follow the steps in the [Custom Deployment](docs/CUSTOMIZATIONS.md) section for further customization options.\n\n\u003c!-- \n\nCommenting out this section as the integration hub needs to be reviewed.\n\n### Integrate with Additional Data Sources\n  \nExpand your data retrieval capabilities by integrating new data sources such as Bing Custom Search, SQL Server, and Teradata. For detailed instructions, refer to the [AI Integration Hub](docs/AI_INTEGRATION_HUB.md) page. --\u003e\n\n### Multi-Environment Deployment\n\nOnce you've successfully deployed the GPT-RAG solution as a proof of concept and you're ready to formalize the deployment using a proper CI/CD process to accelerate your deployment to production, refer to the multi-environment deployment guides for either [Azure DevOps](./docs/AZDO-SETUP.md) or [GitHub](./docs/GH-SETUP.md).\n \n### Troubleshoot Deployment Issues\n\nIf you encounter any errors during the deployment process, consult the [Troubleshooting](docs/TROUBLESHOOTING.md) page for guidance on resolving common issues.\n\n### Evaluate Performance\n\nTo assess the performance of your deployment, refer to the [Performance Testing](docs/PERFTEST.md) guide for testing methodologies and best practices.\n\n### Query the Conversation History\n\nLearn how to query and analyze conversation data by following the steps outlined in the [How to Query and Analyze Conversations](docs/QUERYING_CONVERSATIONS.md) document.\n\n### Estimate Pricing\n\nUnderstand the cost implications of your deployment by reviewing the [Pricing Model](docs/CALCULATOR.md) for detailed pricing estimation.\n\n### Manage Governance\n\nEnsure proper governance of your deployment by following the guidelines provided in the [Governance Model](https://share.mindmanager.com/#publish/9ogrdWqzmAzZB6ilgURohV4lj1LriKjOWc0w_u2U).\n\n## Enterprise RAG Community\n\n* [Discord Channel](https://discord.gg/28VMVKawgk) Enterprise RAG - Connected Community\n\n## Contributing\n\nWe appreciate your interest in contributing to this project! Please refer to the [CONTRIBUTING.md](./CONTRIBUTING.md) page for detailed guidelines on how to contribute, including information about the Contributor License Agreement (CLA), code of conduct, and the process for submitting pull requests.\n\nThank you for your support and contributions!\n\n## Trademarks\n\nThis project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft \ntrademarks or logos is subject to and must follow \n[Microsoft's Trademark \u0026 Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).\nUse of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.\nAny use of third-party trademarks or logos are subject to those third-party's policies.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAzure%2FGPT-RAG","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAzure%2FGPT-RAG","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAzure%2FGPT-RAG/lists"}