Skip to content

Packages & Imports โ€‹

Install confused-ai once. That is the public consumer package.

Use confused-ai for the common agent APIs. Use confused-ai/<module> when you want a more focused import path from the same installation.

bash
npm install confused-ai

Root imports โ€‹

Use the root package for the headline APIs that most apps start with.

ts
import { agent, defineAgent, compose, tool } from 'confused-ai';

Module subpaths โ€‹

Use subpaths when you want clearer intent or a narrower import surface.

ts
import { TavilySearchTool } from 'confused-ai/tools';
import { createSqliteStore } from 'confused-ai/session';
import { GuardrailValidator, createPiiDetectionRule } from 'confused-ai/guardrails';
import { withResilience } from 'confused-ai/production';
import { CircuitBreaker } from 'confused-ai/guard';
import { createHttpService, listenService } from 'confused-ai/runtime';
import { ConsoleLogger } from 'confused-ai/observability';
import { openai } from 'confused-ai/model';

Common subpaths:

Import pathUse for
confused-ai/toolsIntegrations and toolkits
confused-ai/sessionSession stores
confused-ai/guardrailsSafety rules and validators
confused-ai/productionwithResilience() and production wrappers
confused-ai/guardLow-level circuit breaker, rate limiter, health helpers
confused-ai/runtimeHTTP runtime, auth, WebSocket transport
confused-ai/orchestrationSupervisor, routing, consensus, A2A
confused-ai/observabilityLogging, tracing, eval utilities
confused-ai/llmProvider classes and routing utilities
confused-ai/modelopenai(), anthropic(), ollama() shorthands

Contributor note โ€‹

The repository is organized internally as a monorepo, so contributors will see @confused-ai/* workspace package names in implementation code and build scripts.

That internal layout is not the public install story. Consumer docs, app code, and examples should use:

  • confused-ai
  • confused-ai/<module>

Publish checks โ€‹

The repository still validates every exported subpath before publishing:

bash
npm run package:prepare

That command builds the single public package surface and verifies that every declared export target exists on disk.

Released under the MIT License.