DOCUMENTATION / AGENT FRAMEWORK

Build the agent your product needs.

NAH gives you a model loop and explicit extension points. Choose the model, define the tools, set the run policy, and connect events and results to your application.

The shape of an agent

An agent is a model plus a system prompt, a set of tools, and a policy for how long it may run. runAgent coordinates the turn and returns both a live event stream and a final result. Your app owns authentication, tool implementations, user experience, and persistence choices.

tsnah
const run = runAgent({
  model,                 // AI SDK language model
  system,                // agent behavior and constraints
  prompt: userRequest,   // this task
  tools,                 // capabilities available to this run
  maxSteps: 24,          // optional run limit
});

for await (const event of run.events) render(event);
const result = await run.result;

Start with the SDK build guide, then use the focused references below to configure the parts your application needs.

START

Install NAH

Get the CLI running or install the runtime package in your app.

Read guide
GUIDE

Build an agent

Choose a model, configure tools, start a run, and handle its result.

Read guide
WEB RUNTIME

Embed it in a web app

Use nah-js with Next.js, React, Hono, Remix, SvelteKit, Astro, or Web APIs.

Read guide
HTTP API

Mount a server adapter

Expose registered agents, tools, and workflows through your existing HTTP server.

Read guide
CAPABILITIES

Configure tools

Define typed capabilities and decide which operations need approval.

Read guide
RUNTIME

Control a run

Set limits, steer a running task, cancel it, and persist its transcript.

Read guide
INTEGRATION

Stream to your UI

Render text and tool activity, track completion, and recover errors.

Read guide
PATTERNS

Delegation patterns

See how parent agents hand off bounded work and review child results.

Read guide
SDK GUIDE

Use Orchestrator

Configure child tools and isolation, run tasks, and review their artifacts.

Read guide
ORCHESTRATION

Make workflows

Turn known sequences into validated, reusable steps.

Read guide
SESSION STATE

Conversation state

Continue chats from transcript history and persist sessions safely.

Read guide
OPTIONAL MEMORY

Cognitive memory

Configure durable facts and retrieval across conversations.

Read guide

Choose the right extension point

Runtime and CLI

The core runtime owns the iteration loop, tool execution, typed event stream, stop conditions, and optional transcript compaction. You provide an AI SDK language model and decide how to present and persist the run. The CLI is an application built on that runtime: it adds terminal interaction, provider selection, permissions, and JSONL sessions.

Use the SDK when embedding an agent in a product or service. Use the CLI when you want an interactive coding agent in a repository.