Skip to main content

Infinity

The open-source ecosystem for agents with principled concurrency.

Infinity Code

An AI coding agent for your terminal and desktop. Concurrent sessions, sandboxed execution, background agents, and live thread visualization — all powered by the Infinity Runtime.

Get started →
Chat

Implement the login and session system with JWT tokens and parameterized queries

I'll implement the auth module. All database queries will use parameterized statements.

◆Edit src/auth/token.ts (9 lines)

◆Edit src/auth/login.ts (19 lines)

◆Edit src/auth/session.ts (17 lines)

Done — implemented login.ts, session.ts, and token.ts. All queries use parameterized statements and passwords are compared with timing-safe equality.

Built for agents that live in the real world

🔧 Tool call:  subscribe_stripe_events({
                 event: "charge.succeeded",
                 min_amount: 500
               })
📥 Result:     "Subscribed. ID: sub_9k2m"

🔧 Tool call:  sleep_until_event_or_input()
💤 Hibernating...

  ⋮  (3 hours later, a charge arrives)

⚡ Subscription event:
  charge.succeeded — $847.00 from cus_Lx8mQ

🤖 Agent:  Looking up the customer details...
Learn more →

Backwards-Compatible with MCP.

RAP includes a compatibility layer for MCP servers. RAP agents can hibernate during MCP tool calls — whether that takes 100ms or 3 days.

MCP

Agent blocks on every tool call

agent calls tool
  ↓
agent waits... (compute running)
agent waits... (still running)
agent waits... (20 min later)
  ↓
tool returns result
agent continues
RAP

Agent hibernates, wakes on result

agent calls tool via HTTP
tool acknowledges immediately
agent exits (zero compute)
  ⋮
  ⋮  (20 min later, tool finishes)
  ⋮
tool POSTs result to RAP agent runtime
agent wakes, continues

Designed for Swarms

Agents spawn child threads for parallel work. Each child reports back via subscriptions — the parent stays focused while the swarm fans out.

Threaded agents, not blocked agents

A parent agent breaks work into sub-tasks and spawns child threads. Each child runs independently with its own context window, processes its task, and reports results back to the parent using the same subscription mechanism that powers real-time events.

The parent never blocks. Reports arrive as subscription events — the parent sees them in-context and decides what to do next. Children can send multiple interim reports before closing, giving the parent a live view of swarm progress.

Threading docs →
🤖 Parent:  I'll review auth.ts in a thread.

🔧 spawn_thread({
     instructions: "Review auth.ts for security issues"
   })
📥 "Child spawned: thread_a1b2"

  ⋮  (parent continues working concurrently)

── report from thread_a1b2 ──
📥 "Critical: SQL injection at line 42."

🤖 Parent:  Addressing the injection issue…

  ⋮  (parent and child continue working)

── thread_a1b2 closed ──
📥 "Review complete. 1 critical issue found."

🤖 Parent:  Great, review's done. All issues addressed.