Agents SDK
Documentation for @maniac-ai/agents — the TypeScript agents SDK that powers Maniac.
Overview
@maniac-ai/agents is the TypeScript agents SDK behind Maniac. It provides a composable runtime for building agents with tools, memory, permissions, streaming, and observability — all from ESM-first TypeScript.
The SDK mirrors the Python Maniac agents contracts while using TypeScript-native ergonomics for tools, model adapters, and middleware. Use it from Node.js 22.5+, from TypeScript with "module": "esnext" or "nodenext", or embed it in Electron like the Maniac desktop app.
npm install @maniac-ai/agentsimport { OpenAICompatibleModel, runAgent } from "@maniac-ai/agents";
const model = new OpenAICompatibleModel({ slug: "gpt-4o-mini" });
const result = await runAgent(
{ id: "assistant", instructions: "Be concise.", model },
"Summarize the release checks.",
);What you can build
- Agents —
runAgentfor one-off turns or aManiacapp for threads, budgets, and structured output. - Tools — define tools with
tool(), bundle them in toolsets, connect MCP servers, or delegate to sub-agents. - Inference — plug in
OpenAICompatibleModel,AnthropicModel,OpenRouterModel, streaming, retries, and fallbacks. - Memory — SQLite, vector, and observational/working-memory stores for durable conversations.
- Permissions — human-in-the-loop checkpoints and session-scoped permission caches.
- Orchestration — background tasks, spawn tools, and concurrency controls for multi-agent workflows.
- Integrations — ACP server, Slack/webhook channels, and a Python-backed REPL sandbox.
Browse the sections in the sidebar to get started, or jump to the API reference for generated type documentation.