Skip to content

Quick Start

Get AgentCTX running and execute your first CTX operations in under 5 minutes.

  • Node.js ≥ 20Download
  • Docker (optional) — required for SurrealDB persistence and NATS messaging
Terminal window
npm install @agentctx/core

This installs the core library and the actx CLI.

Terminal window
npx actx init

This creates a .context/ directory in your project with:

.context/
├── actx.yaml # Gateway configuration
├── objects/ # Content-addressed object store
├── refs/ # Reference pointers
├── translations/ # Signed sidecar translations
├── logs/ # Operation logs
└── .keys/
├── ed25519.key # Agent signing keypair
└── project.salt # Scoped convergent encryption salt

Register a backend server that your agent can call tools from:

Terminal window
npx actx add github --command "npx -y @modelcontextprotocol/server-github" --roles "code,issues"

This updates .context/actx.yaml with the backend configuration. AgentCTX will lazy-spawn the backend when an agent first queries its tools.

Terminal window
# SSE mode (for HTTP clients)
npx actx start --transport sse --port 3100
# stdio mode (for IDE extensions and agent frameworks)
npx actx start

Open a second terminal and try these operations:

Terminal window
# Discover available tools
npx actx query '?t github'
# Call a tool
npx actx query '>t github.issues.list state="open" ^5'
# Store a memory
npx actx query '+m "first-memory" #milestone "AgentCTX is running"'
# Search knowledge
npx actx query '?k "authentication" #code ^3'
# Recall memories
npx actx query '?m #milestone @7d'

Each query returns a structured GatewayResult:

{
"ok": true,
"op": "?t",
"ms": 4,
"data": {
"results": [
{ "name": "github.issues.list", "score": 0.95 },
{ "name": "github.issues.create", "score": 0.91 }
],
"count": 2
}
}

Check that sidecar translations are intact:

Terminal window
npx actx verify

This cryptographically validates every Ed25519 signature in .context/translations/.

  1. actx init created an Ed25519 keypair and a content-addressed object store
  2. actx add registered an MCP backend with role-scoped access
  3. actx start booted a 15-stage middleware pipeline (identity → auth → routing → execution)
  4. actx query parsed CTX syntax, routed through the gateway, and returned structured results
  5. actx verify validated the sidecar trust boundary