In enterprise AI scenarios, one of the biggest challenges is grounding Large Language Models (LLMs) with real, domain-specific knowledge. Retrieval-Augmented Generation (RAG) solves this by combining search + embeddings + AI agents. In this blog, we walk through an end-to-end Azure RAG pipeline that: 1. Ingests data from Azure Blob Storage 2. Extracts structured content using Azure AI Document Intelligence 3. Builds a hybrid Azure AI Search index (keyword + semantic + vector) 4. Serves queries through Microsoft Agent Framework (MAF) agents on Azure AI Foundry
High-Level Architecture
This architecture represents an end-to-end Retrieval-Augmented Generation (RAG) pipeline where raw documents are ingested from Azure Blob Storage, processed using Document Intelligence, transformed into embeddings via Azure OpenAI, and indexed in Azure AI Search for hybrid retrieval. A Foundry/MAF-based agent orchestrates query processing by combining user input with relevant search results and generates contextual responses, which are exposed through a FastAPI or CLI interface.
Azure-based RAG Pipeline with Agent-Orchestration
This solution is composed of two main layers:
1. Data Ingestion Layer (RAG Pipeline)
This layer transforms raw enterprise documents into searchable knowledge.
Flow:
- Raw documents stored in Azure Blob Storage
- Supported formats: PDF, DOCX, PPTX, images, etc.
- Document Intelligence extraction
- Extracts:
- Text
- Tables
- Key-value pairs
- Structure
- Writes output as structured JSON back to Blob (processed/)
- Extracts:
- Chunking + Embedding
- Documents are split into chunks
- Each chunk is embedded using Azure OpenAI (text-embedding-*)
- Indexing into Azure AI Search
- Creates a hybrid index:
- Keyword search
- Semantic ranking
- Vector search
- Enables flexible retrieval strategies
- Creates a hybrid index:
2. Query Layer (Strategy Agents)
This layer enables intelligent query answering.
Flow:
- User sends a query via:
- FastAPI endpoint
- CLI interface
- Query is handled by:
- Microsoft Agent Framework (MAF) agent
- Running on Azure AI Foundry
- Agent:
- Queries Azure AI Search
- Retrieves top relevant chunks
- Injects them into LLM prompt
- LLM generates grounded response
- This follows the standard RAG pattern:
- Retrieval → Augmentation → Generation
- This follows the standard RAG pattern:
End-to-End Flow
Key Azure Services Used
|
Service |
Purpose |
|
Azure Blob Storage |
Raw + processed document storage |
|
Azure AI Document Intelligence |
Extract structured content |
|
Azure OpenAI |
Embeddings + LLM generation |
|
Azure AI Search |
Hybrid retrieval engine |
|
Azure AI Foundry |
Agent orchestration |
|
Microsoft Agent Framework |
Agent execution layer |
Why this Architecture Matters
This solution goes beyond basic RAG and provides:
Hybrid Retrieval
- Combines keyword + semantic + vector search
- Improves recall and accuracy
Structured Document Parsing
- Handles complex enterprise documents
- Extracts tables and metadata
Agent-Based Orchestration
- Enables reasoning over retrieval results
- Extensible for multi-agent workflows
Scalable Data Pipeline
- Supports continuous ingestion
- Works with large document collections
Enterprise Considerations
- Use Managed Identity for secure service access
- Apply RBAC on Cosmos DB / Search / Storage
- Enable Private Endpoints for network isolation
- Use Guardrails + Evaluations in Foundry
Summary
This repository demonstrates a production-ready Azure RAG architecture:
- Ingest → Extract → Chunk → Embed → Index
- Retrieve → Reason → Generate
- Powered by Azure AI Foundry + Agent Framework
By combining data engineering + AI orchestration, it enables enterprise AI systems that are:
- Accurate
- Grounded
- Extensible
Repo: https://github.com/snd94/azure-rag-strategy-agent
Please refer to the Microsoft Learn Documentation for further information:
- Azure AI Search documentation - Azure AI Search | Microsoft Learn
- Document Intelligence documentation - Quickstarts, Tutorials, API Reference - Foundry Tools | Microsoft Learn
- How to generate embeddings with Azure OpenAI in Microsoft Foundry Models - Microsoft Foundry | Microsoft Learn
- How to generate embeddings with Azure OpenAI in Microsoft Foundry Models - Microsoft Foundry | Microsoft Learn
- Microsoft Agent Framework Overview | Microsoft Learn
- What is Microsoft Foundry? - Microsoft Foundry | Microsoft Learn