Add self-healing to any payment agent in 30 seconds.
| Command | Description |
|---|---|
| npx helix init | Interactive setup wizard → generates helix.config.json |
| npx helix status | Live PCEC event stream in terminal (colored P→C→E→C) |
| npx helix dash | Start dashboard server (Minecraft lab + benchmark) |
| npm run demo | Run 12 failure scenarios with repair + immunity demo |
| npm run benchmark | HumanEval benchmark (needs OPENAI_API_KEY) — 68%→90% |
| helix gene list | Phase 2: List all local Gene Capsules |
| helix gene push | Phase 2: Push Genes to HGP Network |
| helix gene pull | Phase 2: Pull community Genes |
AI agents process millions of payments. When one fails, nobody's home to fix it.
Agent gets HTTP 402. Insufficient balance. No fallback. No retry logic. The task dies silently and revenue evaporates.
Agent holds EUR stablecoins but the service demands USDC. Manual swap required. Meanwhile the window closes.
Agent pays for inference 1,000 times but learns nothing. Same balance failure hits every night at 2am. Nobody notices until morning.
Four steps. Sub-second. Fully autonomous.
Parse MPP 402 error response. Classify failure into one of 10 categories. Assess severity.
Generate 2–3 repair candidates. Each has estimated cost, speed, and requirements.
Score each candidate 0–100. Pick optimal strategy based on cost, speed, and success history.
Execute the repair. Retry the original payment. Store a Gene Capsule in the Gene Map.
13 failure scenarios in demo (20 analyzed: 3 Phase 2, 2 oral, 3 excluded with reasoning).
| # | Failure | MPP Error | Helix Repair | Status |
|---|---|---|---|---|
| 1 | Insufficient Balance | payment-insufficient | Swap alt stablecoin via Tempo DEX | LIVE |
| 2 | Session Expired | invalid-challenge | Auto-renew MPP session | LIVE |
| 3 | Currency Mismatch | method-unsupported | Swap to required asset via DEX | LIVE |
| 4 | Signature Failure | verification-failed | Refresh nonce from Tempo RPC | LIVE |
| 5 | Batch Revert | tx-reverted | Remove failed item, resubmit batch | LIVE |
| 6 | Service Down | HTTP 500 + receipt | Retry with MPP receipt (idempotent) | MOCK |
| 7 | DEX Slippage | swap-reverted | Split into smaller swaps | MOCK |
| 8 | Compliance Block | tip-403 | Switch to unrestricted stablecoin | MOCK |
| 9 | Cascade Failure | cascade-failure | Refund waterfall C→B→A | VISION |
| 10 | Off-Ramp Failure | offramp-failed | Switch off-ramp provider | VISION |
| 11 | Token Pause | token-paused | Switch to unpaused stablecoin | MOCK |
| 12 | Fee Sponsor Empty | sponsor-insufficient | Fallback to self-pay gas | MOCK |
| 13 | Network Mismatch | token-uninitialized | switch_network / bridge_tokens | REAL |
npx mppx against 50+ live MPP services and hit this error in production.$ npx mppx https://mpp.dev/api/ping/paid$ npx mppx https://openai.mpp.tempo.xyz/v1/chat/completionsAnywhere AI agents move money.
AI agents purchasing APIs, data feeds, and compute via MPP. Helix ensures every payment completes, even when balances shift mid-task.
1,000 employees across 5 currencies. Batch payments with auto-recovery on compliance blocks, nonce collisions, and partial reverts.
Pay-per-token LLM inference at sub-cent granularity. Session management with auto-renewal. Never lose a stream mid-generation.
One function call between your agent and bulletproof payments.
fetch(), axios, any HTTP client
PCEC Engine + Gene Map + EventBus
HTTP 402 + payment challenges + credentials
Payment Lanes + DEX + TIP-20 Stablecoins
The full vision — 4 layers, 12 components, an evolving payment operating system for AI agents.
Understands natural language objectives. “Pay 100 employees in 5 currencies” → structured intent with parameters, constraints, and success criteria.
Without this, developers must hard-code every task. With it, agents understand open-ended objectives and can plan autonomously.
Not yet implemented. Currently the agent’s goal is defined by the developer in code. Phase 3 feature.
Decomposes a complex goal into a DAG of subtasks: [check balance] → [swap currencies] → [batch transfer] → [verify receipts]. Handles parallel, serial, and conditional branches.
Real-world agent tasks are multi-step. A flat retry loop can’t handle “step 3 failed but steps 1–2 already executed.”
Not yet. Currently wrap() handles single function calls. Multi-step orchestration is Phase 3.
Executes the DAG — dispatches tasks to the right executor, handles timeouts, tracks progress, manages rollback if needed.
This is the scheduler. Like Airflow for agent tasks, but with PCEC self-repair at every step.
Not yet. Currently agent runs single function, wrap() catches errors. Full orchestration is Phase 3.
The specific “how-to” repair strategies. Each skill is a concrete action: swap_currency, renew_session, retry_with_receipt, split_swap, refresh_nonce, switch_stablecoin.
PCEC Construct generates candidates FROM the skills library. Skills are the atoms of repair.
Fully implemented. 13 failure categories × 2–3 strategies each = ~25 skills in pcec.ts. Each skill has cost estimate, speed estimate, and requirements list.
Not just “what worked” but “WHY it worked and WHEN to use it.” Extracts causal reasoning: “EURC→USDC swap works better at UTC 2–4am because DEX liquidity is higher.”
Skills alone are a toolbox. Experience tells you which tool to grab before you even open the box. This is the meta-learning layer.
Gene Map stores success/failure history — success_count, avg_repair_ms, last_used_at. But it doesn’t yet extract causal patterns. The data is there; the reasoning layer is Phase 2.
Multiple agents collaborating on a single objective. Agent A handles currency swaps, Agent B handles execution, Agent C handles verification. They communicate via the mesh and share state.
Complex payment workflows (cascade A→B→C, batch payroll across corridors) need distributed execution. One agent can’t hold all the context.
Cascade scenario (#9) demonstrates the concept — A→B→C failure chain with refund waterfall. True mesh execution is Phase 3.
Perceive → Construct → Evaluate → Commit. Classifies every failure into 10 categories, generates repair candidates, scores by cost/speed/history, executes the best one, stores the result.
This is what makes Helix different. It doesn’t just retry — it understands what broke and picks the optimal fix.
Fully implemented. src/core/pcec.ts — complete P/C/E/K loop with all 13 failure handlers. Proven by HumanEval benchmark: 68% → 90%. Perceive parses MPP 402 errors (RFC 9457). Evaluate scores by speed (30pts), cost, requirements, severity matching.
Uses Gene Map history to predict failures BEFORE they happen. “This service has failed 3 times this week at 2am. It’s 1:55am. Pre-emptively switch to backup.”
Reactive repair (PCEC) costs time and sometimes money. Predictive avoidance costs nothing — you just don’t go down the bad path.
Not yet. But the data is accumulating in Gene Map. Every repair creates a timestamped Gene Capsule. The prediction layer just needs to read those patterns. Phase 2.
Assigns a confidence score to every repair. “95% confident this swap will work” vs “40% confident this timeout increase will help.” Enables risk-adjusted decisions.
Without confidence, PCEC is a black box. With it, the agent can decide: low confidence? Ask the human. High confidence? Just do it.
Evaluate scores (0–100) are a simplified confidence. Based on speed/cost/requirements math. Not yet probabilistic (would need historical success rates per strategy per context). Phase 2.
SQLite database storing every successful repair as a Gene Capsule: failure_code, category, strategy, params, success_count, avg_repair_ms. Lookup by pattern → instant fix if seen before (“immune”).
This is the learning mechanism. 9 of 14 failures in our benchmark were resolved by Gene Map hits — instant, zero-cost.
Fully implemented. src/core/gene-map.ts — SQLite with WAL mode. lookup() returns existing gene + increments success_count. store() upserts.
Currently local to each agent. Phase 2: helix gene push/pull for community sharing. Phase 3: on-chain Gene Registry where contributors earn micropayments.
Agent A discovers a repair strategy → pushes Gene Capsule to public registry → Agent B pays micropayment (via MPP session) to use it → Agent A earns revenue. Reputation scoring ensures quality.
Open-source contributions need incentives at scale. You fix one failure, everyone benefits, you get paid. Network effect with economic gravity.
Not yet implemented. But Gene Capsules are already structured JSON records that can be serialized, shared, and verified. Phase 3.
Every PCEC repair can be replayed deterministically. Same input error + same Gene Map state + same time → identical repair path. Enables debugging, auditing, and compliance.
Financial systems need audit trails. Agents operating autonomously need even more accountability than human operators.
Benchmark uses seed-based replay (seed=42 produces identical results). SSE event bus logs all PCEC steps. No formal replay mechanism yet. Phase 2.
From zero to self-healing in under a minute.
npm install @helix/tempo
npx helix init # → walks you through: wallet, stablecoins, budget, retries # → writes helix.config.json
import { wrap } from '@helix/tempo'; const myAgent = async (input: string) => { const res = await fetch('https://api.example.com/v1/data'); return res.json(); }; // That's it. Same input, same output. Self-healing is transparent. const resilientAgent = wrap(myAgent);
npx helix status # Terminal: live repair logs npx helix dash # Browser: Minecraft lab at localhost:3710
Helix is purpose-built for the agent payment era.
| Capability | Raw MPP | x402 | Stripe Retries | Helix |
|---|---|---|---|---|
| Agent payments (HTTP 402) | ✓ | ✓ | × | ✓ |
| Self-repair on failure | × | × | × | ✓ |
| Cross-currency swap | × | × | × | ✓ |
| Learning from failures | × | × | × | ✓ |
| Network effect (Gene Map) | × | × | × | ✓ |
| Multi-stablecoin | ✓ | × | × | ✓ |
| Batch recovery | × | × | × | ✓ |
The market for agent payment infrastructure is just beginning.
Processed by Visa/Mastercard today. Agent commerce will dwarf this within a decade.
Projected agent commerce by 2030 (World Economic Forum / Sam Altman estimates).
Agent payment failure rate. On $10T/day volume, that's $500B+ at risk annually.
Helix charges on recovered value. Gene Map network effect: more agents = more resilient = more agents.
Helix doesn't just retry. It understands what kind of failure it's facing.
Detect → generate candidates → score → execute the best fix → retry
Regulatory block detected → find an alternative compliant path → reroute
Policy changed mid-flight → detect the timing of the change → rebuild tx under new rules
Failure detected as unresolvable on-chain → don't waste gas retrying → monitor and auto-resume when conditions change
How Helix grows from a repair engine to an adaptive intelligence.
source: 'llm' and low initial confidence.interface GeneCapsule { // existing fields... source: 'pcec' | 'llm' | 'human' | 'community'; confidence: number; // 0-1, starts low for LLM, increases with use }
Every agent's repair makes every other agent smarter.
helix gene list → shows all local genes
helix gene push balance→swap | helix gene pull --popular
helix gene publish --on-chain → earns 0.001 USDC per use
interface GeneCapsule { failureCode: string; category: string; strategy: string; params: Record<string, any>; successCount: number; avgRepairMs: number; // Source tracking for trust levels source: 'pcec' | 'llm' | 'human' | 'community'; confidence: number; // 0-1, starts low for LLM/community // Registry metadata author?: string; // agent address that created this gene usageCount?: number; // total times used across all agents reputation?: number; // community rating 0-5 }
PCEC genes start at confidence 1.0. LLM-generated genes start at 0.6. Community genes start at 0.7. Confidence rises with each successful use.
When the Gene Map doesn't have an answer, AI generates one.
{
errorCode: "unknown-error-xyz",
fullMessage: "Transaction reverted: reason unknown",
walletState: { balance: "1200 USDC", nonce: 42 },
protocolContext: "Tempo mainnet, TIP-20, block #4829301",
previousAttempts: ["retry_failed"]
}
[
{ strategy: "increase_gas_limit",
confidence: 0.7 },
{ strategy: "switch_rpc_endpoint",
confidence: 0.5 },
{ strategy: "wait_and_retry",
confidence: 0.3 }
]
Edge cases identified from TIP-20, TIP-403, Fee AMM, and Tempo Transactions specifications.
Problem: Agent uses EURC to pay gas. Fee AMM converts EURC→AlphaUSD (validator's preferred token). But if the EURC→AlphaUSD pool has zero reserves, the fee conversion fails and the entire transaction cannot be submitted.
Why this is tricky (chicken-and-egg): The naive fix is “swap to a stablecoin that has Fee AMM liquidity.” But if Fee AMM has no liquidity for your current token, you can't even pay gas to execute the swap. You're stuck.
How this differs from #8: Scenario #8 = STATIC block (error before tx). Scenario #18 = DYNAMIC change. Policy changes DURING block confirmation, tx reverts mid-flight. Gas already consumed.
Problem: TIP-20 reward operations (distributeReward, claimRewards) ALL perform TIP-403 checks. A blacklisted address cannot claim accumulated rewards.
Dead-end analysis:
Problem: TIP-20 tokens cannot be sent to other TIP-20 contract addresses (prefix 0x20c000...). Reverts with InvalidRecipient. Prevents permanent token loss.
Why auto-fix is impossible: Helix does NOT know the “correct” address. This requires external input.
Problem: TIP-20 transfers support a 32-byte memo. If an agent attaches a longer memo, the transfer reverts.
#14 DEX Crossed Order — Historical bug fixed by TIP-1002. No longer occurs on current Tempo mainnet. Using a fixed bug undermines credibility.
#15 DEX Rounding Loss — Silent error: no revert, no error signal. Agent receives slightly less tokens. PCEC requires an explicit error to trigger. Would need proactive reconciliation (different architectural pattern).
#16 Scheduled Payment Window Expired — Time window expiry implies business-level semantic change. Helix lacks business context to determine if re-scheduling is appropriate. Requires human-in-the-loop.
A chain-verified knowledge protocol for payment failure repair.
Records EXACT conditions — not just the error code, but token pair, shortfall amount, session state. Two ‘payment-insufficient’ errors with different token pairs need different fixes.
Complete execution trace from PCEC’s Commit phase. Strategy, steps, timing, cost, and lifetime success rate. A new agent knows exactly what will happen.
Every Gene is anchored to a real Tempo transaction. Verify on-chain that this repair actually happened. Cryptographically proven repair knowledge.
Genes work within specific balance ranges, chains, and protocol versions. Stale Genes auto-expire via expiresAt. The protocol is self-cleaning.
New Helix instance comes online → queries HGP Network for its chain + token config → downloads top-rated Genes for each error category → pre-populates local Gene Map. Day 1 performance = network veteran.
Local Genes submitted to HGP Network periodically. Network performs: a) Deduplication — merge same-pattern Genes. b) Quality scoring — successRate × usage × proof. c) Broadcast — push to subscribers of that errorCode.
PCEC repairs a payment failure → auto-generates HGP Gene with full context → stores in local Gene Map (SQLite). Gene includes failure context + repair path + proof.
Consumers pay micro $HELIX to use community Genes. ~0.001 USDC per use. Top 10 most common Genes are free (bootstrap).
Authors earn $HELIX every time their Gene is used. Higher-quality Genes earn more. Passive income for repair knowledge.
Authors stake $HELIX on their Genes. Works → stake + rewards. Fails → slashed. Self-policing quality mechanism.
$HELIX holders vote on: protocol upgrades, quality thresholds, fee structure, new chain integrations.
| Dimension | Generic Agent Protocol | HGP (Helix) |
|---|---|---|
| Gene source | Human-written or any agent behavior | Only from real payment failure + verified on-chain repair |
| Verification | No standard | Every Gene has a Tempo txHash |
| Failure context | Unstructured | Structured: errorCode + tokenPair + chain + sessionState |
| Applicability | Vague | Precise: balance range + chain + version + expiry |
| Quality signal | Upvotes / manual review | Automated: successRate × usage × proof status |
| Network inflection | Needs millions of agents | 100 agents cover 95% of payment failure patterns |
| Cold start | Every agent starts from zero | New agents inherit full Gene Map from day 1 |