MIT · TypeScript · streaming

Build AI agents
that ship.

Provider-neutral runtime, telemetry, and headless React UI — the shared agent infrastructure behind real apps, in one typed, streaming library.

$ npm create agentoria my-app

A chat UI in one component

The real <ChatPanel/>— streaming, markdown, tool traces, generative UI. Here it's driven by a scripted reply; in your app it POSTs to your agent route. Type to try it.

<ChatPanel /> · live, no backend
What can Agentoria do?

I'm a streaming agent runtime. I call typed tools, stream every turn as an AgentEvent, track cost + telemetry, and render generative UI — all provider-neutral. Try asking me about tools or streaming.

Observability, built in

Every call is logged — tokens, cost, latency p50/p95/p99, per-tool outcomes, error drill-down. Drop in <MetricsDashboard/> and get this admin view straight from your telemetry store.

Admin · LLM metrics · example data
Calls157
Success93%
Cost$5.4573
Tokens575,226
p952536ms
p95 TTFT775ms
ok · 103max_turns · 33error · 28unknown_tool · 28invalid · 28
ModelCallsCostTokens
claude-opus-4-857$1.9486211,064
gpt-4o53$1.7857193,676
claude-sonnet-4-647$1.7230170,486
OperationCallsErrorsCostavg
embed606$1.86661655.85ms
chat533$2.01541491.85ms
recipe_run442$1.57531461.55ms
Error typeCount
timeout5
overloaded_error3
rate_limit_error3
ToolCallsSuccessavgp50p95p99max
fetch_url6352%993.76ms869ms1674ms1816ms1819ms
run_sql5941%816.12ms771ms1675ms1724ms1735ms
search_web5848%890.66ms977ms1695ms1807ms1819ms
publish4045%1019.18ms1002ms1648ms1740ms1816ms

Everything an agent app needs

No framework lock-in, no glue code between server and client — just typed pieces that compose.

🔌

Provider-neutral

One LlmClient port. Anthropic, OpenAI, DeepSeek, Groq, Ollama — or any OpenAI-compatible endpoint. Swap in a line; fall back automatically.

Streaming by default

Every turn is a typed AgentEvent union over SSE — text, tool calls, results, usage. The same type flows to the browser, so the client is glue-free.

🛠️

Typed tools + MCP

Tools from any Standard Schema validator (Zod, Valibot, ArkType) with validation, middleware, and arg-repair. Expose or consume MCP endpoints.

📊

Telemetry & cost

Token accounting, cost, latency p50/p95/p99, per-tool metrics and error drill-down — with a drop-in admin dashboard and SQL-portable aggregation.

🎨

Generative UI

Stream cards, forms, and charts as first-class typed events; render them as your own React components and round-trip user actions back to the agent.

🧩

Headless React + UI

useAgentChat / useToolCalls hooks for full control, or the styled ChatPanel and MetricsDashboard when you just want it to work. Your call.

End to end in ~10 lines

A streaming agent on the server, a live chat on the client — the same AgentEvent type across the wire.

server
// app/api/agent/route.ts — a plain Fetch handler
import { createAgentHandler, createAnthropicProvider } from '@agentoria/runtime';

export const POST = createAgentHandler({
  provider: createAnthropicProvider({
    apiKey: process.env.ANTHROPIC_API_KEY!,
    model: 'claude-sonnet-4-6',
  }),
  tools,
});
client
// app/page.tsx — one hook, one component
'use client';
import { ChatPanel } from '@agentoria/ui';

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

A layer for each concern

Depend on exactly what you need — or grab the umbrella agentoria and import from one place.

@agentoria/usagetoken accounting + cost
@agentoria/corecontracts · events · SSE
@agentoria/runtimeproviders · agent loop · tools
@agentoria/telemetrystats · stores · SQL
@agentoria/mcpMCP client + server
@agentoria/reactheadless hooks
@agentoria/uiChatPanel · dashboard
@agentoria/nodehttp / Express adapter