{"id":16269822,"url":"https://github.com/Azure-Samples/azure-openai-rag-workshop","last_synced_at":"2025-10-25T08:30:37.350Z","repository":{"id":206051389,"uuid":"708713325","full_name":"Azure-Samples/azure-openai-rag-workshop","owner":"Azure-Samples","description":"Create your own ChatGPT with Retrieval-Augmented-Generation workshop","archived":false,"fork":false,"pushed_at":"2025-01-08T09:25:37.000Z","size":23643,"stargazers_count":113,"open_issues_count":3,"forks_count":368,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-02-05T11:54:56.162Z","etag":null,"topics":["azd-templates","azure","chatgpt","fastify","langchain","nodejs","openai","rag","workshop"],"latest_commit_sha":null,"homepage":"https://aka.ms/ws/openai-rag","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-Samples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2023-10-23T08:34:28.000Z","updated_at":"2025-01-31T10:36:14.000Z","dependencies_parsed_at":"2023-11-15T10:38:30.129Z","dependency_job_id":"b8d8ec78-3592-4edb-8e9b-1374ae9de277","html_url":"https://github.com/Azure-Samples/azure-openai-rag-workshop","commit_stats":null,"previous_names":["azure-samples/azure-openai-rag-workshop"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure-Samples%2Fazure-openai-rag-workshop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure-Samples%2Fazure-openai-rag-workshop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure-Samples%2Fazure-openai-rag-workshop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure-Samples%2Fazure-openai-rag-workshop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Azure-Samples","download_url":"https://codeload.github.com/Azure-Samples/azure-openai-rag-workshop/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238105146,"owners_count":19417260,"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","chatgpt","fastify","langchain","nodejs","openai","rag","workshop"],"created_at":"2024-10-10T18:09:12.433Z","updated_at":"2025-10-25T08:30:37.345Z","avatar_url":"https://github.com/Azure-Samples.png","language":"Bicep","funding_links":[],"categories":["LangChain4j Community Examples","nodejs","Code Samples \u0026 Workshops","azure"],"sub_categories":[],"readme":"\u003c!-- prettier-ignore --\u003e\n\u003cdiv align=\"center\"\u003e\n\n# 🤖 Azure OpenAI RAG workshop - Node.js version\n\n[![Open project in GitHub Codespaces](https://img.shields.io/badge/Codespaces-Open-blue?style=flat-square\u0026logo=github)](https://codespaces.new/Azure-Samples/azure-openai-rag-workshop?hide_repo_select=true\u0026ref=main\u0026quickstart=true)\n[![Join Azure AI Community Discord](https://img.shields.io/badge/Discord-Azure_AI_Community-blue?style=flat-square\u0026logo=discord\u0026color=5865f2\u0026logoColor=fff)](https://aka.ms/foundry/discord)\n![Node version](https://img.shields.io/badge/Node.js-\u003e=20-3c873a?style=flat-square)\n[![Ollama + Mistral](https://img.shields.io/badge/Ollama-Mistral-ff7000?style=flat-square)](https://ollama.com/library/mistral)\n[![TypeScript](https://img.shields.io/badge/TypeScript-blue?style=flat-square\u0026logo=typescript\u0026logoColor=white)](https://www.typescriptlang.org)\n[![License](https://img.shields.io/badge/License-MIT-yellow?style=flat-square)](LICENSE)\n\n:star: If you like this sample, star it on GitHub — it helps a lot!\n\n[Overview](#overview) • [Run the sample](#run-the-sample) • [Other versions](#other-versions) • [References](#references)\n\n\u003c/div\u003e\n\nThis sample shows how to build an AI chat experience with Retrieval-Augmented Generation (RAG) using LangChain.js and OpenAI language models. The application is hosted on [Azure Static Web Apps](https://learn.microsoft.com/azure/static-web-apps/overview) and [Azure Container Apps](https://learn.microsoft.com/azure/container-apps/overview), with [Azure AI Search](https://learn.microsoft.com/azure/search/search-what-is-azure-search) as the vector database. You can use it as a starting point for building more complex AI applications.\n\n\u003e [!IMPORTANT]\n\u003e 👉 **Follow the [full-length workshop](https://aka.ms/ws/openai-rag)** to learn how we built this sample and how you can run and deploy it.\n\n## Overview\n\nThis sample uses [Fastify](https://fastify.dev) to create a [Node.js](https://nodejs.org/) service that leverage [OpenAI SDK](https://platform.openai.com/docs/libraries/) and [LangChain](https://js.langchain.com/) to build a chatbot that will answer questions based on a corpus of documents, with a website to interact with the API.\n\nThis project is structured as monorepo, all packages source code is located under the `src/` folder.\nHere's the architecture of the application:\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./docs/assets/architecture.png\" alt=\"Architecture diagram\" width=\"640px\" /\u003e\n\u003c/div\u003e\n\n## Run the sample\n\nYou can use [GitHub Codespaces](https://github.com/features/codespaces) to work on this project directly from your browser:\n\n[![Open in GitHub Codespaces](https://img.shields.io/badge/Codespaces-Open-blue?style=flat-square\u0026logo=github)](https://codespaces.new/Azure-Samples/azure-openai-rag-workshop?hide_repo_select=true\u0026ref=main\u0026quickstart=true)\n\nYou can also use [Docker](https://www.docker.com/products/docker-desktop) and the [Dev Containers extension for VS Code](https://aka.ms/vscode/ext/devcontainer) to work locally using a ready-to-use dev environment:\n\n[![Open in Dev Containers](https://img.shields.io/static/v1?style=flat-square\u0026label=Dev%20Containers\u0026message=Open\u0026color=blue\u0026logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/Azure-Samples/azure-openai-rag-workshop)\n\nIf you prefer to install all the tools locally, you can follow these [setup instructions](https://aka.ms/ws?src=gh%3AAzure-Samples%2Fazure-openai-rag-workshop%2Fdocs%2Fworkshop.md\u0026step=2#optional-working-locally-without-the-dev-container).\n\n\u003c!--\n\u003e [!TIP]\n\u003e You can run this sample entirely locally without any cost using [Ollama](https://ollama.com/). Follow the instructions above to setup the tools locally to get started.\n--\u003e\n\n### Azure prerequisites\n\n- **Azure account**. If you're new to Azure, [get an Azure account for free](https://azure.microsoft.com/free) to get free Azure credits to get started. If you're a student, you can also get free credits with [Azure for Students](https://aka.ms/azureforstudents).\n- **Azure subscription with access enabled for the Azure OpenAI service**. You can request access with [this form](https://aka.ms/oaiapply).\n- **Azure account permissions**:\n  - Your Azure account must have `Microsoft.Authorization/roleAssignments/write` permissions, such as [Role Based Access Control Administrator](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#role-based-access-control-administrator-preview), [User Access Administrator](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#user-access-administrator), or [Owner](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#owner). If you don't have subscription-level permissions, you must be granted [RBAC](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#role-based-access-control-administrator-preview) for an existing resource group and [deploy to that existing group](docs/deploy_existing.md#resource-group).\n  - Your Azure account also needs `Microsoft.Resources/deployments/write` permissions on the subscription level.\n\n### Deploy the sample\n\nOpen a terminal and run the following commands:\n\n```bash\nazd auth login\nazd up\n```\n\nThis commands will first ask you to log in into Azure. Then it will provison the Azure resources, package the services and deploy them to Azure.\n\n### Clean up\n\nTo clean up all the Azure resources created by this sample:\n\n1. Run `azd down --purge`\n2. When asked if you are sure you want to continue, enter `y`\n\nThe resource group and all the resources will be deleted.\n\n## Other versions\n\nThis sample and workshop exists in different versions:\n\n- [**Node.js + Azure AI Search**](https://aka.ms/ws/openai-rag)\n- [**Node.js + Qdrant**](https://aka.ms/ws/openai-rag-qdrant)\n- [**Java/Quarkus + Qdrant**](https://aka.ms/ws/openai-rag-quarkus).\n\n## References\n\nHere are some resources to learn more about the technologies used in this sample:\n\n- [LangChain.js documentation](https://js.langchain.com/)\n- [Generative AI For Beginners](https://github.com/microsoft/generative-ai-for-beginners)\n- [Azure OpenAI Service](https://learn.microsoft.com/azure/ai-services/openai/overview)\n\nYou can also find [more Azure AI samples here](https://github.com/Azure-Samples/azureai-samples).\n\nThis sample/workshop was based on the enterprise-ready sample **ChatGPT + Enterprise data with Azure OpenAI and AI Search**:\n\n- [JavaScript version](https://github.com/Azure-Samples/azure-search-openai-javascript) / [Serverless JavaScript version](https://github.com/Azure-Samples/serverless-chat-langchainjs)\n- [Python version](https://github.com/Azure-Samples/azure-search-openai-demo/)\n- [Java version](https://github.com/Azure-Samples/azure-search-openai-demo-java)\n- [C# version](https://github.com/Azure-Samples/azure-search-openai-demo-csharp)\n\nIf you want to go further with more advanced use-cases, authentication, history and more, you should check it out!\n\n## Getting Help\n\nIf you get stuck or have any questions about building AI apps, join:\n\n[![Azure AI Foundry Discord](https://img.shields.io/badge/Discord-Azure_AI_Foundry_Community_Discord-blue?style=for-the-badge\u0026logo=discord\u0026color=5865f2\u0026logoColor=fff)](https://aka.ms/foundry/discord)\n\nIf you have product feedback or errors while building visit:\n\n[![Azure AI Foundry Developer Forum](https://img.shields.io/badge/GitHub-Azure_AI_Foundry_Developer_Forum-blue?style=for-the-badge\u0026logo=github\u0026color=000000\u0026logoColor=fff)](https://aka.ms/foundry/forum)\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.\n\nWhen you submit a pull request, a CLA bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\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-Samples%2Fazure-openai-rag-workshop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAzure-Samples%2Fazure-openai-rag-workshop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAzure-Samples%2Fazure-openai-rag-workshop/lists"}