Self-healing infrastructure for AI agent payments. 90.3% auto-recovery.
helix is a widely-adopted TypeScript project in the AI payments / x402 ecosystem, focused on agent, agentic-ai, agentic-ai-self-evolving, ai. It currently has 822 GitHub stars and 3 forks, and sits alongside related tools like x402, x402, nano-currency-mcp-server, tael-protocol, bde-score, x402-payments-mcp.
Helix tackles the unglamorous but decisive problem of agent payments: failure recovery. It bills itself as self-healing infrastructure for AI agent payments, citing a 90.3% auto-recovery rate — the claim being that most failed payment flows can be retried, rerouted or repaired without human intervention.
Payment reliability is where agent systems quietly die: a stuck nonce, a reverted transfer, a facilitator timeout, and your autonomous loop halts. A layer dedicated to detecting and recovering from those states is genuinely differentiated in this directory, and the multi-agent + Privy + Coinbase topic mix suggests it plugs into mainstream wallets rather than inventing its own.
Best for: teams whose agents already transact in production and are hitting payment-flakiness walls.
Self-healing runtime for autonomous agents. Fix once, immune forever.
Agent payment intelligence — predict costs, optimize execution, fix failures. Powered by VialOS Runtime.
Your agent's API call failed. Helix diagnosed it, fixed it, and remembered. Next time — instant fix, zero cost. Think of stackoverflow + crowdstrike for agents.
// Before: hope for the best
await agent.sendPayment(invoice);
// After: self-healing in one line
const safePay = wrap(agent.sendPayment.bind(agent), { mode: 'auto' });
await safePay(invoice);
If this helped, please ⭐ — it helps us reach more developers.
Helix wraps your function. When it fails, a 6-stage pipeline kicks in:
Error occurs → Perceive → Construct → Evaluate → Commit → Verify → Gene
│ │ │ │ │ │
What broke? Find fixes Score them Execute Worked? Remember
The fix is stored in the Gene Map — a SQLite knowledge base scored by reinforcement learning. Next time the same error hits any agent, it's fixed in under 1ms. No diagnosis, no LLM call, no cost.
execution reverted — all failed. PCEC: 100%.npm install @helix-agent/core
import { wrap } from '@helix-agent/core';
// Wrap any async function — payments, API calls, anything
const safeCall = wrap(myFunction, { mode: 'auto' });
const result = await safeCall(args);
// Errors are automatically:
// 1. Diagnosed (what type of error?)
// 2. Fixed (modify params, retry with backoff, refresh token...)
// 3. Remembered (next time → instant fix)
Three modes, three risk levels:
| Mode | Behavior | Risk |
|---|---|---|
observe |
Diagnose only, never touch your call | Zero |
auto |
Diagnose + fix params + retry | Low — only changes how, never what |
full |
Auto + fund movement strategies | Medium |
Helix is the first vertical product of VialOS — an AI agent operating system. The VialOS Runtime provides the PCEC engine, Gene Map, and all learning modules. Helix adds payment-specific adapters on top.
@vial/core Generic self-healing engine
├── PCEC Engine 6-stage repair pipeline
├── Gene Map SQLite knowledge base + RL scoring
├── Self-Refine Iterative failure refinement
├── Meta-Learning 3 similar fixes → pattern → 4th is instant
├── Safety Verifier 7 pre-execution constraints
├── Self-Play Autonomous error discovery
├── Federated Learning Privacy-preserving distributed RL
└── Prompt Optimizer LLM classification auto-improves
@helix-agent/core Payment vertical (powered by Vial)
├── Coinbase 17 error patterns (CDP, ERC-4337, x402)
├── Tempo 13 error patterns (MPP, session, DEX)
├── Privy 7 error patterns (embedded wallet)
└── Generic 3 error patterns (HTTP)
@vial/adapter-api API vertical (powered by Vial)
├── Rate limits 429, throttle
├── Server errors 500, 502, 503, 504
├── Timeouts ETIMEDOUT, socket, gateway
├── Connection ECONNREFUSED, ECONNRESET, DNS
├── Auth 401, 403, expired token
└── Client 400, 413, 422, parse errors
Build your own adapter — implement the PlatformAdapter interface for any domain:
import { wrap } from '@vial/core';
import type { PlatformAdapter } from '@vial/core';
const myAdapter: PlatformAdapter = {
name: 'my-service',
perceive(error) {
if (error.message.includes('rate limit'))
return { code: 'rate-limited', category: 'throttle', strategy: 'backoff_retry' };
return null;
},
getPatterns() { return [/* ... */]; },
};
const safeCall = wrap(myFunction, { adapter: myAdapter, mode: 'auto' });
Helix runs on the VialOS Runtime. Enable VialOS integration with --beta:
npx @helix-agent/core serve --port 7842 --mode observe --beta
This activates:
GET /vial/status — VialOS runtime information (13 modules, 5 adapters)GET /health responseWithout --beta, Helix behaves identically to the stable release.
| Sentry/Datadog | Simple retry | Helix | |
|---|---|---|---|
| Detects errors | ✅ | ❌ | ✅ |
| Fixes errors | ❌ | ⚠️ blind retry | ✅ smart fix |
| Learns from fixes | ❌ | ❌ | ✅ Gene Map |
| Cross-agent learning | ❌ | ❌ | ✅ Federated |
| Safety constraints | N/A | ❌ | ✅ 7 checks |
Sentry tells you something broke. Helix fixes it.
TypeScript/JavaScript:
npm install @helix-agent/core
Python:
pip install helix-agent-sdk
Docker:
docker run -d -p 7842:7842 adrianhihi/helix-server
REST API:
curl -X POST http://localhost:7842/repair \
-H 'Content-Type: application/json' \
-d '{"error": "nonce too low", "platform": "coinbase"}'
# ⚠️ Use @helix-agent/core — "npx helix" installs a WRONG third-party package
npx @helix-agent/core serve --port 7842 # Start server + dashboard
npx @helix-agent/core scan ./src # Scan codebase for error patterns
npx @helix-agent/core simulate "nonce too low" # Dry-run diagnosis
npx @helix-agent/core self-play 10 # Autonomous error discovery
npx @helix-agent/core dream # Memory consolidation
npx @helix-agent/core discover # Find adapter gaps
Helix includes 15 learning and safety modules, all integrated into the core PCEC pipeline:
Learning — Gene Map (RL), Meta-Learning (few-shot), Causal Graph (prediction), Negative Knowledge (anti-patterns), Adaptive Weights (auto-tuning), Self-Play (exploration), Federated Learning (distributed), Gene Dream (memory consolidation), Prompt Optimizer (LLM self-improvement), Auto Strategy Generation (creates new fixes via LLM)
Safety — 7 pre-execution constraints (never modifies recipient or calldata), 4-layer adversarial defense (reputation, verification, anomaly detection, auto-rollback), cost ceilings, strategy allowlists
Execution — refresh_nonce, speed_up (gas × 1.3), reduce_request (value ÷ 2), backoff_retry (1s → 2s → 4s → 8s → 16s cap), renew_session (callback), split_transaction, remove_and_resubmit
Helix doesn't just fix errors — it gets better over time:
Level 1: Data Evolution
Every fix improves Q-values → better strategy selection
Level 2: Strategy Evolution
Meta-Learning spots patterns across fixes
Self-Play discovers errors before users hit them
Gene Dream consolidates knowledge during idle time
Level 3: Architecture Evolution
Auto Strategy Generation invents new fix methods via LLM
Adaptive Weights auto-tunes scoring per error category
Auto Adapter Discovery detects when new platforms need support
553+ tests across 59 files
Schema v12 (auto-migrating)
61 error patterns (40 payment + 21 API)
21 API error patterns
7 safety constraints
12 repair strategies
npx @helix-agent/core scan for GitHub Actions@vial/core)--beta flag for VialOS Runtime integrationHelix implements ideas from these papers:
| Paper | What We Took | Module |
|---|---|---|
| Reflexion | Verbal reinforcement from failures | Negative Knowledge |
| ExpeL | Experience-conditioned strategy selection | Conditional Genes |
| Voyager | Skill library that grows over time | Auto Strategy Gen |
| Self-Refine | Iterative refinement with self-feedback | Self-Refine loop |
| DSPy | Self-improving LLM pipelines | Prompt Optimizer |
| Mem0 | Scalable long-term memory | Gene Dream |
Contributions welcome. The easiest way to contribute is to write a new PlatformAdapter for a domain you care about.
git clone https://github.com/adrianhihi/helix
cd helix
npm install
npm run build
npm run test # 553+ tests should pass
See CONTRIBUTING.md for guidelines.
Helix is a self-healing runtime for autonomous agents — fix once, immune forever. It provides agent payment intelligence: predict costs, optimize execution, fix failures. Powered by VialOS Runtime.
| Stage | Action | Description |
|---|---|---|
| Perceive | What broke? | Error diagnosis |
| Construct | Find fixes | Generate solutions |
| Evaluate | Score them | Rank solutions |
| Commit | Execute | Apply fix |
| Verify | Worked? | Validate success |
| Gene | Remember | Store in Gene Map |
A SQLite knowledge base scored by reinforcement learning. When the same error hits again, it's fixed in under 1ms — no diagnosis, no LLM call, no cost.
import { wrap } from '@helix-agent/core';
const safeCall = wrap(myFunction, { mode: 'auto' });
const result = await safeCall(args);
| Benchmark | Result |
|---|---|
| 1,083 Base Mainnet transactions (12hr A/B test) | Helix: 99.9% vs blind retry: 81.9% |
5 frontier LLMs on execution reverted |
All failed, PCEC: 100% |
| Gene Map warm repair | 2,140ms → 1.1ms, $0.49 → $0.00 |
npm install @helix-agent/core
# or
pip install helix-agent-sdk
MIT License.
MIT
💸 Enable seamless, low-cost digital dollar payments with x402—zero fees, instant settlement, and no high minimums for all users.
💸 Simplify payments with x402, an open protocol for fast, fee-free digital dollar transactions. Experience seamless integration and instant settlements.
Send Nano currency from AI agents/LLMs
Tael is a payment layer that enables autonomous AI agents to securely pay for APIs, MCP tools, data, and digital services using USDC on Stellar.
🏆 Open-source multi-factor stock scoring API (0-100) | US/HK/A-Share 74 stocks | Zero signup | shields.io badges | GitHub Action | EU AI Act compliant
Give AI agents a wallet — x402 payment tools over Model Context Protocol.
A payments protocol for the internet. Built on HTTP.
Daydreams is a set of tools for building agents for commerce
The best way to monetize AI applications & MCP, using x402, CDP Smart Wallets & Paymaster
URL shortener
AWS payment demo of x402 using Bedrock AgentCore, Strands SDK, and CloudFront.
Cloudera CDP SDK for Java