Skip to main content

Your First Solution Play

This guide walks you through scaffolding, exploring, deploying, and evaluating Play 01: Enterprise RAG Q&A โ€” the most popular FrootAI solution play.

What You'll Buildโ€‹

A production-ready RAG (Retrieval-Augmented Generation) pipeline that deploys:

ServicePurposeSKU (Dev)
Azure OpenAILLM inference (GPT-4o)S0, 30K TPM
Azure AI SearchVector + hybrid retrievalBasic
Azure Container AppsApplication hostingConsumption
Azure Key VaultSecrets managementStandard

Prerequisitesโ€‹

  • FrootAI installed (Installation)
  • Azure CLI authenticated (az login)
  • Azure subscription with Contributor role

Step 1 โ€” Choose Your Playโ€‹

Browse available plays to find the right fit:

# List all 100 solution plays
npx frootai plays list

# Get details for Play 01
npx frootai plays get 01
tip

Use the Configurator for an interactive recommendation wizard that matches your requirements to the best play.

Step 2 โ€” Initialize the DevKitโ€‹

Scaffold the complete play structure:

npx frootai init-devkit 01
cd solution-plays/01-enterprise-rag

This creates the full four-kit structure:

01-enterprise-rag/
โ”œโ”€โ”€ .github/ # DevKit โ€” Copilot brain
โ”‚ โ”œโ”€โ”€ copilot-instructions.md # Always-on solution context (under 150 lines)
โ”‚ โ”œโ”€โ”€ agents/
โ”‚ โ”‚ โ”œโ”€โ”€ builder.agent.md # Builds the RAG pipeline
โ”‚ โ”‚ โ”œโ”€โ”€ reviewer.agent.md # Reviews security + quality
โ”‚ โ”‚ โ””โ”€โ”€ tuner.agent.md # Validates config + thresholds
โ”‚ โ”œโ”€โ”€ instructions/
โ”‚ โ”‚ โ””โ”€โ”€ rag-patterns.instructions.md
โ”‚ โ”œโ”€โ”€ skills/
โ”‚ โ”‚ โ””โ”€โ”€ rag-indexer/SKILL.md # Step-by-step indexing procedure
โ”‚ โ””โ”€โ”€ hooks/
โ”‚ โ””โ”€โ”€ guardrails.json # SessionStart event guardrails
โ”œโ”€โ”€ config/ # TuneKit โ€” customer-tunable params
โ”‚ โ”œโ”€โ”€ openai.json # Model, temperature, tokens
โ”‚ โ””โ”€โ”€ guardrails.json # Quality thresholds
โ”œโ”€โ”€ spec/ # SpecKit โ€” architecture docs
โ”‚ โ””โ”€โ”€ 001-architecture.md
โ”œโ”€โ”€ infra/ # Infrastructure โ€” Azure Bicep
โ”‚ โ”œโ”€โ”€ main.bicep
โ”‚ โ””โ”€โ”€ parameters.json
โ”œโ”€โ”€ evaluation/ # Evaluation pipeline
โ”‚ โ””โ”€โ”€ test-set.jsonl
โ””โ”€โ”€ fai-manifest.json # FAI Protocol wiring

Step 3 โ€” Explore the Generated Filesโ€‹

The Manifest (fai-manifest.json)โ€‹

The manifest is the play's DNA โ€” it wires everything together:

{
"play": "01-enterprise-rag",
"version": "1.0.0",
"context": {
"knowledge": ["R2-RAG-Architecture", "O4-Azure-AI-Services"],
"waf": ["security", "reliability", "cost-optimization"]
},
"primitives": {
"agents": ["./.github/agents/builder.agent.md"],
"instructions": ["./.github/copilot-instructions.md"],
"skills": ["./.github/skills/rag-indexer"],
"hooks": ["../../hooks/frootai-secrets-scanner/"],
"guardrails": {
"groundedness": 0.95,
"coherence": 0.90,
"safety": 0,
"costPerQuery": 0.02
}
}
}

TuneKit Config (config/openai.json)โ€‹

Customer-tunable AI parameters โ€” adjust these for your use case:

{
"model": "gpt-4o",
"temperature": 0.3,
"max_tokens": 4096,
"top_p": 0.95,
"fallback_model": "gpt-4o-mini"
}

Step 4 โ€” Deploy to Azureโ€‹

Create the Resource Groupโ€‹

PLAY="01-enterprise-rag"
ENV="dev"
RG="rg-frootai-${PLAY}-${ENV}"

az group create --name "$RG" --location eastus2 \
--tags play="$PLAY" environment="$ENV" managed-by="frootai"

Preview Changesโ€‹

Always preview before deploying:

az deployment group what-if \
--resource-group "$RG" \
--template-file infra/main.bicep \
--parameters infra/parameters.json \
--mode Incremental

Deploy Infrastructureโ€‹

az deployment group create \
--resource-group "$RG" \
--template-file infra/main.bicep \
--parameters infra/parameters.json \
--name "frootai-${PLAY}-$(date +%Y%m%d)" \
--mode Incremental
warning

Ensure you have sufficient Azure OpenAI quota in your target region. Request quota increases in the Azure Portal if needed.

Step 5 โ€” Run Evaluationโ€‹

Validate Primitive Wiringโ€‹

# Schema + naming + frontmatter validation
npm run validate:primitives

# Load play in the FAI Engine
node engine/index.js fai-manifest.json --status

Run Quality Gatesโ€‹

# Evaluate against guardrail thresholds
node engine/index.js fai-manifest.json --eval

All guardrails defined in fai-manifest.json must pass:

MetricThresholdWhat It Measures
Groundednessโ‰ฅ 0.95Responses supported by retrieved sources
Coherenceโ‰ฅ 0.90Logical consistency and readability
Safety0 violationsNo harmful content generated
Cost per Queryโ‰ค $0.02Token usage within budget

Post-Deployment Health Checkโ€‹

APP_URL="https://your-container-app.azurecontainerapps.io"

# Health check
curl -sf "${APP_URL}/health" | jq .

# Smoke test
curl -sf -X POST "${APP_URL}/api/chat" \
-H "Content-Type: application/json" \
-d '{"query":"What is the onboarding process?"}' | jq '.answer'

What's Next?โ€‹