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
LlmClientport. Anthropic, OpenAI, DeepSeek, Groq, Ollama, or any OpenAI-compatible endpoint. - Streaming by default — every turn is a typed
AgentEventunion 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 + UI —
useAgentChatfor 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.
| Layer | Package | Role |
|---|---|---|
| L-1 | @agentoria/usage | Provider-neutral token accounting + cost. Zero deps. |
| L0 | @agentoria/core | Contracts: AgentEvent, messages, tool defs, SSE codec. |
| L1 | @agentoria/runtime | Providers, the bounded agent loop, tool registry, resilience. |
| L2 | @agentoria/telemetry | Stores + pure stats (llmCallStats, toolCallStats). |
| L4 | @agentoria/mcp | MCP client + server over a tool registry. |
| L3a | @agentoria/react | Headless hooks (useAgentChat, useToolCalls). |
| L3b | @agentoria/ui | ChatPanel, MetricsDashboard, generative-UI widgets. |
| — | @agentoria/node | Serve a Fetch handler from Node http / Express. |
| — | agentoria | Umbrella — re-exports the server layer, /react, /ui. |