Edit

Build chatbots and RAG applications in App Service

Retrieval augmented generation (RAG) grounds an AI application's responses in enterprise knowledge. For web apps hosted in Azure App Service, the recommended architecture uses Foundry Agent Service to host the agent and a Foundry IQ knowledge base to provide grounded retrieval and citations.

Overview

In this architecture, the App Service web app invokes a Foundry agent. The agent uses a Foundry IQ knowledge base to retrieve relevant information from connected enterprise knowledge sources and ground its response.

App Service web app
  -> Foundry Agent Service
  -> Foundry IQ knowledge base
  -> enterprise knowledge sources

The web app continues to invoke the same agent by name through its Foundry client. Foundry Agent Service hosts the knowledge tool, so the application doesn't need to query Azure AI Search directly or act as a Model Context Protocol (MCP) client. If the application displays sources, it can process the citation annotations returned by the agent.

Azure AI Search underpins Foundry IQ, but Search indexing and knowledge-base configuration are managed in Foundry rather than in the App Service application. For configuration details, see Connect a Foundry IQ knowledge base to an agent.

Foundry IQ can also be consumed by other supported clients. It isn't exclusive to Foundry Agent Service. For this App Service scenario, Foundry Agent Service is the recommended integration because it hosts the agent and its managed knowledge tool while the web app remains focused on the user experience.

When to use chatbots and RAG

Consider building a chatbot or RAG application when you want to:

  • Provide conversational interfaces: Replace traditional form-based UIs with natural language interactions
  • Enable intelligent document search: Allow users to query large document repositories using natural language
  • Create customer support assistants: Build AI-powered help desks that understand context and provide accurate responses
  • Develop knowledge bases: Transform static documentation into interactive Q&A systems
  • Build internal tools: Create employee-facing assistants that can access and explain company data

RAG is particularly valuable when responses must be grounded in specific, up-to-date information from your organization's data sources, such as product catalogs, documentation, policies, or customer records.

Get started with tutorials

Choose your language and follow the Foundry Agent Service path in the tutorial. After the agent works with the App Service application, connect a Foundry IQ knowledge base to the agent. The application continues to invoke the same agent after you add knowledge.