Skip to content
Mayura
New1.0.0-rc.1: the 1.0 release candidate

Build AI agents you can put in production

Mayura is the TypeScript framework for agents, typed tools and durable workflows, with permissions, budgets and validation enforced by the runtime.

Any model

  • OpenAI
  • Anthropic
  • Gemini
  • Mistral
  • DeepSeek
  • xAI
  • Groq
  • OpenRouter
  • Together AI
  • Azure OpenAI
  • Ollama

Runs and stores on

  • Node.js
  • TypeScript
  • Docker
  • Kubernetes
  • AWS
  • Google Cloud
  • Vercel
  • Render
  • Railway
  • Heroku
  • PostgreSQL
  • SQLite
  • MCP
  • React

Agents. Tools. Workflows. Everything you need to ship, running under rules you set.

agent.ts
ts
import { defineAgent, defineTool, z } from 'mayura';
import { openAIResponses } from 'mayura/provider-openai';

const getWeather = defineTool({
  id: 'weather.get', version: '1',
  description: 'Current weather for a city.',
  input: z.object({ city: z.string() }),
  output: z.object({ celsius: z.number() }),
  effects: 'read', capabilities: [],
  execute: ({ city }) => weather.current(city),
});

export const agent = defineAgent({
  id: 'weather-assistant', version: '1',
  instructions: 'Answer questions about the weather.',
  tools: [getWeather],
  input: z.object({ question: z.string() }),
  output: z.object({ reply: z.string() }),
  model: openAIResponses({ apiKey, model: 'gpt-5-mini',
    pricing, maxCostMicros: 20_000 }),
});
Runsucceeded
  1. input
    { "question": "Do I need an umbrella?" }
    matches input schema
  2. model
    calls weather.get { "city": "Paris" }
    openai.responses · $0.0009
  3. tool
    weather.get → { "celsius": 21 }
    effect: read · granted
  4. output
    { "reply": "No umbrella needed." }
    matches output schema
Typed agents and tools

Instructions, a model and tools, with schemas for what goes in and what comes out. Read the guide

Previews are illustrations of what happens during a run.

Get started in seconds with a project that already works.

Each starter is complete, with tests, a worker and deployment files. Your API key goes into.envand nowhere else.

  1. 1
    npx mayura init
    Pick a starter and a model provider.
  2. 2
    npm run dev
    Build, run and restart on every save.
  3. 3
    mayura serve
    Serve it; mayura worker runs workflows.
  • Support assistant
    Streamed chat that acts only for the signed-in customer.
  • Approval workflow
    Refunds that wait for a person to approve the payment.
  • Research team
    Planner, parallel researchers and a writer, on one budget.
  • Event automation
    Signed webhooks start workflows that act through MCP.
  • Command-line assistant
    Chat in your terminal; you confirm every write.

Frequently asked questions

What is Mayura?

A TypeScript framework for AI agents, typed tools and durable workflows. You describe an agent with schemas, give it tools and a model, and run it under an allow-list of permissions and limits. It is one npm package, mayura, with a CLI of the same name.

Do I need to install anything else?

No. npm install mayura is enough to build agents: schemas use z from mayura (it is Zod). Optional parts such as SQLite or PostgreSQL storage, the QuickJS sandbox and React hooks each need one extra package, only if you use them.

Which models can I use?

OpenAI and Anthropic natively, and any OpenAI-compatible provider, such as Groq, Gemini, Mistral, DeepSeek, xAI, OpenRouter, Together, Fireworks, Azure OpenAI and local servers. A router fails over between them.

How does Mayura keep agents in bounds?

A run can use a model, tool or effect only when you grant it, every run has cost, step, tool-call and time limits, and every input and output is validated. When a side effect may or may not have happened, the run ends outcome_unknown instead of retrying blindly.

Can I test without an API key?

Yes. Scripted models from mayura/testing replay fixed responses, so agents, tools and workflows run offline in your tests.

Where can I deploy Mayura?

Anywhere Node.js 22 or 24 runs: containers, Kubernetes, managed platforms such as Cloud Run, ECS and Fly.io, your own servers, inside an app you already run, and serverless functions on Vercel, with AWS Lambda and Cloud Run functions experimental. Edge runtimes are planned for 1.1. See Deployment.

Is Mayura ready for production?

Mayura is at the 1.0 release candidate. From 1.0.0, every entry point is stable under semantic versioning; until then, pin the exact version and try it in a pilot first. See Versioning and stability.

Is Mayura open source?

Yes, under the Apache-2.0 license, on GitHub.

Start building with Mayura today

Get started
Open source under Apache-2.0