Jump to a page
- Getting started
- Choosing an engine
- Adopt a pre-built agent
- The SEO crew
- Capability bundles
- Agent Studio
- AI Studio
- Studio plugins
- Skill store
- Knowledge & tools
- Audiences
- Agent config
- Approval modes
- Model providers
- Task lists
- Document ingestion
- Attachments
- Sub-org scopes
- Issue intake
- Durable background runner
- Recurrence
- Client tools
- Metric series store
- Audit every LLM call
- Task-manager plane
- Pipeline plane
- @nightowlsdev/core
- @nightowlsdev/hooks
- @nightowlsdev/engine-mastra
- @nightowlsdev/engine-ai-sdk
- @nightowlsdev/engine-a2a
- @nightowlsdev/engine-openai-agents
- @nightowlsdev/engine-trigger-chat
- @nightowlsdev/engine-eve
- @nightowlsdev/react
- @nightowlsdev/theme
- @nightowlsdev/ui
- @nightowlsdev/graph-react
- @nightowlsdev/cli
- @nightowlsdev/mcp
- @nightowlsdev/connectors
- @nightowlsdev/skills
- @nightowlsdev/integration-native
- @nightowlsdev/integration-composio
- @nightowlsdev/mcp-server
- @nightowlsdev/provider-anthropic
- @nightowlsdev/provider-openai
- @nightowlsdev/provider-openrouter
- @nightowlsdev/provider-vercel-gateway
- @nightowlsdev/provider-ollama
- @nightowlsdev/provider-groq
- @nightowlsdev/storage-local
- @nightowlsdev/storage-supabase
- @nightowlsdev/knowledge
- @nightowlsdev/graph
- @nightowlsdev/metrics
- @nightowlsdev/tasks
- @nightowlsdev/pipeline
- @nightowlsdev/runner-background
- @nightowlsdev/runner-nextjs
- @nightowlsdev/telemetry-core
- @nightowlsdev/telemetry-langfuse
- @nightowlsdev/telemetry-otel
- @nightowlsdev/auth-supabase
- @nightowlsdev/auth-auth0
- @nightowlsdev/auth-jwt
- @nightowlsdev/auth-sessions
- @nightowlsdev/eval
- @nightowlsdev/gepa
- @nightowlsdev/agent-kit
- @nightowlsdev/agent-builder
- @nightowlsdev/agent-researcher
- @nightowlsdev/agent-marketer
- @nightowlsdev/agent-designer
- @nightowlsdev/agent-writer
- @nightowlsdev/agent-seo
- @nightowlsdev/agent-diagnostics
Night Owls reference
A TypeScript framework for building multi-agent swarms. Dependencies flow one way, core to adapters to UI to apps, and the engine stays wrapped behind a stable public API. Below: the long-form guides, then the full module index.
Guides
Long-form walkthroughs for the concepts that span more than one package.
Getting started
Install the framework, define your first agent, and run it locally on just a model key. Then wire model, storage, and runner adapters.
Read the guide →Choosing an engine: native full-governance vs. adapter, and where durability comes from
The run loop is swappable, and the choice is about WHERE the loop runs, not a feature checklist. A native engine runs in your process and reuses the full governance plane; an adapter fronts a remote runtime you don't own, so cost caps, the tool gate, and the pre-generation veto can't reach it — by architecture, not maturity. Durability is a separate axis: the first-class governed-AND-durable path is @nightowlsdev/runner-background with a native engine, not a remote adapter.
Read the guide →Adopt a pre-built agent
Pull a researcher, marketer, designer, writer, or agent-builder into your swarm: curated skill import, runtime injection, tier config, and approvals, the full journey once.
Read the guide →The SEO crew: read-only analyst, metered researcher
Wire the pre-built SEO crew over the Google Search Console + GA4 connectors: why the read-only analyst and the researcher are two agents, the fail-closed data-tool admission, the five curated skills, metered paid providers, and the three measurement-honesty invariants (anonymised-query incompleteness, quota-as-stop, free-first).
Read the guide →Capability bundles
Package agents, their rules, workflows, and connector grants into one reusable, versioned unit. Compose, publish, apply, and upgrade without clobbering local tuning.
Read the guide →The Agent Studio (experimental)
Mount the experimental <AgentStudio> to manage agent config from the database: roster, full editor, tool and skill grants, audiences, and version history with CAS-safe publish and rollback. Authorization stays server-side; the component is untrusted UI.
Read the guide →The AI Studio
Compose agents, skills, knowledge, tools, and the graph workbench into one operator console with a section registry. A section you don't wire never appears, a section nobody opens costs nothing, and readOnly can only ever narrow what the server already permits.
Read the guide →Ship a studio section with your package
A capability package can bring its own AI Studio section: client, discovery, copy, and UI in one object a host registers in a line. Declare the tier your routes enforce, gate them on the same admin plane the console uses, and keep the plugin's identity stable so the section never remounts under the operator.
Read the guide →The skill store
Browse skill providers behind a policy floor, check for updates without installing them, and import third-party instruction text through a server-issued preview token rather than caller assertions.
Read the guide →Knowledge and tools
Enumerate and delete knowledge sources, ask who holds a capability before revoking it, manage integration connections, and register outbound MCP servers over an HTTP-only table.
Read the guide →Audience-scoped agents
Scope which agents each caller can see and address. AuthContext.audiences is intersected with each agent's audiences, fail-closed across the roster, addressing, resume, and delegation.
Read the guide →Host-facing agent-config surface
List grantable capabilities, read and validate an agent, and apply rules, workflow, memory, and grants per agent over default-deny admin routes with CAS-safe publish. The server-side surface behind the Agent Studio.
Read the guide →Approval modes and the tool risk vector
Annotate a tool with six tri-state risk axes, get one computed danger level, and let the deployment pick manual, auto, or permissive. Composition narrows only, unknown stays unsafe, and a deployment that sets nothing behaves byte-identically.
Read the guide →Model providers and model discovery
Register model providers, list what each one actually exposes, write provider-qualified allow-list entries, and price every run at the provider that ran it. Wire no registry and everything degrades to the shipped free-text field.
Read the guide →Per-conversation task lists
A persisted checklist every agent in a conversation reads as the shared plan and the user can edit at the same time. Compare-and-swap under a lock, server-assigned ids, a restore only a human can reach, and a deterministic nudge when items are still open.
Read the guide →The document ingestion pipeline
Chunk, admit, and embed a whole document into the knowledge plane: a host extraction contract that refuses an empty parse, per-batch commits behind an atomic finalize so a partial ingest is never searchable, and a chunk-plan fingerprint that makes resume safe rather than optimistic. Builds on the FR-055 scope axis and FR-051 admission.
Read the guide →Attachments: let an agent see the file
A user attaches a screenshot or a PDF and the agent actually reads it. Refs cross the wire, never bytes or URLs; you own the bucket and the resolver. Includes what each engine can carry, and the v1 trades — approval and attachments are mutually exclusive within one turn on two of the three engines.
Read the guide →Sub-org scopes: departments inside one org
orgScope partitions knowledge, skills, runs and threads by department inside a single org, without touching the hard org_id boundary. Host-resolved, never a tool argument; reads see their own scope and its ancestors, writes land at exactly one scope, and undefined stays unrestricted so an existing deployment sees no change.
Read the guide →Issue intake: user-reported and agent-filed
One report row filed from two ends: a signed-in user through the embeddable <IssueIntake> form, and an agent through report_issue. Intake is authenticated-only — every report carries a real principal. Attribution is derived from an identity the request body cannot reach, free text is redacted on the way in, and a scrub-before-hash fingerprint groups repeats.
Read the guide →The durable background runner
Run a swarm turn in durable infrastructure so an ask-suspended run parks with ZERO compute, survives process death, and resumes later. One vendor-agnostic DurableBackend seam (enqueueRun / createWaitpoint / completeWaitpoint) over three backends — Trigger.dev v4 (GA, durable tasks + wait tokens, not chat.agent), Vercel Workflow (the in-package swarmWorkflow subpath), and in-memory (dev, not durable across a restart). Plus the stuck-run reaper that reports the count REAPED not selected, and per-suspension waitpoint integrity so a re-suspended followup can't resume with a stale token.
Read the guide →The recurrence plane
Register a schedule and the plane fans it out across tenants and enqueues an agent run at-most-once per occurrence, from one authenticated cron route. The claim is a row in an append-only ledger (schedule_occurrences, migration 0031), the staleness deadline is persisted, and a suspended HITL run still blocks its own successor. Wire no schedules and the deployment is byte-identical.
Read the guide →Client tools: let an agent act in the browser
Client tools are tools the model calls but your browser runs: frame a camera, read the selection, upload a file, apply to the live scene. The FR-002 seam (defineClientTool, useClientTools, swarm.client_action) shipped earlier; as of @nightowlsdev/react@2.8.0 you register them with one prop on <SwarmChat>, no raw-hook rebuild.
Read the guide →The metric series store
A separate, opt-in observation plane — (orgId, orgScope, metric, at, dims) → value — with calendar bucketing and a fully-pinned period-over-period compare(). Its own package, its own pg Pool, its own metrics_000N migration, server-only; deliberately not a StorageAdapter field, so a swarm that never installs it is byte-identical.
Read the guide →Audit every LLM call: what the framework measures, and how to record it (opt-in)
Every generation a native engine runs emits a per-call swarm.usage event (agent slug, model id, token breakdown, priced cost, a stable generationId) and every segment seals one swarm.turn_usage. You wire nothing and pay nothing; add an onEvent observer, a persisted events table, the ready-made supabaseUsageSink, the metric-series store, or a telemetry exporter, and you have an on-demand audit trail of what every agent did, when, and at what cost — down to the individual model call. Includes the honest gaps: adapter remote loops, metered-vs-billed cost, unpriced models.
Read the guide →The task-manager plane
A separate, opt-in plane for WORK — human- and agent-assigned tasks — and for running an agent against a task unattended: a resume-safe cumulative cost ceiling (the turn_usage observer, not RunInput.budget), a single-winner atomic start, and a prompt-injection fence for mirrored tasks. Its own package, its own tasks_000N migration, server-only RLS; plus mergeQueue and the admin board whose AgentExecutionPolicy editor is admin-only, enforced server-side.
Read the guide →The pipeline plane
A separate, opt-in plane for data-driven, fan-out-capable structured extraction — a DAG stored as data whose stages can be run by a NAMED, GOVERNED swarm agent (cost cap + tool gate + rules + metering), not just a raw LLM prompt. Publish-time validation of referent existence AND acyclicity (the gap defineWorkflow's validator lacks), a real cross-stage budget ceiling, its own pipeline_0001_* migration, server-only; plus the admin routes behind adminRouteGate("pipelines") and the pipelinesPlugin Studio section.
Read the guide →Every package, documented
Grouped by category. Each page has its install command, key exports, and a usage snippet.
Engine
8 modules@nightowlsdev/core
MastraThe engine core: define agents, skills, tools and swarms, then run them, the @mastra-backed brain behind every Night Owls host.
@nightowlsdev/hooks
The @mastra-free decision-hook substrate: the plain types and dispatcher the platform's billing, approval, and mutation gates hang off.
@nightowlsdev/engine-mastra
The default engine as a named package, a mastraEngine() factory + MastraEngine re-export; installing it changes imports, not behavior.
@nightowlsdev/engine-ai-sdk
The second native engine, a governed ai@^7 streamText loop. Single-agent v1 (no delegation/workflows/semantic recall yet), full HITL + governance, tier-3 events.
@nightowlsdev/engine-a2a
The A2A (Agent2Agent) protocol adapter engine, renders any A2A v0.3-wire endpoint (Bedrock AgentCore, Azure AI Foundry/Copilot Studio, Google ADK/Vertex Agent Engine) as a single Night Owls agent. Adapter tier: reduced governance, tier-1 events (opaque remote, no tool visibility).
@nightowlsdev/engine-openai-agents
The third native engine, a governed @openai/agents run() loop with full governance (fail-closed tool gate, cost caps, secrets), native handoffs/guardrails. Single-agent v1 (multi-agent handoffs planned v1.1).
@nightowlsdev/engine-trigger-chat
An adapter for ONE specific case: you already run a Trigger.dev `chat.agent` Session on your own account and want to front it as a Night Owls agent. It's an adapter (reduced governance, tier-2 events), and experimental (Trigger's `chat.agent` surface only just GA'd — verify it's reachable in your account first). For the usual durable + governed run, use `@nightowlsdev/runner-background` with a native engine instead — that's the first-class durable path.
@nightowlsdev/engine-eve
The Vercel Eve protocol adapter engine, renders a running Eve app's NDJSON session as a single Night Owls agent. Adapter tier: reduced governance, tier-2 events (tool calls + usage visible, no delegation); durable park/resume on Vercel Workflows.
UI
4 modules@nightowlsdev/react
Drop-in React + Tailwind chat UI for Night Owls swarms, plus a fully headless hooks layer that renders live run state.
@nightowlsdev/theme
Framework-agnostic design tokens and theme presets for the Night Owls chat/agent UI.
@nightowlsdev/ui
The shared app-chrome kit for Night Owls surfaces: full-page layout (Container/Section), site chrome (NavBar/Footer), primitives (Button/Card/Badge), and a light/dark ThemeProvider.
@nightowlsdev/graph-react
The React workbench for the knowledge-graph plane: search, a force-directed canvas, entity pages, the bi-temporal timeline, and the review queue, with no CSS build step and no d3.
Adapter/Tooling
6 modules@nightowlsdev/mcp
MastraConnect external MCP servers as Night Owls tools, approval-gated, output-fenced, and engine-wall-safe.
@nightowlsdev/connectors
Declare an external service's actions once, materialize them into approval-gated, output-fenced tools, plus event triggers and out-of-band human-in-the-loop over Slack/email.
@nightowlsdev/skills
Browse, import, and refresh external skills (skills.sh, GitHub, https) into storage-backed, versioned, grantable instruction-only skills, third-party guidance, safely fenced.
@nightowlsdev/integration-native
The fully-open DEFAULT IntegrationProvider backend, self-run OAuth, an authed auto-refreshing proxy, provider-direct webhooks, and a minimal poller, with credentials on your own infrastructure (no vendor catalog, no Nango).
@nightowlsdev/integration-composio
The Composio IntegrationProvider backend, the first catalog-owning connector backend: 1000+ apps' tools and triggers come from Composio, which also runs the tool and holds the credentials.
@nightowlsdev/mcp-server
Expose a Night Owls swarm AS an MCP server, ask-only `ask_<agent>` tools, no workflow execution.
Adapter/Model
6 modules@nightowlsdev/provider-anthropic
Anthropic Claude model provider for Night Owls swarms, backed by the native AI SDK.
@nightowlsdev/provider-openai
OpenAI model provider for Night Owls swarms, backed by the native AI SDK.
@nightowlsdev/provider-openrouter
Any model via OpenRouter for Night Owls swarms, using `provider/model` ids.
@nightowlsdev/provider-vercel-gateway
Any model via the Vercel AI Gateway for Night Owls swarms, one key, all providers.
@nightowlsdev/provider-ollama
Run Night Owls swarms on local models via Ollama, no API key, no per-token cost.
@nightowlsdev/provider-groq
Run Night Owls swarms on Groq's fast OpenAI-compatible inference, one API key.
Adapter/Storage
7 modules@nightowlsdev/storage-local
MastraA local LibSQL-backed Mastra snapshot store for the CLI bootstrap runtime, run a swarm on just a model key, before Supabase.
@nightowlsdev/storage-supabase
MastraA Supabase/Postgres-backed StorageAdapter for Night Owls, agents, runs, events, messages, a Realtime event bus, a versioned agent repo, and a durable Mastra store.
@nightowlsdev/knowledge
An optional pgvector document knowledge base, RAG over arbitrary documents (guides, brand voice, reference docs), plus a ready tenant-scoped `search_knowledge` tool.
@nightowlsdev/graph
A bi-temporal, provenance-anchored knowledge graph plane, push any source in and get resolved entities and relations that remember when a fact was true, when you believed it, and who told you.
@nightowlsdev/metrics
A dimensionless, org-scoped metric-series store, `(orgId, orgScope, metric, at, dims) → value` with calendar bucketing and a fully-pinned period-over-period `compare()`, the honest home for numbers that change over time.
@nightowlsdev/tasks
A separate, opt-in task-manager plane — an org- and scope-scoped board of human- and agent-assigned WORK — plus the guardrails to run an agent against a task unattended: a resume-safe cumulative cost ceiling, a single-winner start, and a prompt-injection fence.
@nightowlsdev/pipeline
A separate, opt-in pipeline plane — a data-driven, fan-out-capable structured-extraction DAG whose stages can be executed by a NAMED, GOVERNED swarm agent (cost cap + tool gate + rules + metering), not just a raw LLM prompt.
Runner
2 modules@nightowlsdev/runner-background
The durable runner for Night Owls, runs a swarm turn in Trigger.dev v4 or Vercel Workflow so an ask-suspended run can park for days and resume across process death.
@nightowlsdev/runner-nextjs
The interactive runner for Night Owls, Next.js App Router routes that authenticate server-side and stream a swarm run to the browser as an AI SDK v7 UI Message Stream.
Telemetry
3 modules@nightowlsdev/telemetry-core
Shared SwarmSpan-to-OpenTelemetry replay engine that the OTLP and Langfuse telemetry adapters are built on.
@nightowlsdev/telemetry-langfuse
Langfuse v5 (OTel-native) telemetry exporter for @nightowlsdev/core swarm runs.
@nightowlsdev/telemetry-otel
OTLP/HTTP telemetry exporter for @nightowlsdev/core that ships swarm traces to any OpenTelemetry-compatible backend.
Auth
4 modules@nightowlsdev/auth-supabase
Stateless Supabase AuthProvider that maps an already-verified Supabase session into a Night Owls AuthContext.
@nightowlsdev/auth-auth0
Stateless, offline-capable Auth0 AuthProvider that verifies access tokens against Auth0's public JWKS.
@nightowlsdev/auth-jwt
Dependency-free JWT primitives (HS256 sign/verify + ES256/RS256 JWKS verify) and signed-session helpers, on node:crypto only.
@nightowlsdev/auth-sessions
A small, pg-backed revocable session store, logout, log-out-everywhere, and admin kill without shortening JWT TTLs.
Quality
2 modules@nightowlsdev/eval
The scoring plane, run an agent over a fixture dataset, score each run's event trajectory, aggregate into a per-version EvalReport.
@nightowlsdev/gepa
A reflective, metric-gated prompt optimizer, reflect on eval feedback to propose better persona fields, keep the best.
Pre-built agents
8 modules@nightowlsdev/agent-kit
The shared foundation for the pre-built agent family: curated skills.sh manifests + governed batch import, fail-loud tool contracts, progressive-disclosure skill-library tools, and persisted-store lifecycle helpers.
@nightowlsdev/agent-builder
The meta-agent that knows the nightowls agent anatomy end to end: researches external skills, drafts + validates agents/bundles, and, behind a rule-enforced human-approval floor, imports skills and publishes definitions.
@nightowlsdev/agent-researcher
Deep research with a fail-loud tool contract: plans sub-questions with stop criteria, searches broad-then-narrow, triages sources primary-first, gap-checks, and delivers a cited synthesis.
@nightowlsdev/agent-marketer
Product-in-market analysis, positioning + ICP, evidence-based competitor profiling, channels as prioritized bets, that asks for what it lacks instead of inventing it.
@nightowlsdev/agent-designer
Design directions you choose from: proposes 2-3 named approaches via the ask tool, then applies the chosen one from an 18-skill curated design library read on demand, impeccable, ui-ux-pro-max, the taste-skill family.
@nightowlsdev/agent-writer
Content + copy craft, tool-less by design: brief-first, on-voice, channel-native, and fabrication-free (a missing fact becomes a [placeholder: …] the human fills, never a plausible invention).
@nightowlsdev/agent-seo
The pre-built SEO crew: a read-only, fail-closed `seo-analyst` and a competitor/SERP `seo-researcher` over the Google Search Console + GA4 connectors, with measurement honesty encoded, not just documented.
@nightowlsdev/agent-diagnostics
The pre-built diagnostics crew: a read-only run `inspector` and an approval-gated `bug-reporter`, so a stalled lane and a vague apology become which call failed, whether it recovered, and a report a developer can act on.