Agentoria

Quickstart

From zero to a running, streaming agent app in one command.

Scaffold

npm create agentoria@latest my-app

Pick a template — next (a Next.js App Router app with a streaming route + <ChatPanel/>) or node (an http server + a zero-dependency web client) — then:

cd my-app
npm install
cp .env.example .env      # add your ANTHROPIC_API_KEY
npm run dev               # → http://localhost:3000

That's a full-stack streaming agent. Everything below is what the scaffold wires up.

Add to an existing project

Install just the layers you need:

npm i @agentoria/runtime @agentoria/react @agentoria/ui zod

Server — a Fetch handler

createAgentHandler returns a standard (Request) => Promise<Response>, so it is your route handler on any Fetch-native runtime (Next.js, Cloudflare Workers, Deno, Bun, Hono):

app/api/agent/route.ts
import { z } from 'zod';
import { createAgentHandler, createAnthropicProvider, defineTool } from '@agentoria/runtime';

const currentTime = defineTool({
  name: 'current_time',
  description: 'Get the current time (ISO 8601).',
  parameters: z.object({}),
  handler: () => new Date().toISOString(),
});

export const POST = createAgentHandler({
  provider: createAnthropicProvider({ apiKey: process.env.ANTHROPIC_API_KEY!, model: 'claude-sonnet-4-6' }),
  tools: [currentTime],
});

Client — one hook, one component

app/page.tsx
'use client';
import { ChatPanel } from '@agentoria/ui';

export default function Page() {
  return <ChatPanel endpoint="/api/agent" />;
}

The same AgentEvent type flows from the loop to the browser, so there's no glue between them. Want full control instead of the component? Use the useAgentChat hook.

Not on a Fetch runtime?

On a raw Node http server or Express, wrap the handler with @agentoria/node's toNodeHandler.

On this page