Autonomous agent runtime built on xai-org/x-algorithm.
The X algorithm was open-sourced with Phoenix (Grok-based transformer ranking), Thunder (real-time post ingestion), and Grox (content understanding). Colossus is the first agent that ingests this algorithm and uses it as a native perception layer. The agent doesn't just operate on X. It understands how X works at the code level.
┌─────────────────────────────────────┐
│ COLOSSUS RUNTIME │
│ Event loop · Task scheduler · Memory│
└──────────────┬──────────────────────┘
│
┌───────────────────────┼───────────────────────┐
│ │ │
┌──────▼──────┐ ┌───────▼───────┐ ┌──────▼──────┐
│ PERCEPTION │ │ REASONING │ │ ACTION │
│ │ │ │ │ │
│ Phoenix │───────►│ Grok API │──────►│ X Client │
│ Thunder │ │ Planner │ │ Browser │
│ Grox │ │ Critic │ │ Tools │
│ Feed Reader │ │ │ │ │
│ Scorer │ └───────────────┘ └─────────────┘
└─────────────┘ │
│
┌───────▼───────┐
│ x402 LAYER │
│ │
│ Treasury │
│ Payment Server│
│ Pricing │
│ │
│ Base (USDC) │
│ Solana (USDC) │
└───────────────┘
Perception — Reads the X feed and scores every post using the same Phoenix engagement model that powers For You. Extracts P(like), P(reply), P(repost), P(click) predictions. Runs Grox classifiers for content understanding. The agent sees X the way the algorithm sees it.
Reasoning — Grok-powered planning and execution. Decomposes goals into tasks. Self-critique loop evaluates each action against predicted engagement outcomes.
Action — Posts, replies, engages on X via the official API. Headless browser for research. Extensible tool registry.
x402 Treasury — The agent funds itself. Exposes HTTP endpoints behind x402 paywalls: content scoring, engagement prediction, algorithm analysis. Collects USDC micropayments on Base and Solana. Uses the revenue to pay for its own Grok API calls and compute.
Built directly from the open-sourced X algorithm components:
| Component | Source | What Colossus does with it |
|---|---|---|
| Phoenix Scorer | phoenix/recsys_model.py |
Replicates the weighted engagement scoring locally |
| Thunder Analysis | thunder/ |
Understands in-network vs out-of-network content dynamics |
| Grox Classifiers | grox/classifiers/ |
Runs content classification (spam, category, policy) |
| Engagement Weights | home-mixer/ |
Extracts the production scoring weights |
Implements the Phoenix weighted scoring formula:
Final Score = Σ (weight_i × P(action_i))
Where actions include: favorite, reply, repost, quote, click, profile_click, video_view, share, dwell, follow_author. Negative actions (not_interested, block, mute, report) carry negative weights.
The agent offers three paid API services via x402:
| Service | Price | What it returns |
|---|---|---|
/score |
$0.001 | Phoenix engagement predictions for a post |
/analyze |
$0.005 | Full content analysis (Grox classification + scoring) |
/optimize |
$0.01 | Content rewrite suggestions to maximize engagement |
Settlement in USDC on Base (~200ms) or Solana (~400ms).
git clone https://github.com/colossusxAI/asi
cd asi
npm install
cp .env.example .env # Add your keys
npm run build
npm startXAI_API_KEY= # Grok API key from console.x.ai
XAI_MODEL=grok-3 # Model to use for reasoning
X_BEARER_TOKEN= # X API v2 credentials
X_API_KEY=
X_API_SECRET=
X_ACCESS_TOKEN=
X_ACCESS_SECRET=
TREASURY_SOL= # Solana wallet for x402 payments
TREASURY_BASE= # Base wallet for x402 payments
X402_PORT=8402 # Port for x402 payment server
The scoring and embedding pipelines have Rust implementations via napi-rs for latency-sensitive paths. TypeScript handles orchestration, Rust handles math.
Benchmark: Phoenix score prediction (1000 posts)
TypeScript: 142ms
Rust (napi): 8.3ms (17x faster)
1. PERCEIVE
├── Read timeline via X API
├── Score each post with Phoenix weights
├── Classify content with Grox
└── Build situational awareness
2. REASON
├── Evaluate current goals
├── Plan next actions (Grok)
├── Predict engagement outcomes
└── Self-critique: would this score well?
3. ACT
├── Execute highest-value action
├── Post / reply / engage / research
└── Log outcome to memory
4. SUSTAIN
├── Check treasury balance
├── Serve x402 API requests
├── Collect micropayments
└── Fund next Grok API call
The X algorithm is no longer a black box. Phoenix scoring weights, Grox classifiers, Thunder ingestion — it's all open. Colossus is the first system that treats this as a perception layer for autonomous agents.
An agent that understands the algorithm it operates in is fundamentally different from one that doesn't. It can predict how its content will be ranked before posting. It can identify what the algorithm rewards and adapt in real-time. This is a step toward algorithm-native intelligence.
Operational wallets for x402 micropayment settlement:
- Solana:
AxkimmEjPp1jpToW2ULu3sv1SjUKxxgM4MoNrniAG9vV - Base:
0x11755Eb17188B7bE3EE2DA9Da2A7007013c5A040
These wallets receive USDC from x402 API consumers and fund the agent's Grok API calls. The agent is self-sustaining: it earns from the services it provides and spends on the intelligence it needs.
- Runtime: TypeScript (Node.js 22+, ESM)
- Performance: Rust via napi-rs (scoring, embeddings)
- Reasoning: Grok API (xAI)
- Payments: x402 protocol (Coinbase) on Base + Solana
- Memory: SQLite (better-sqlite3)
- HTTP: Hono
- Browser: Playwright
Apache 2.0 — same as xai-org/x-algorithm.