Next-generation open-source AI agent development framework and runtime platform
ไธไธไปฃๅผๆบ AI ๆบ่ฝไฝๅผๅๆกๆถไธ่ฟ่กๆถๅนณๅฐ
Event-driven Runtime ยท Multi-provider LLM ยท RoleX Integration ยท TypeScript First
Build an AI agent in a few lines of TypeScript:
import { createAgentX } from "agentxjs";
import { nodePlatform } from "@agentxjs/node-platform";
import { createMonoDriver } from "@agentxjs/mono-driver";
const createDriver = (config) => createMonoDriver({
...config,
apiKey: process.env.ANTHROPIC_API_KEY,
provider: "anthropic",
});
const platform = await nodePlatform({ createDriver }).resolve();
const ax = createAgentX({ platform, createDriver });
// Create a conversation and chat
const agent = await ax.chat.create({
name: "My Assistant",
systemPrompt: "You are a helpful assistant.",
});
ax.on("text_delta", (e) => process.stdout.write(e.data.text));
await agent.send("Hello!");Expose your agent as a WebSocket server:
const ax = createAgentX({ platform, createDriver });
const server = await ax.serve({ port: 5200 });Connect to a running AgentX server:
import { createAgentX } from "agentxjs";
const ax = createAgentX();
const client = await ax.connect("ws://localhost:5200");
// Same API as local mode
const agent = await client.chat.create({ name: "My Assistant" });
await agent.send("Hello!");Interactive terminal chat:
cd apps/cli
cp .env.example .env.local # Set DEEPRACTICE_API_KEY
bun run devAgentX uses a layered concept model inspired by container runtimes:
Prototype (template) โ Image (persistent) โ Agent (runtime)
โ โ โ
Reusable definition Stored in DB Running in memory
Registered once Has session Has lifecycle
Like Dockerfile Like Docker image Like container
- Image โ persistent agent record with flat config (model, systemPrompt, mcpServers, etc.)
- Chat โ a conversation backed by an Image, accessed via
AgentHandle - AgentContext โ merged runtime configuration passed from Runtime to Driver
- SendOptions โ per-request overrides (model, thinking, providerOptions)
ax.chat.* // Conversation management (create, list, get โ AgentHandle)
ax.provider.* // LLM provider configuration
ax.runtime.* // Low-level subsystems (image, session, container)Override model, thinking, or provider options on each send:
// Create with default config
const agent = await ax.chat.create({
name: "Code Reviewer",
model: "claude-sonnet-4-6",
systemPrompt: "You are a code review assistant.",
});
// Override per-request
await agent.send("Review this PR...", { thinking: "high" });
await agent.send("Quick question", { model: "claude-haiku-4-5" });| Package | Description |
|---|---|
| agentxjs | Client SDK โ local, remote, and server modes |
| @agentxjs/core | Core abstractions โ Container, Image, Session, Driver |
| @agentxjs/node-platform | Node.js platform โ SQLite persistence, WebSocket |
| @agentxjs/mono-driver | Multi-provider LLM driver (Anthropic, OpenAI, Google, etc.) |
| @agentxjs/claude-driver | Claude-specific driver with extended features |
| @agentxjs/devtools | BDD testing tools โ MockDriver, RecordingDriver, Fixtures |
MonoDriver supports multiple LLM providers via Vercel AI SDK:
- Anthropic (Claude) โ
provider: "anthropic" - OpenAI (GPT) โ
provider: "openai" - Google (Gemini) โ
provider: "google" - DeepSeek โ
provider: "deepseek" - Mistral โ
provider: "mistral" - xAI (Grok) โ
provider: "xai" - OpenAI-compatible โ
provider: "openai-compatible"
MonoDriver integrates with RoleX for AI role management โ identity, goals, knowledge, and cognitive growth cycles:
import { localPlatform } from "@rolexjs/local-platform";
const driver = createMonoDriver({
...config,
rolex: {
platform: localPlatform(),
roleId: "my-role",
},
});Event-driven architecture with layered design:
SERVER SIDE SYSTEMBUS CLIENT SIDE
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโ โ
โ Environment โ โ
โ โข LLMProvider โ emit โ
โ โข Sandbox โโโโโโโโโโโโโโโโโโ>โ
โโโโโโโโโโโโโโโโโโโ โ
โ
โ
โโโโโโโโโโโโโโโโโโโ subscribe โ
โ Agent Layer โ<โโโโโโโโโโโโโโโโโโ
โ โข AgentEngine โ โ
โ โข Agent โ emit โ
โ โโโโโโโโโโโโโโโโโโ>โ โโโโโโโโโโโโโโโโโโโ
โ 4-Layer Events โ โ โ โ
โ โข Stream โ โ broadcast โ WebSocket โ
โ โข State โ โโโโโโโโโ>โ (Event Stream) โ
โ โข Message โ โ<โโโโโโโโโ โ
โ โข Turn โ โ input โ AgentX API โ
โโโโโโโโโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโ
โ
โ
โโโโโโโโโโโโโโโโโโโ โ
โ Runtime Layer โ โ
โ โ emit โ
โ โข Persistence โโโโโโโโโโโโโโโโโโ>โ
โ โข Container โ โ
โ โข WebSocket โ<โโโโโโโโโโโโโโโโโโซ
โ โโโโโโโโโโโโโโโโโโ>โ
โโโโโโโโโโโโโโโโโโโ โ
โ
[ Event Bus ]
[ RxJS Pub/Sub ]
Event Flow:
โ Input: Client โ WebSocket โ BUS โ LLM Driver
โ Output: Driver โ BUS โ AgentEngine โ BUS โ Client
AgentX is in active development. We welcome your ideas, feedback, and contributions!
Part of the Deepractice AI infrastructure:
- RoleX โ AI role management system (identity, cognition, growth)
- ResourceX โ Unified resource manager
- IssueX โ Structured issue tracking for AI collaboration
Connect with the Founder
๐ง sean@deepractice.ai
Scan to connect with Sean (Founder & CEO) on WeChat
Built with โค๏ธ by Deepractice