FrootAI — AmpliFAI your AI Ecosystem Get Started

The Binding Glue

FAI Protocol

The industry's first context-wiring standard for AI primitives. 7 JSON schemas that define how agents, skills, hooks, plugins, and knowledge connect into production-ready systems.

What is the FAI Protocol?

The AI ecosystem has standards for individual concerns — MCP for tool calling, A2A for agent delegation, AG-UI for rendering. But nothing wires them together. The FAI Protocol is the missing binding glue — a single JSON file (fai-manifest.json) that declares how agents, instructions, skills, hooks, workflows, plugins, tools, prompts, and guardrails connect into evaluated, deployed, production-ready systems.

Context Wiring
Share knowledge modules and WAF pillars across all primitives automatically
Quality Gates
Enforce groundedness, coherence, relevance, safety, and cost thresholds
Auto-Discovery
Engine resolves paths, validates schemas, and wires everything in milliseconds

The Two Protocol Files

Every solution play has a full fai-manifest.json. Standalone primitives use the lightweight fai-context.json.

Full Play Manifest

The complete wiring specification for a solution play. Declares shared context (knowledge modules + WAF pillars), all primitive paths, quality guardrails with numeric thresholds, Azure infrastructure references, and toolkit paths. The FAI Engine reads this single file to orchestrate everything — no other configuration needed.

fai-manifest.json — Play 01: Enterprise RAG
{
  "play": "01-enterprise-rag",
  "version": "1.0.0",
  "context": {
    "knowledge": [
      "R2-RAG-Architecture",
      "O3-MCP-Tools",
      "T3-Production-Patterns",
      "F1-GenAI-Foundations"
    ],
    "waf": [
      "security", "reliability",
      "cost-optimization", "operational-excellence",
      "responsible-ai"
    ],
    "scope": "enterprise-rag-qa"
  },
  "primitives": {
    "agents": [
      "agents/rag-orchestrator.agent.md",
      "agents/rag-evaluator.agent.md",
      "agents/rag-retriever.agent.md"
    ],
    "instructions": [
      "instructions/rag-chunking.instructions.md",
      "instructions/rag-grounding.instructions.md",
      "instructions/rag-security.instructions.md"
    ],
    "skills": ["skills/fai-rag-indexer/"],
    "hooks": [
      "hooks/fai-secrets-scanner/",
      "hooks/fai-content-safety/",
      "hooks/fai-license-checker/"
    ],
    "guardrails": {
      "groundedness": 0.95,
      "coherence": 0.90,
      "relevance": 0.85,
      "safety": 0,
      "costPerQuery": 0.01
    }
  },
  "infrastructure": { "bicep": "./infra/main.bicep" },
  "toolkit": {
    "devkit": ".github/",
    "tunekit": "config/",
    "speckit": "spec/"
  }
}

Manifest Field Reference

Every field in fai-manifest.json — the 4 required fields plus 10 optional fields.

FieldTypeDescription
playstringSolution play identifier (e.g. 01-enterprise-rag). Two-digit prefix groups plays by category.
versionstringSemantic version. Bumped on schema, primitive, or guardrail changes.
context.knowledgestring[]FROOT module IDs this play depends on. Engine resolves to actual knowledge documents.
context.wafstring[]WAF pillars enforced for this play. All wired primitives must respect these.
context.scopestringScenario scope for context isolation. Prevents knowledge bleed between plays.
primitives.agentsstring[]Relative paths to .agent.md files. Engine discovers, validates, and wires them.
primitives.instructionsstring[]Relative paths to .instructions.md files with applyTo glob patterns.
primitives.skillsstring[]Relative paths to skill folders (each containing SKILL.md).
primitives.hooksstring[]Relative paths to hook folders (each containing hooks.json + script).
primitives.guardrailsobjectQuality gates: groundedness, coherence, relevance (0-1), safety (must be 0), costPerQuery (USD).
infrastructure.bicepstringPath to Bicep IaC template for Azure deployment.
toolkit.devkitstringPath to .github/ developer experience tools.
toolkit.tunekitstringPath to config/ quality tuning configurations.
toolkit.speckitstringPath to spec/ API and architecture specifications.

FAI Protocol vs Raw .github/ Files

What changes when you adopt the FAI Protocol for your AI solution.

CapabilityRaw .github/FAI Protocol
Context sharingManual copy-paste between filesAutomatic via context.knowledge[]
WAF enforcementNo enforcement mechanismDeclared in manifest, validated by engine
Quality gatesNone — hope for the bestGuardrails with thresholds (groundedness ≥ 0.95)
Primitive discoveryGrep the file systemEngine resolves paths, validates schemas
ComposabilityCopy files between reposPlugins bundle + plays compose
InfrastructureSeparate IaC with no linkinfrastructure.bicep linked in manifest
EvaluationRun scripts manuallyEngine evaluates after every change

How Auto-Wiring Works

The context resolution chain — from JSON file to production-ready wired system.

1
Engine reads fai-manifest.json
Parses the manifest, validates every field against the JSON schema. Invalid manifests are rejected with detailed error messages before any wiring occurs.
2
Context resolution
Resolves context.knowledge[] to FROOT module documents, loads context.waf[] pillar definitions, and establishes context.scope boundary for isolation between plays.
3
Primitive discovery & validation
Every path in primitives.agents[], .instructions[], .skills[], .hooks[] is resolved relative to the play directory. Each file is validated against its respective schema.
4
Context injection
Resolved knowledge modules, WAF pillars, and scope are injected into every primitive. Agents receive shared context automatically — no manual copy-paste needed.
5
Guardrail activation
primitives.guardrails thresholds become active quality gates. The engine evaluates every agent response: groundedness ≥ 0.95, coherence ≥ 0.90, safety = 0, cost ≤ $0.01.
6
Runtime ready
All primitives are wired, context is shared, guardrails are enforced. Hooks fire on lifecycle triggers (sessionStart, userPromptSubmitted, preToolUse). The play is production-ready.

7 JSON Schemas

Every primitive type has a JSON Schema for automated validation. The FAI Engine and CI/CD pipeline check every file on commit.

From Protocol to Marketplace

The FAI Protocol is layer 1. Each subsequent layer builds on the previous to create a full AI primitive ecosystem.

FAI Protocol1
The JSON specification — 7 schemas defining how primitives connect
FAI Layer2
The conceptual glue — context-wiring between all AI primitives
FAI Engine3
The runtime — reads manifests, resolves context, wires primitives, evaluates
FAI Factory4
CI/CD pipeline — validate, build, test, and deploy solution plays
FAI Packages5
Distribution — npm packages, VS Code extensions, Docker images
FAI Marketplace6
Discovery — browse, search, and install primitives and plugins
ProtocolLayerEngineFactoryPackagesMarketplace

Well-Architected Framework Integration

Every manifest declares which WAF pillars apply via context.waf[]. The engine enforces them across all wired primitives — agents, instructions, skills, and hooks all respect the declared architecture.

Security
Managed Identity, Key Vault, RBAC, content safety
Reliability
Retry, circuit breaker, health checks, graceful degradation
Cost Optimization
Model routing, token budgets, right-sizing
Operational Excellence
CI/CD, observability, IaC, incident management
Performance Efficiency
Caching, streaming, async, CDN optimization
Responsible AI
Content safety, groundedness, fairness, transparency

Validate Your Primitives

Schema validation checks every file against its JSON schema and reports errors with field paths.

CLI Commands
# Validate all primitives against 7 schemas
npm run validate:primitives

# Validate specific folders
node scripts/validate-primitives.js agents/
node scripts/validate-primitives.js plugins/

# Scaffold a new primitive (interactive)
npx frootai scaffold agent
npx frootai scaffold skill
npx frootai scaffold hook

# Full build pipeline: validate → marketplace → sync
npm run build