# Monorch > Agents, tools, graphs, and workflows as a TypeScript library with a Rust execution engine. Bring your own HTTP server — Fastify, Hono, Nest, or anything else. Logo: https://monorch.vercel.app/logo.svg Monorch is a TypeScript AI control-plane library (`@monorch/ai`) backed by a Rust execution engine (`@monorch/runtime`). It is not a framework, HTTP stack, ORM, Studio, or RAG product. Bring your own HTTP server (Fastify, Hono, Nest, or anything else). ## Product lock - Provide: model/tool/agent/graph/workflow, MCP bridge, memory interfaces, OTel via AiEvent, OpenAI-compatible providers - Do not provide: HTTP framework, auth/ORM/queues, React chat UI, RAG product, Studio ## Product pages - [Compare](https://monorch.vercel.app/compare): Monorch vs Mastra, LangGraph, and DIY agent loops. Library positioning and product lock. - [Changelog](https://monorch.vercel.app/changelog): Release notes for @monorch/ai and @monorch/runtime. - [Architecture](https://monorch.vercel.app/architecture): How @monorch/ai, @monorch/runtime, and the Rust engine split responsibilities across TypeScript and native code. - [Platforms](https://monorch.vercel.app/platforms): Node and native @monorch/runtime builds, supported platforms, and CI pointers. - [Security](https://monorch.vercel.app/security): MIT license, threat model (native load, MCP, Postgres), and how to report vulnerabilities. ## Docs - [Introduction](https://monorch.vercel.app/docs): What Monorch is: a TypeScript AI control-plane library with a Rust engine. Not a framework or HTTP stack. - [Getting started](https://monorch.vercel.app/docs/getting-started): Install @monorch/ai from npm or build from the monorepo, run smoke and smoke:npm, and copy the smallest agent and graph patterns into your HTTP handlers. - [Public API](https://monorch.vercel.app/docs/api): Supported @monorch/ai exports, SemVer policy, prefer graph() over workflow(), and intentional non-public surfaces. - [Upgrade guide](https://monorch.vercel.app/docs/upgrade): 0.x → 1.0 upgrade notes: checkpoints, structured output errors, MCP and Postgres trust boundaries. - [Release candidate](https://monorch.vercel.app/docs/rc): API freeze toward 1.0, RC checklist for platforms, smokes, docs, and security. - [Agents](https://monorch.vercel.app/docs/agents): Create agents with models, tools, handoffs, getAgent registry, thread memory, and AbortSignal cancellation. - [Tools](https://monorch.vercel.app/docs/tools): Define Zod-validated tools with permissions. Execution stays in TypeScript; authorization and schema live in Rust. - [Graphs](https://monorch.vercel.app/docs/graphs): Build branching graphs with agentNode, interrupts, cycles, checkpoints, idempotent drive, and compile({ replace }) hot-reload. - [Checkpoints](https://monorch.vercel.app/docs/checkpoints): Persist and restore graph runs with memorySaver or postgresCheckpointer; checkpoint blob v2 (version, defHash, input). - [Streaming](https://monorch.vercel.app/docs/streaming): Consume AiEvent streams from agent.stream and graph execution for SSE UIs, logs, and OpenTelemetry. - [Workflows](https://monorch.vercel.app/docs/workflows): Linear workflow sugar over graph(). Prefer graph() when you need branching or interrupts. - [Providers](https://monorch.vercel.app/docs/providers): OpenAI-compatible providers with SSE streaming, timeoutMs, AbortSignal, and model().generateObject validated in Rust. - [MCP](https://monorch.vercel.app/docs/mcp): Bridge Model Context Protocol servers (stdio / HTTP) into Monorch tools with mcpStdio, mcpHttp, and mcpTools. - [Memory](https://monorch.vercel.app/docs/memory): Thread memory and key-value stores: inMemory* helpers, postgresThreads / postgresStore, and agent.run({ threadId, memory }). - [Observability](https://monorch.vercel.app/docs/observability): Tap AiEvent streams with createOtelListener and tapEvents for OpenTelemetry and custom sinks. - [HTTP with Fastify](https://monorch.vercel.app/docs/recipes/fastify): BYO HTTP recipe using Fastify: agent SSE, interrupt + resume, and Postgres adapters. - [HTTP with Hono](https://monorch.vercel.app/docs/recipes/hono): Second BYO HTTP stack on Hono using published @monorch/ai from npm (stream + HITL). - [HITL refund](https://monorch.vercel.app/docs/recipes/hitl-refund): Interrupt + checkpoint resume across HTTP requests. - [Multi-agent handoff](https://monorch.vercel.app/docs/recipes/handoff): triage → billing with handoffs and handoff(). - [MCP stdio / HTTP](https://monorch.vercel.app/docs/recipes/mcp-stdio): mcpStdio / mcpHttp + mcpTools bridge for remote tools. - [LiteLLM proxy](https://monorch.vercel.app/docs/recipes/litellm): OpenAI-compatible baseUrl through LiteLLM or similar. - [Abort + timeouts](https://monorch.vercel.app/docs/recipes/abort): AbortSignal on agents and timeoutMs on providers. - [Structured output](https://monorch.vercel.app/docs/recipes/structured-output): Zod → IR → Rust validate via model().generateObject. - [Graph hot-reload](https://monorch.vercel.app/docs/recipes/hot-reload): compile({ replace }) and defHash safety for in-flight runs. - [@monorch/ai](https://monorch.vercel.app/docs/reference/ai): Package reference for @monorch/ai: constructors, helpers, types, statuses, and AiEvent keywords. - [@monorch/ai/openai](https://monorch.vercel.app/docs/reference/openai): Package reference for openai() and mock() providers: options, streaming, abort, and timeouts. - [@monorch/ai/postgres](https://monorch.vercel.app/docs/reference/postgres): Package reference for Postgres adapters: ensureMonorchSchema, checkpointer, threads, and store. - [@monorch/runtime](https://monorch.vercel.app/docs/reference/runtime): Package reference for the N-API Rust engine binding. Prefer @monorch/ai in application code. - [Error codes](https://monorch.vercel.app/docs/reference/errors): Failure modes and stable AiError codes — abort, tools, interrupt, def-hash. ## Packages - `@monorch/ai` — sole user-facing TypeScript API - `@monorch/runtime` — N-API bindings to the Rust engine (no business logic in JS) ## Optional - Full machine-readable overview: https://monorch.vercel.app/llms-full.txt - Sitemap: https://monorch.vercel.app/sitemap.xml