DPI-AI Framework Β· Element 01

AI Blocks

Modular, callable AI functions β€” the ingredients of any AI-enabled public service. Minimalist, composable, reusable, and governable.

What is an AI Block?

Units of AI that act like callable functions

Think of AI Blocks as ingredients and DPI Workflows as recipes. Each block does one bounded thing β€” translate, verify, extract, classify β€” and can be composed into any service workflow. The block is replaced; the workflow remains.

🎯

Minimalist

One clear purpose. Bounded inputs and outputs. No hidden side effects.

🧩

Composable

Interoperates with other Blocks and workflow engines through open APIs and common data formats.

♻️

Reusable

Applicable across agencies, sectors, and countries without rework. One block, many services.

πŸ”

Governable

Observable, testable, policy-aligned. Built-in audit trails, confidence scores, and privacy controls.

Classification

Two types of AI Blocks

🌐

Foundational AI Blocks

General-purpose capabilities reusable across all sectors. The multimodal and local language primitives that are prerequisites for an inclusive AI-ready nation.

  • translate() β€” local language translation & transliteration
  • speech_to_text() β€” voice input in any dialect
  • text_to_speech() β€” voice output accessibility
  • ocr_extract() β€” optical character recognition
  • summarise() β€” document summarisation
  • image_classify() β€” image and video recognition
βš™οΈ

Sector-Specific AI Blocks

Tailored to specific workflows. Embed policy and operational logic into callable functions that serve public mandates.

  • eligibility_verify() β€” social protection eligibility
  • identity_verify() β€” digital ID verification
  • duplicate_detect() β€” civil registration deduplication
  • clinical_decision() β€” clinical decision support
  • personalized_tutor() β€” adaptive education
  • fraud_detect() β€” disbursement anomaly detection
  • area_classify() β€” GIS crisis area classification
Safeguards as Callable AI Blocks: Safeguards can themselves be AI Blocks β€” bias_check(), consent_verify(), anomaly_flag(). By treating safeguards as modular, replaceable components, governments can evolve their risk management without rebuilding workflows.
Block Specification

Every AI Block declares its contract

A block spec defines not just what the block does, but how it can be governed, replaced, and audited. The spec is machine-readable and published alongside the block.

ai_block: id: "eligibility_verify_v1" version: "1.0.0" description: "Verifies citizen eligibility for a named benefit program" type: sector_specific domain: social_protection interface: inputs: citizen_id: {type: string, format: national_id, required: true} benefit_code: {type: string, enum: [CASH_TRANSFER, FOOD_VOUCHER], required: true} consent_token: {type: string, format: jwt, required: true} outputs: eligible: {type: boolean} confidence: {type: number, min: 0, max: 1} reason_code: {type: string} audit_log_ref: {type: string} governance: confidence_threshold: 0.85 on_low_confidence: human_escalate pii_fields: [citizen_id] pii_handling: tokenise_before_log audit_logging: true data_retention: "90d" provenance: model_type: "gradient_boosted_classifier" training_data: "social_registry_2023_anonymised" last_evaluated: "2025-12" hosting: sovereign_cloud # sovereign_cloud | on_prem | external_api replaceability: drop_in_compatible # can be swapped without workflow changes
Interoperability

Model Context Protocol (MCP)

As AI Blocks evolve into reusable capabilities, they need a common way to exchange context and interact safely. The Model Context Protocol (MCP) illustrates how this interoperability can be achieved β€” a lightweight protocol that allows AI systems to access external data, tools, and services while maintaining contextual integrity and auditability.

Within the DPI-AI Framework, MCP-inspired protocols enable:

  • AI Blocks to communicate and collaborate through shared context layers
  • Similar to how REST APIs enable interaction across other DPI building blocks
  • Composable, transparent, and portable AI capabilities across ecosystems
  • Governments can ensure AI capabilities remain interoperable without vendor lock-in
# MCP-style AI Block invocation
POST /mcp/v1/invoke
{
  "block": "eligibility_verify_v1",
  "context": {
    "session_id": "wf-2026-001",
    "consent_token": "eyJ...",
    "audit_trail": true
  },
  "inputs": {
    "citizen_id": "KE-1234-5678",
    "benefit_code": "CASH_TRANSFER"
  }
}

β†’ See which DPGs are AI Block / MCP ready

Related Elements

AI Blocks work within the framework

AI Blocks are ingredients β€” they need DPI Workflows to combine them into services, and Public Agents to present them to citizens.