Crux
Foundations

Packages

What each Crux package does and when to install it.

Crux is split into focused packages. Everyone needs @crux/core. Pick an adapter for your SDK, then add storage, React hooks, and the local runtime as needed.

You usually do not install every package. Start with @crux/core, add the adapter for your SDK, then add storage, React, local devtools, or telemetry only when you need them.

Quick reference

PackageWhat it doesInstall when
@crux/corePrompts, contexts, memory, plans, tasks, compaction, scoring, agents, index contracts, lint contracts, runtime bridge, observabilityAlways — this is the base
@crux/reactReact provider, hooks, transports, and SSE server helperYou render Crux plans/tasks/memory in React
@crux/aiVercel AI SDK adapter (generate, stream), @crux/ai/agent, and stream integration for plans/tasksYou use ai / @ai-sdk/*
@crux/openaiOpenAI SDK adapter (createOpenAI)You use the openai package directly
@crux/googleGoogle GenAI adapter (createGoogle)You use @google/genai
@crux/anthropicAnthropic SDK adapter (createAnthropic)You use @anthropic-ai/sdk directly
@crux/convexConvex DataStore adapter, workspace BlobStore, server boundaries, Agent bridge, compaction, swarm componentYour backend is Convex
@crux/upstashUpstash VectorStore, Redis DataStore adapter, compatibility storesYou need managed vector search or Redis-backed storage
@crux/otelOpenTelemetry spans for production observabilityYou need traces in Datadog, Honeycomb, Grafana, etc.
@crux/localLocal Go runtime, dev server, web UI host, TUI, eval runner, index, lint, and trace servicesDevelopment and debugging
@crux/devtoolsReact web devtools UI bundleUsually installed through @crux/local

@crux/core

The base package. Contains all SDK-agnostic primitives, organized into subpath exports:

SubpathExports
@crux/coreprompt, context, createPrompts, createContexts, config, when, match
@crux/core/memorymemory, workingState, episodes, facts, procedures
@crux/core/storageDataStore, VectorStore, BlobStore, storage, inMemoryStorage
@crux/core/compactioncreateSlidingWindow, createBudgetManager, extractKeyFacts, summarizeMessages
@crux/core/scoringllmJudge, metrics
@crux/core/agentagent, blackboard, handoff, delegate, composition factories
@crux/core/flowflow, signalFlow, cancelFlow, createFlowId
@crux/core/planplan, getPlan, updatePlan, planAgent, createPlanTool
@crux/core/taskstasklist, taskListAgent, taskWorker, createTaskListTool
@crux/core/skillskill.inline, skill.fromFile, skill.fromRegistry
@crux/core/safetyguardrail, constraint, safety plugins
@crux/core/project-indexProject Index contracts and serializers
@crux/core/lintAuthored-graph lint contracts
@crux/core/runtime-bridgeRuntime bridge command-plane contract
@crux/core/qualityquality, suite, target, expect, cassette

Adapter packages

All adapters follow the same factory pattern. They wrap prompt.resolve() and translate to provider-specific API calls.

// Vercel AI SDK
import { generate, stream } from '@crux/ai'

// OpenAI SDK
import { createOpenAI } from '@crux/openai'
const openai = createOpenAI(client)
await openai.generate(prompt, { model: 'gpt-4o', input })

// Anthropic SDK
import { createAnthropic } from '@crux/anthropic'
const anthropic = createAnthropic(client)
await anthropic.generate(prompt, { model: 'claude-haiku-4-5-20251001', input })

// Google GenAI
import { createGoogle } from '@crux/google'
const google = createGoogle(client)
await google.generate(prompt, { model: 'gemini-2.5-flash', input })

You can use multiple adapters in the same project. Prompts are SDK-agnostic — the same prompt works with any adapter.

Storage packages

Persistent storage is split by capability. DataStore holds JSON records, VectorStore handles dense/sparse/hybrid search, and BlobStore holds workspace bytes.

// Convex
import { cruxConvexStore, convexWorkspaceBlobStore } from '@crux/convex'

// Upstash Vector + Redis
import { upstashVectorStore } from '@crux/upstash'
import { cruxRedisStore } from '@crux/upstash/redis'

For Convex runtime setup and boundary rules, see the Convex guide.

Plugin packages

// OpenTelemetry
import { withTelemetry } from '@crux/otel'

config({
  plugins: [withTelemetry({ serviceName: 'my-app' })],
})

Supports two export paths: standard OTel TracerProvider (Node.js servers) and lightweight HTTP/callback exporters (Lambda, Convex, Cloudflare Workers).

Devtools

// Only when app runtime code should send records to a known server/tunnel
config({ devtools: { serverUrl: process.env.DEVTOOLS_URL } })
crux dev                # start server + open web UI
crux dev --tui          # interactive terminal dashboard
crux traces             # list recent traces
crux quality list       # list discovered evaluations
crux quality run        # run all Quality evaluations
crux quality run --ci   # CI mode with exit codes

Typical setups

Minimal (prototyping)

pnpm add @crux/core @crux/ai zod

Production with Convex

pnpm add @crux/core @crux/react @crux/ai @crux/convex @crux/local @crux/otel zod

Multi-provider

pnpm add @crux/core @crux/ai @crux/openai @crux/google @crux/anthropic zod

Where to next

On this page