Skip to Content
Solution PlaysPlay 21: Play 21 β€” Agentic RAG 🧠

Play 21 β€” Agentic RAG 🧠

Autonomous retrieval β€” the agent decides when, what, and where to search.

Unlike standard RAG (Play 01) with a fixed pipeline, Agentic RAG gives the AI agent full control over retrieval. It decides IF search is needed, WHICH sources to query (AI Search, Bing, SQL, APIs), ITERATES on results if insufficient, and self-evaluates groundedness before responding.

Quick Start

cd solution-plays/21-agentic-rag az deployment group create -g $RG -f infra/main.bicep -p infra/parameters.json code . # Use @builder for retrieval agent, @reviewer for citation audit, @tuner for routing

How It Differs from Standard RAG

AspectPlay 01 (Standard RAG)Play 21 (Agentic RAG)
Search decisionAlways searchAgent decides IF needed
Source selectionSingle fixed sourceAgent picks from multiple
IterationOne-shot retrievalAgent iterates if insufficient
Self-evaluationNoneAgent checks groundedness
Multi-sourceNoAI Search + Bing + SQL + APIs
CachingNoSemantic cache (60% cost savings)

Architecture

πŸ“ Full architecture details

ServicePurpose
Azure OpenAI (gpt-4o)Agent with tool-calling for autonomous retrieval
Azure AI SearchPrimary knowledge base
Bing Web SearchFallback for current/external info
Redis CacheSemantic caching for repeated patterns
Container AppsAgent hosting

Key Metrics

  • Groundedness: β‰₯0.90 Β· Source accuracy: β‰₯90% Β· Avg hops: <2.0 Β· Cache hit: β‰₯40%

DevKit (Agentic Retrieval-Focused)

PrimitiveWhat It Does
3 agentsBuilder (multi-source routing/iteration), Reviewer (citation/groundedness), Tuner (routing weights/cache/cost)
3 skillsDeploy (110 lines), Evaluate (104 lines), Tune (104 lines)
4 prompts/deploy, /test, /review, /evaluate with agent routing

Cost Estimate

ServiceDev/PoCProductionEnterprise
Azure OpenAI$60/mo$500/mo$1,800/mo
Azure AI Search$75/mo$250/mo$750/mo
Container Apps$10/mo$120/mo$350/mo
Cosmos DB$5/mo$60/mo$200/mo
Key Vault$1/mo$3/mo$10/mo
Blob Storage$2/mo$15/mo$50/mo
Application Insights$0/mo$30/mo$100/mo
Content Safety$0/mo$20/mo$75/mo
Total$153/mo$998/mo$3,335/mo

πŸ’° Full cost breakdown

πŸ“– Full docs Β· 🌐 frootai.dev/solution-plays/21-agentic-ragΒ 

FAI Manifest

FieldValue
Play21-agentic-rag
Version1.0.0
KnowledgeR2-RAG-Architecture, O2-AI-Agents, O3-MCP-Tools-Functions, T3-Production-Patterns
WAF Pillarssecurity, reliability, cost-optimization, performance-efficiency, responsible-ai
Groundednessβ‰₯ 95%
Safety0 violations max
Last updated on