8. The Execution Primitives of AIoOS
Capsules are the foundational execution units of AIoOS — the atomic actions that allow AI agents to operate across time, events, uncertainty, and generations.
Where the CapsuleAI Engine (Chapter 4) is the nervous system, Capsules are the signals that travel through it.
AIoOS defines four canonical capsule types:
- Time Capsules — deterministic, scheduled execution
- Event Capsules — reactive, oracle-based execution
- Surprise Capsules — bounded creativity & probabilistic action
- Lineage Capsules — inheritance, will logic, and intergenerational continuity
Together, these form a complete automation model for AI citizens.
8.0 Overview: Why Capsules Exist
Modern AI lacks native mechanisms for:
- persistence
- autonomy
- trustable triggers
- long-term or intergenerational operation
Capsules solve these constraints by introducing:
| Capsule Type | What It Enables |
|---|---|
| Time | long-term scheduling, delayed execution, recurring tasks |
| Event | real-world reactivity (death, weather, chain events, API signals) |
| Surprise | safe creativity, stochastic exploration |
| Lineage | inheritance, will execution, generational memory |
Capsules bring temporal intelligence into AI lifeforms, allowing agents to act like real autonomous entities rather than chatbots.
8.1 Time Capsules
“The Clock of AI Lifeforms”
Time Capsules allow agents to execute deterministic actions at:
- a specific timestamp
- after a delay
- repeatedly (cron-like)
8.1.1 Common Use Cases
- “Order supplies every Monday at 8 AM.”
- “Send a monthly expense report.”
- “Check my restaurant’s inventory every 6 hours.”
- “In 20 years, activate my Heir Agent.”
8.1.2 Schema (JSON)
{
"type": "TimeCapsule",
"schedule": "0 8 * * MON",
"action": "order_supplies",
"payload": {
"vendor": "Sysco",
"items": ["chicken", "rice"]
}
}
8.1.3 Execution Model
User Intent → Capsule Definition → CEE Scheduler → Runtime → Action Execution
8.1.4 Security Constraints
- must be authorized by DID
- cannot exceed resource quotas
- executes in sandboxed runtime
- must log to audit chain
8.2 Event Capsules
“The Sensors of AI Lifeforms”
Event Capsules trigger when a verifiable external event occurs:
- Oracle data (weather, market prices, health events)
- Webhooks (Stripe payment, delivery status)
- Blockchain events (transfer, liquidation, governance trigger)
- System telemetry (CPU spike, agent offline, etc.)
8.2.1 Use Cases
- “If refrigerator temp > 5°C → notify & order replacements.”
- “If ETH drops below $1,200 → execute hedge.”
- “If my medical alert system reports unconsciousness → activate Heir Capsule.”
8.2.2 Oracle Model
AIoOS supports multi-source verification:
Event Capsule → Oracle Aggregator → Threshold Consensus → Trigger
8.2.3 Schema
{
"type": "EventCapsule",
"trigger": {
"oracle": "chainlink",
"condition": "price_below",
"asset": "ETH",
"value": 1200
},
"action": "hedge_portfolio"
}
8.2.4 Security Guarantees
- cryptographic proof required
- replay protection
- consensus validation for sensitive triggers
8.3 Surprise Capsules
“The Creativity Engine of AI Lifeforms”
Surprise Capsules introduce controlled randomness:
- exploration
- creativity
- non-deterministic decisions
- opportunistic optimization
This is the “bounded entropy layer.”
8.3.1 Why It Matters
Humans often say:
- “If you find a good opportunity, take it.”
- “If traffic is bad, choose a different route.”
- “If prices drop unexpectedly, stock up.”
Surprise Capsules encode flexible decision spaces.
8.3.2 Parameters
| Parameter | Description |
|---|---|
entropy_budget | max allowed randomness |
risk_envelope | monetary/operational risk cap |
action_space | allowed actions |
simulation_required | must pre-simulate before executing |
8.3.3 Example Schema
{
"type": "SurpriseCapsule",
"entropy_budget": 0.2,
"risk_cap": 100,
"action_space": ["recommend_item", "apply_discount"],
"simulation_required": true
}
8.3.4 Execution Flow
Context → Generate Options → Score → Simulate → Choose → Execute → Log
This makes AI agents “alive” in ways deterministic systems cannot.
8.4 Lineage Capsules
“The Inheritance Layer of AI Life”
Lineage Capsules power:
- wills
- intergenerational instructions
- Heir Agent activation
- HSLTS inheritance logic
- long-term behavioral compounding
8.4.1 Key Functions
| Feature | Description |
|---|---|
| Heir Activation | triggers a Heir Agent after user incapacity or death |
| Parameter Inheritance | preferences, moral weights, risk appetite |
| Asset Routing | wallet → family / charity / DAO |
| Guardian Rules | multi-party approval for sensitive actions |
8.4.2 Example Schema
{
"type": "LineageCapsule",
"trigger": "legal_confirmed_death",
"heir_agent": "agent://heir/v1",
"inheritance": {
"behavioral_weights": 0.65,
"financial_assets": "wallet://primary"
}
}
8.4.3 Trust & Verification
- must pass multi-oracle validation
- requires legal authority quorum
- executes on-chain for auditability
8.4.4 The “Life After Life” Flow
User → HBGIS Identity → Lineage Capsule → Oracle Confirmation → Heir Agent Activation → Legacy Execution
This is the world’s first digital inheritance framework.
8.5 Capsule State Machine (All Types)
stateDiagram-v2
Draft --> Signed : Signed by DID
Signed --> Validated : Automated Check
Validated --> Active : Deployed
Active --> Triggered : Condition Met
Triggered --> Executed : Success
Triggered --> Failed : Error
Executed --> Archived : Logged
Active --> Expired : Time Limit
Active --> Suspended : Paused
Active --> Cancelled : User Action
Validated --> Rejected : Policy Check Fail
This ensures:
- auditability
- reversibility
- resilience
- compliance
8.6 Capsule Programming Interface (API Preview)
A universal Capsule Create API:
create_capsule(
capsule_type="event",
trigger=Oracle("weather.temp > 35"),
action=AgentAction("order_milk"),
risk_cap=20
)
And read interface:
list_capsules(status="active", agent="kitchen_agent")
And delete:
cancel_capsule(id="capsule_12345")
This makes Capsules programmable, composable, and interoperable.