Installation
Installation
Section titled “Installation”AgentCTX can be installed as an npm package, run via Docker Compose, or built from source.
npm Package
Section titled “npm Package”The fastest way to get started:
npm install @agentctx/coreThis gives you:
- The
actxCLI (vianpx actxor globally withnpm install -g @agentctx/core) - The TypeScript SDK for programmatic use
- All core modules (parser, gateway, sidecar, memory, knowledge)
Global CLI
Section titled “Global CLI”To use actx directly without npx:
npm install -g @agentctx/coreactx --versionDocker Compose
Section titled “Docker Compose”For the full platform stack with SurrealDB, NATS, and all services:
git clone https://github.com/ryan-haver/agentctx.gitcd agentctxdocker compose up -d --build --waitThis starts 6 services:
| Service | Port | Role |
|---|---|---|
| surrealdb | :8000 | SurrealDB v3 database (in-memory) |
| surrealdb-init | — | Schema bootstrapper (loads 10 .surql files, then exits) |
| nats | :4222 | NATS JetStream message bus |
| mock-mcp | :3200 | Mock MCP backend for testing |
| agentctx | :3100 | TypeScript SSE gateway (main entry point for agents) |
| ctx-gateway | :8420 | Rust HTTP gateway (LLM traffic interception + compression) |
With OpenTelemetry
Section titled “With OpenTelemetry”For observability (Jaeger, Prometheus):
docker compose -f docker-compose.yml -f docker-compose.otel.yml up -d --buildWith Benchmarks
Section titled “With Benchmarks”docker compose -f docker-compose.yml -f docker-compose.bench.yml up --buildFrom Source
Section titled “From Source”git clone https://github.com/ryan-haver/agentctx.gitcd agentctxnpm installnpm run buildnpm link # Makes `actx` available globallyDevelopment Mode
Section titled “Development Mode”npm run dev # TypeScript watch modenpm test # Run all unit testsnpm run test:integration # Integration tests (requires Docker)Rust Crates (Optional)
Section titled “Rust Crates (Optional)”Performance-critical paths are available as native Rust crates. These are optional — the TypeScript implementation handles everything by default.
Prerequisites
Section titled “Prerequisites”- Rust 1.93+ with
wasm32-unknown-unknowntarget - wasm-pack (for WASM builds)
Available Crates
Section titled “Available Crates”| Crate | Targets | Role |
|---|---|---|
ctx-parser | Native, NAPI, PyO3, WASM | Rust CTX parser + serializer |
ctx-compactor | Native | Context compaction engine |
ctx-compactor-napi | NAPI (Node.js) | N-API bridge for compactor |
ctx-compactor-wasm | WASM (browser) | Browser-based compaction |
ctx-gateway | Native | Rust HTTP gateway (axum) |
Building Crates
Section titled “Building Crates”# Build the parser for Node.jscd crates/ctx-parsercargo build --release
# Build WASM for browsercd crates/ctx-compactor-wasmwasm-pack build --target web --no-opt
# Run Rust testscargo test --workspaceSystem Requirements
Section titled “System Requirements”| Requirement | Minimum | Recommended |
|---|---|---|
| Node.js | 20.0.0 | 22+ (LTS) |
| npm | 9+ | 10+ |
| Docker | 24+ (optional) | 25+ with Compose v2 |
| Rust | 1.93+ (optional) | Latest stable |
| Memory | 512 MB | 2 GB+ (with Docker stack) |
| OS | Linux, macOS, Windows | Any with Node.js 20+ |
Next Steps
Section titled “Next Steps”- Configuration → — configure
actx.yaml, environment variables, and secrets - Quick Start → — run your first CTX operations