Agentoria

Introduction

Provider-neutral AI-agent infrastructure — runtime, telemetry, and headless React UI, in one typed, streaming library.

Agentoria is the shared AI-agent infrastructure behind real apps, extracted into one layered, typed, streaming library. Bring a model provider; get a streaming agent loop, typed tools, telemetry and cost tracking, MCP, and a headless React client — with no framework lock-in.

Why

Most agent apps reinvent the same pieces: an SSE stream, an agent loop emitting a typed event union, schema-validated tools, cost accounting, and an admin dashboard. Agentoria is those pieces, factored so you depend on exactly what you need — or grab the umbrella agentoria and import from one place.

  • Provider-neutral — one LlmClient port. Anthropic, OpenAI, DeepSeek, Groq, Ollama, or any OpenAI-compatible endpoint.
  • Streaming by default — every turn is a typed AgentEvent union over SSE; the same type flows to the browser.
  • Typed tools + MCP — any Standard Schema validator (Zod, Valibot, ArkType); expose or consume MCP.
  • Telemetry & cost — tokens, cost, latency distribution, per-tool outcomes, with a drop-in MetricsDashboard.
  • Headless React + UIuseAgentChat for control, or <ChatPanel/> when you just want it to work.

The layers

Each package depends only downward, so you can adopt one slice at a time.

LayerPackageRole
L-1@agentoria/usageProvider-neutral token accounting + cost. Zero deps.
L0@agentoria/coreContracts: AgentEvent, messages, tool defs, SSE codec.
L1@agentoria/runtimeProviders, the bounded agent loop, tool registry, resilience.
L2@agentoria/telemetryStores + pure stats (llmCallStats, toolCallStats).
L4@agentoria/mcpMCP client + server over a tool registry.
L3a@agentoria/reactHeadless hooks (useAgentChat, useToolCalls).
L3b@agentoria/uiChatPanel, MetricsDashboard, generative-UI widgets.
@agentoria/nodeServe a Fetch handler from Node http / Express.
agentoriaUmbrella — re-exports the server layer, /react, /ui.

On this page