Skip to main content

Wire FAI Context

Connect standalone primitives (agents, skills, instructions) to FROOT knowledge modules, WAF pillars, and solution plays via the FAI Protocol wiring layer.

Manifest vs. Contextโ€‹

Aspectfai-manifest.jsonfai-context.json
LevelSolution play (top-level)Individual primitive
Locationsolution-plays/NN-name/Next to any agent, instruction, or skill
PurposeWire ALL primitives for a playDeclare context for ONE primitive
AnalogyDocker Compose (full stack)Single Dockerfile (one service)
RequiredYes, for every playNo, optional for standalone primitives

:::tip Rule of Thumb Building a solution play? โ†’ Create fai-manifest.json.
Building a standalone primitive that needs context? โ†’ Create fai-context.json. :::

Creating fai-context.jsonโ€‹

Place the context file in a subfolder named after the primitive:

agents/
fai-rag-architect.agent.md # The agent itself
fai-rag-architect/
fai-context.json # Context for this agent
agents/fai-rag-architect/fai-context.json
{
"assumes": [
"R2-RAG-Architecture",
"O3-MCP-Tools-Functions",
"T2-Responsible-AI"
],
"waf": [
"security",
"reliability",
"cost-optimization"
],
"compatiblePlays": [
"01-enterprise-rag",
"21-agentic-rag"
],
"evaluation": {
"groundedness": 0.95,
"coherence": 0.90
}
}

The assumes Fieldโ€‹

Declares which FROOT knowledge modules your primitive needs:

SeriesIDModule Name
FoundationsF1GenAI Foundations
F2LLM Selection
F3AI Glossary
ReasoningR1Prompt Patterns
R2RAG Architecture
R3Deterministic AI
OrchestrationO1Semantic Kernel
O2Agent Coding
O3MCP Tools
O5GPU Infrastructure
TransformationT1Fine-Tuning + MLOps
T2Responsible AI
T3Production Deploy

Creating fai-manifest.jsonโ€‹

Top-level wiring for solution plays:

solution-plays/01-enterprise-rag/fai-manifest.json
{
"play": "01-enterprise-rag",
"version": "2.0.0",
"context": {
"knowledge": ["R2-RAG-Architecture", "R1-Prompt-Patterns"],
"waf": ["security", "reliability", "cost-optimization"],
"scope": "Enterprise RAG with Azure AI Search and GPT-4o"
},
"primitives": {
"agents": ["../../agents/fai-rag-architect.agent.md"],
"instructions": ["../../instructions/python-waf.instructions.md"],
"skills": ["../../skills/fai-build-genai-rag/"],
"hooks": ["../../hooks/fai-secrets-scanner/"],
"guardrails": {
"groundedness": 0.95,
"coherence": 0.90,
"safety": 0.99
}
},
"infrastructure": {
"bicep": "./infra/main.bicep"
}
}

Context Resolution Chainโ€‹

1. Read fai-manifest.json
โ”œโ”€โ”€ Load context.knowledge[] โ†’ FROOT modules
โ”œโ”€โ”€ Load context.waf[] โ†’ WAF pillar rules
2. Resolve each primitive reference
โ”œโ”€โ”€ Check for fai-context.json โ†’ merge knowledge + waf
โ””โ”€โ”€ Verify compatiblePlays includes this play
3. Apply guardrails from manifest
4. Report: all primitives wired, modules loaded, pillars enforced

Conflict resolution: Knowledge modules and WAF pillars are unioned. Guardrails โ€” manifest wins.

Validationโ€‹

# Validate all primitives
npm run validate:primitives

# Load play in FAI Engine
node engine/index.js solution-plays/01-enterprise-rag/fai-manifest.json --status

Troubleshootingโ€‹

ProblemFix
"0 modules loaded"Add FROOT module IDs to context.knowledge
"Primitive not found"Paths are relative to manifest location
Context file ignoredMust be in subfolder named after the primitive
JSON parse errorValidate: node -e "require('./path/file.json')"

See Alsoโ€‹