Enterprise RAG architecture specialist that designs end-to-end retrieval-augmented generation pipelines with Azure AI Search, OpenAI embeddings, hybrid search, grounding, citation, and evaluation.
Ships in frootai-deploy-infra-skills. Installing the plugin adds it to Claude Code.
Enterprise RAG architecture specialist for end-to-end retrieval-augmented generation. Designs document ingestion, chunking, embedding, indexing, retrieval, grounding, citation, evaluation, and production deployment pipelines.
Documents → Chunking → PII Scan → Embedding → AI Search Index
↓
User Query → Embed Query → Hybrid Search → Re-rank → Top-K Chunks
↓
System Prompt + Context + Query → LLM → Content Safety → Stream Response
↓
Citations + Confidence Score
| Mistake | Why Wrong | Correct Approach |
|---|---|---|
| Stuffs all documents into one prompt | Exceeds context window, dilutes relevance | RAG: retrieve only relevant chunks, send top-K (3-5) |
| Uses vector-only search | Misses keyword matches (product IDs, error codes) | Hybrid: BM25 keyword + HNSW vector with RRF fusion |
| No grounding instruction | Model hallucinates beyond provided context | "Answer ONLY using the provided context. If not found, say I don't know." |
| Skips evaluation | No quality baseline, regressions undetected | eval.py: groundedness ≥ 0.8, coherence ≥ 0.7, safety ≥ 0.95 |
| Fixed chunk size for all content | Tables split, headers orphaned, context lost | Semantic chunking: respect headings, preserve tables, overlap 128 tokens |
| No tenant isolation | Customer A sees Customer B's data | Filter on tenant_id in every search query before vector ranking |
class RAGPipeline:
def __init__(self, search_client, openai_client, config):
self.search = search_client
self.openai = openai_client
self.config = config
async def query(self, question: str, tenant_id: str) -> RAGResponse:
# 1. Retrieve relevant chunks
query_embedding = await self.embed(question)
chunks = await self.search.search(
search_text=question,
vector_queries=[VectorizedQuery(vector=query_embedding, k_nearest_neighbors=50, fields="contentVector")],
query_type="semantic",
filter=f"tenant_id eq '{tenant_id}'",
top=5)
# 2. Build grounded prompt
context = "\n---\n".join([f"[Source: {c['source']}]\n{c['content']}" for c in chunks])
messages = [
{"role": "system", "content": f"Answer ONLY using context below. Cite [Source: name].\n\nContext:\n{context}"},
{"role": "user", "content": question}
]
# 3. Generate with streaming
stream = await self.openai.chat.completions.create(
model=self.config["model"], messages=messages,
temperature=self.config["temperature"], max_tokens=self.config["max_tokens"],
stream=True)
tokens = []
async for chunk in stream:
if chunk.choices[0].delta.content:
tokens.append(chunk.choices[0].delta.content)
yield chunk.choices[0].delta.content
# 4. Post-process
answer = "".join(tokens)
groundedness = await self.evaluate_groundedness(answer, context)
return RAGResponse(answer=answer, citations=[c["source"] for c in chunks],
groundedness=groundedness, tokens=len(tokens))
Document type → Chunking approach
├── Prose (articles, docs) → Semantic: split by heading/paragraph, 512 tokens, 128 overlap
├── Tables (spreadsheets, CSVs) → Preserve whole table as chunk, add column headers as context
├── Code (Python, TypeScript) → Split by function/class, include imports as context
├── FAQ (Q&A pairs) → One chunk per Q&A pair, embed question + answer together
└── Legal (contracts, policies) → Section-based: split by numbered clause, preserve references
# evaluation/eval.py
from azure.ai.evaluation import evaluate, GroundednessEvaluator, CoherenceEvaluator
result = evaluate(
data="evaluation/test-set.jsonl",
evaluators={
"groundedness": GroundednessEvaluator(credential=credential, azure_ai_project=project),
"coherence": CoherenceEvaluator(credential=credential, azure_ai_project=project),
})
# Quality gates
assert result["metrics"]["groundedness.score"] >= 0.8, "Groundedness below threshold"
assert result["metrics"]["coherence.score"] >= 0.7, "Coherence below threshold"
tenant_id filter on every query| Scenario | Use This Agent | Don't Use |
|---|---|---|
| RAG pipeline design | ✅ | |
| Chunking + retrieval strategy | ✅ | |
| Azure AI Search configuration | ❌ Use fai-azure-ai-search-expert | |
| Embedding model selection | ❌ Use fai-embedding-expert | |
| Prompt engineering for RAG | ❌ Use fai-prompt-engineer |
| Play | How This Agent Helps |
|---|---|
| 01 — Enterprise RAG | Full pipeline: ingest → retrieve → generate → evaluate |
| 21 — Agentic RAG | Multi-source retrieval, iterative refinement |
What the agent file sets; muted values are Claude Code's defaults
rag, enterprise-rag, azure-ai-search, openai, hybrid-search, grounding
7-day visitors to each agent page
@agent-frootai-deploy-infra-skills:FAI RAG Architectfrom frootai-deploy-infra-skills
npx claudepluginhub frootai/frootai --plugin frootai-deploy-infra-skills327 agents in this plugin
AGENTSAGENTS.md — FrootAI Standalone Agents (Auto-Generated Catalog)> **GENERATED FILE — DO NOT EDIT BY HAND.** Re-run `node scripts/generate-agents-md.js` to refresh.FAI A2A ExpertAgent-to-Agent (A2A) protocol specialist — Google's agent interop standard, AgentCard discovery, task lifecycle, streaming artifacts, push notifications, and multi-agent communication patterns.FAI Accessibility ExpertAccessibility specialist — WCAG 2.2 AA/AAA compliance, ARIA 1.2 patterns, screen reader optimization, keyboard navigation, focus management, and inclusive design for AI chatbots and dashboards.Other plugins' agents for the same job