Documentation
Mayura documentation
Every page of the Mayura documentation, in reading order.
Mayura is a TypeScript framework for building AI agents, typed tools and durable workflows. New here? Read the introduction, then follow the quickstart.
Get started
- Introduction: what Mayura is and how its parts fit together.
- Quickstart: create a project, or add a first agent to your own.
- Installation: requirements, optional packages and TypeScript settings.
- V1.2 release validation status: stable publication, all 106 trusted publishers, preserved prerelease tags and remaining limits.
- Choose a starter: pick a complete application, a framework notebook or a focused template.
- Using Mayura with AI coding agents: documentation your assistant can read offline.
Concepts
Agents: instructions, schemas, a model and tools.
Tools: typed functions with declared effects.
Runtime: running agents, events, cancellation and limits.
Outcomes: how a run ends, error codes, and what to do about each.
Permissions: the allow-list every run is checked against.
Costs and budgets: prices, cost caps and shared budgets.
Workflows: multi-step work, in memory or durable.
Retrieval augmented generation: scoped evidence, durable ingestion, vector stores and reranking.
RAG production qualification: the stable Modal and Pinecone profile and its verified limits.
Build and deploy a retrieval agent: from offline testing to a scoped hosted deployment.
Frameworks and starters
- Framework starters: shared notebook architecture, identity, persistence and workers.
- Next.js: App Router, React thread history and tool approvals.
- Hono: Fetch routing, Vite React and alternate runtime source.
- React Router: resource routes and owned React conversation controls.
- TanStack Start: server routes, a React notebook and a separate worker.
- SvelteKit: native Svelte controls and headless conversation stores.
- Nuxt: Nitro routing and native Vue conversation controls.
Agents and models
- Model providers: OpenAI, Anthropic and OpenAI-compatible providers.
- Model registry: models as provider/model from @mayurajs provider packages, with prices, retries and chains.
- AI gateways: explicit gateway credentials, scoped models, discovery and reported costs.
- Model routing: failover between providers.
- Streaming: show an answer while it is written.
- Vision: agents that see images and PDFs, from the input or from tools.
- Voice: transcribe speech and speak text, with prices and per-call bounds.
- Child agents: agents that delegate to other agents.
- Agent handoffs: transfer a conversation with a continuing budget and separate agent permissions.
- Skills:
SKILL.mdfolders an agent loads on demand. - MCP tools: call tools on an MCP server.
- Terminal chat and commands: run an agent in a terminal.
- Testing: test agents, tools and workflows offline.
Workflows
- Workflow composition: in-memory workflow graphs and workflows as tools.
- Durable workflows: steps that survive restarts.
- Approvals and human input: wait for people.
- Sagas and loops: compensation and repetition.
- Webhooks: start and signal workflows from signed webhooks.
- Operating workflows: pause, resume, cancel, versions and migrations.
Data, safety and extensions
- Storage: SQLite, PostgreSQL, libSQL (Turso), MySQL, MongoDB, D1 and DynamoDB.
- Threads: keep users' conversations and run each message with the conversation so far.
- Memory and context: what an agent remembers and sees.
- Fine-grained authorization: scoped resource access with the core policy contract and built-in RBAC.
- Guardrails: check, block or redact inputs and outputs.
- Lifecycle hooks: code that can stop a run at defined points.
- Artifacts: store files that runs produce.
- Files: files in S3, R2 and other object stores, with versions, tenant views and file tools.
- Sandboxes: isolated Linux machines for agents to run commands and handle files in, on Docker or a hosted provider.
- Browsers: real browsers for agents to read and use web pages in, on the Chrome or Edge installed here or a hosted service, kept to allowed origins.
- Code Mode: run model-written code in a sandbox.
- Helpers: configuration, secrets, retries and other utilities.
Serve, observe and deploy
- Server and client: serve agents and workflows over HTTP.
- AG-UI adapter: scoped run events, stored messages, state snapshots/deltas, permissioned durable frontend tools with native-owner recovery and approval interrupts with the experimental AG-UI 1.0 profile.
- Authentication and API keys: tokens from identity providers and API keys on your own storage, mapped to what callers may do.
- React: hooks, components and forms.
- Copy-in UI components: versioned source registry, safe CLI installation and component gallery.
- Observability: events, tracing and OpenTelemetry.
- Operator console: a UI for runs, workflows and approvals.
- Deployment: run Mayura in production.
CLI
- Overview: the
mayuracommand. - mayura init: starters and templates.
- mayura dev: develop with rebuild and restart.
- serve, worker and migrate: run an application.
- mayura deploy: deploy with Docker, Compose, Kubernetes or a platform package.
- Operator commands: manage a running server.
Integrations: vector stores
- Chroma: Scoped native vector storage for chroma.
- Libsql: Scoped native vector storage for libsql.
- Pgvector: Scoped native vector storage for pgvector.
- Pinecone: Scoped native vector storage for pinecone.
- Qdrant: Scoped native vector storage for qdrant.
- Weaviate: Scoped native vector storage for weaviate.
Integrations: rerankers
- Cohere: Bounded indexed-result reranking with cohere.
- Jina: Bounded indexed-result reranking with jina.
- Voyage: Bounded indexed-result reranking with voyage.
Integrations: ai gateways
- Cloudflare AI Gateway: Cloudflare AI Gateway models for Mayura, with explicit credentials, bounded calls and gateway cost accounting.
- Helicone: Helicone models for Mayura, with explicit credentials, bounded calls and gateway cost accounting.
- LiteLLM: LiteLLM models for Mayura, with explicit credentials, bounded calls and gateway cost accounting.
- OpenRouter: OpenRouter models for Mayura, with explicit credentials, bounded calls and gateway cost accounting.
- Portkey: Portkey models for Mayura, with explicit credentials, bounded calls and gateway cost accounting.
- Vercel AI Gateway: Vercel AI Gateway models for Mayura, with explicit credentials, bounded calls and gateway cost accounting.
Integrations: model providers
- Amazon Web Services: Amazon Bedrock models for Mayura, through the official AWS SDK and the Converse API.
- Anthropic: Anthropic Claude models for Mayura, through the official Anthropic SDK.
- Google: Google Gemini models for Mayura, through the official Google Gen AI SDK.
- Groq: Groq models for Mayura, through the official Groq SDK.
- Microsoft Azure: Azure OpenAI models for Mayura, through the official OpenAI SDK and Azure's v1 API.
- Mistral AI: Mistral models for Mayura, through the official Mistral SDK.
- Ollama: Ollama models for Mayura, local or in Ollama's cloud, through the official Ollama SDK.
- OpenAI: OpenAI models for Mayura, through the official OpenAI SDK.
Integrations: voice
- AssemblyAI: AssemblyAI speech-to-text for Mayura's voice registry, over AssemblyAI's HTTP API.
- Cartesia: Cartesia speech-to-text and text-to-speech for Mayura's voice registry, over Cartesia's HTTP API.
- Deepgram: Deepgram speech-to-text and text-to-speech for Mayura's voice registry, over Deepgram's HTTP API.
- ElevenLabs: ElevenLabs speech-to-text and text-to-speech for Mayura's voice registry, over ElevenLabs' HTTP API.
- Google Cloud: Google Cloud Speech-to-Text and Text-to-Speech for Mayura's voice registry, over Google's HTTP APIs.
- Microsoft Azure: Azure Speech transcription and text-to-speech for Mayura's voice registry, over Azure's HTTP APIs.
- OpenAI: OpenAI speech-to-text and text-to-speech for Mayura's voice registry, through the official OpenAI SDK.
Integrations: storage
- Amazon Web Services: Mayura storage on Amazon DynamoDB, as optimistic transactions through the official AWS SDK.
- Cloudflare: Mayura storage on Cloudflare D1, as optimistic transactions over a Worker's D1 binding.
- MongoDB: Mayura storage on MongoDB, through the official MongoDB driver.
- MySQL: Mayura storage on MySQL 8, through mysql2.
- Turso: Mayura storage on libSQL (Turso, sqld or a local file), through the official libSQL client.
Integrations: files
- Cloudflare: Cloudflare R2 through a Workers binding, for Mayura's file stores.
- Files SDK: Any Files SDK provider for Mayura's file stores.
- Google Cloud: Google Cloud Storage for Mayura's file stores, over the Cloud Storage JSON API.
- Google Drive: Google Drive for Mayura's file stores, over the Drive API v3.
- Mesa: Mesa (mesa.dev), a versioned filesystem for agents, for Mayura's file stores.
- Microsoft Azure: Azure Blob Storage for Mayura's file stores, over the Blob REST API.
- Turso: AgentFS (Turso's filesystem for agents) for Mayura's file stores.
- Vercel: Vercel Blob for Mayura's file stores, over the Blob API with fetch.
Integrations: observability
- Arize: Arize AX for Mayura's traces, with OpenInference attributes beside the GenAI ones.
- Better Stack: Better Stack for Mayura's traces, over a source's OpenTelemetry endpoint.
- Datadog: Datadog APM or LLM Observability for Mayura's traces, over Datadog's OTLP intake.
- Langfuse: Langfuse for Mayura's traces: agent runs, model calls and tool calls over Langfuse's OpenTelemetry endpoint.
- LangSmith: LangSmith for Mayura's traces, with LangSmith's run types, over LangSmith's OpenTelemetry endpoint.
- PostHog: PostHog LLM analytics for Mayura's traces, over PostHog's OpenTelemetry endpoint for AI events.
- Sentry: Sentry for Mayura's traces, with Sentry's gen_ai span ops, over Sentry's OTLP endpoint.
Integrations: sandboxes
- Apple: Apple container (macOS) sandboxes for mayura/sandbox, through the container command line.
- AWS: Amazon Bedrock AgentCore Code Interpreter sessions as sandboxes for mayura/sandbox.
- Cloudflare: Cloudflare Sandboxes for mayura/sandbox, through the sandbox bridge Worker.
- CodeSandbox: CodeSandbox (Together) sandboxes for mayura/sandbox, through the CodeSandbox SDK.
- Daytona: Daytona sandboxes for mayura/sandbox, over Daytona's REST and toolbox APIs.
- E2B: E2B sandboxes for mayura/sandbox, over E2B's HTTP APIs.
- E2B: E2B Desktop sandboxes for mayura/sandbox: a Linux desktop agents can see and use.
- Fly.io: Fly.io Machines as sandboxes for mayura/sandbox, over the Machines API.
- Modal: Modal Sandboxes for mayura/sandbox, through Modal's JavaScript SDK.
- Northflank: Northflank sandboxes for mayura/sandbox, through Northflank's JavaScript client.
- Railway: Railway Sandboxes for mayura/sandbox, through Railway's TypeScript SDK.
- Vercel: Vercel Sandbox for mayura/sandbox, over Vercel's REST API.
Integrations: browsers
- agent-browser: Vercel Labs' agent-browser CLI as tools on a mayura/browser browser.
- Anchor Browser: Anchor Browser browsers for mayura/browser, over its sessions API.
- Browser Use: Browser Use cloud browsers for mayura/browser, over its browsers API.
- Browserbase: Browserbase browsers for mayura/browser, over its sessions API.
- Browserless: Browserless browsers for mayura/browser, hosted or self-hosted.
- BrowserView: BrowserView browsers for mayura/browser, over its sessions API.
- Cloudflare: Cloudflare Browser Run browsers for mayura/browser, over its CDP endpoint.
- Cloudflare: Cloudflare Browser Run quick actions (markdown, links, scrape, screenshots, PDFs, JSON, crawls) as a client and as tools.
- Firecrawl: Firecrawl browsers for mayura/browser, and Firecrawl's scrape, map, search, crawl and extract as tools.
- Hyperbrowser: Hyperbrowser browsers for mayura/browser, over its sessions API.
- Kernel: Kernel browsers for mayura/browser, over its browsers API.
- Mayura: A live viewer for mayura/browser browsers: a screencast of the active tab, shared by link, optionally interactive.
- Stagehand: Stagehand's act, extract and observe as tools on a mayura/browser browser.
- Steel: Steel browsers for mayura/browser, over its sessions API.
Integrations: authorization policies
- Cedar: Scoped local Cedar authorization with pinned policies, trusted attributes and core audit integration.
- HTTP authorization: Bounded HTTP authorization policies with scoped fail-closed decisions and core audit integration.
- OpenFGA: Scoped OpenFGA authorization checks with pinned models, bounded transport and core audit integration.
- Oso: Scoped Oso Cloud authorization checks with bounded transport and shared core audit integration.
- Permit.io: Scoped Permit.io PDP checks with explicit environment credentials, bounded transport and core audit integration.
Integrations: sign-in providers
- Amazon Cognito: Amazon Cognito user pool tokens as Mayura server identities, verified with the pool's published keys.
- Auth0: Auth0 access tokens as Mayura server identities, verified with your tenant's published keys.
- Clerk: Clerk session tokens as Mayura server identities, verified with Clerk's published keys or its PEM key.
- Facebook: Facebook Login access tokens (checked with Facebook) and Limited Login tokens as Mayura server identities, and a preset for better-auth's Facebook sign-in.
- Firebase: Firebase Authentication ID tokens as Mayura server identities, verified with Google's published keys.
- Google: Google ID tokens as Mayura server identities, and a least-privilege preset for better-auth's Google sign-in.
- Microsoft Entra ID: Microsoft Entra ID access tokens for your API as Mayura server identities, single- or multi-tenant.
- Neon: Neon Auth (managed better-auth) JWTs as Mayura server identities, verified with your project's published keys.
- Okta: Okta access tokens as Mayura server identities, verified with your authorization server's published keys.
- Supabase: Supabase Auth access tokens as Mayura server identities, verified with your project's published keys.
- WorkOS: WorkOS AuthKit session tokens and Connect machine tokens as Mayura server identities, verified with WorkOS's published keys.
Integrations: api key services
- ReqKey: API keys issued by ReqKey as Mayura server identities, validated with ReqKey's API.
- Unkey: API keys issued by Unkey as Mayura server identities, verified with Unkey's API.
Integrations: deploy targets
- Amazon Bedrock AgentCore: Amazon Bedrock AgentCore Runtime as a mayura deploy target: an ARM64 image serving its HTTP contract, then the runtime update.
- Amazon ECS: Amazon ECS on Fargate as a mayura deploy target: task definitions, a checked migration task, then the services.
- AWS Lambda: AWS Lambda as a mayura deploy target: one container image, the migration function first, then the API and workflows functions.
- Azure Container Apps: Azure Container Apps as a mayura deploy target: a migration job run to success, then the server and worker apps.
- Cloudflare: Cloudflare as a mayura deploy target: the app in Containers, or the serverless module on Workers, with wrangler.
- DigitalOcean App Platform: DigitalOcean App Platform as a mayura deploy target: a pre-deploy migration, the server and a worker, released by image tag.
- Fly.io: Fly.io as a mayura deploy target: server and worker processes, the migration as the release command.
- Google Cloud Run: Google Cloud Run as a mayura deploy target: a migration job, then the server and an always-on worker as services.
- Railway: Railway as a mayura deploy target: server and worker services, each migrating before it goes live.
- Render: Render as a mayura deploy target: a Blueprint with a web service, a background worker and PostgreSQL.
- Vercel: Vercel Functions as a mayura deploy target: the API, cron-driven workflows, and storage migrated before each release.
Reference
- Entry points: every
mayura/...import. - Integration packages: every
@mayurajs/*package, by area.
Project
- What's new in 1.2.1: qualified RAG, configurable workflow limits and release history.
- Versioning and stability: what each release promises.
- Supported platforms: Node.js versions, operating systems and getting help.
- Security model: what Mayura protects against, and reporting vulnerabilities.
- Credits: the open-source projects and standards Mayura is built on.