Skip to content

Installation

AgentCTX can be installed as an npm package, run via Docker Compose, or built from source.

The fastest way to get started:

Terminal window
npm install @agentctx/core

This gives you:

  • The actx CLI (via npx actx or globally with npm install -g @agentctx/core)
  • The TypeScript SDK for programmatic use
  • All core modules (parser, gateway, sidecar, memory, knowledge)

To use actx directly without npx:

Terminal window
npm install -g @agentctx/core
actx --version

For the full platform stack with SurrealDB, NATS, and all services:

Terminal window
git clone https://github.com/ryan-haver/agentctx.git
cd agentctx
docker compose up -d --build --wait

This starts 6 services:

ServicePortRole
surrealdb:8000SurrealDB v3 database (in-memory)
surrealdb-initSchema bootstrapper (loads 10 .surql files, then exits)
nats:4222NATS JetStream message bus
mock-mcp:3200Mock MCP backend for testing
agentctx:3100TypeScript SSE gateway (main entry point for agents)
ctx-gateway:8420Rust HTTP gateway (LLM traffic interception + compression)

For observability (Jaeger, Prometheus):

Terminal window
docker compose -f docker-compose.yml -f docker-compose.otel.yml up -d --build
Terminal window
docker compose -f docker-compose.yml -f docker-compose.bench.yml up --build
Terminal window
git clone https://github.com/ryan-haver/agentctx.git
cd agentctx
npm install
npm run build
npm link # Makes `actx` available globally
Terminal window
npm run dev # TypeScript watch mode
npm test # Run all unit tests
npm run test:integration # Integration tests (requires Docker)

Performance-critical paths are available as native Rust crates. These are optional — the TypeScript implementation handles everything by default.

CrateTargetsRole
ctx-parserNative, NAPI, PyO3, WASMRust CTX parser + serializer
ctx-compactorNativeContext compaction engine
ctx-compactor-napiNAPI (Node.js)N-API bridge for compactor
ctx-compactor-wasmWASM (browser)Browser-based compaction
ctx-gatewayNativeRust HTTP gateway (axum)
Terminal window
# Build the parser for Node.js
cd crates/ctx-parser
cargo build --release
# Build WASM for browser
cd crates/ctx-compactor-wasm
wasm-pack build --target web --no-opt
# Run Rust tests
cargo test --workspace
RequirementMinimumRecommended
Node.js20.0.022+ (LTS)
npm9+10+
Docker24+ (optional)25+ with Compose v2
Rust1.93+ (optional)Latest stable
Memory512 MB2 GB+ (with Docker stack)
OSLinux, macOS, WindowsAny with Node.js 20+