Build TypeScript agents that ask before they act.
Give your Next.js app an agent workspace where people can inspect a source, review exactly what will change, and approve a write. Mayura runs typed tools and durable workflows behind it.
What’s new in v1.4.1Release workspace
Plan your rollout
Add a workspace to your app.
Run the Next.js starter
Review a note before saving it, then reopen your saved thread. The starter runs with a scripted agent.
Follow the walkthroughCopy the source
Add the workspace through shadcn. Edit the React components and Tailwind classes in your app.
Install with shadcnInstall the React package
Use the workspace or individual components from @mayurajs/ui with your own AG-UI backend.
Install from npm
Agents. Tools. Workflows. Everything you need to ship, running under rules you set.
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',
// Your prices, and a cap on every model call.
pricing: { inputMicrosPerMillionTokens: 250_000,
outputMicrosPerMillionTokens: 2_000_000 },
maxCostMicros: 20_000,
}),
});- input{ "question": "Do I need an umbrella?" }matches input schema
- modelcalls weather.get { "city": "Paris" }openai.responses · gpt-5-mini · $0.0009
- toolweather.get → { "celsius": 21 }effect: read · granted
- output{ "reply": "No umbrella needed." }matches output schema
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.
Ground your agents in sources they can access.
Mayura gives agents scoped retrieval tools that return evidence with exact citation identities. The registered Modal and Pinecone profile for the Loki software operations workload is qualified for production. Other RAG profiles remain experimental.
- source-reviewed Loki cases
- 40
- acquisition and ranking p95 upper bound
- 4.725 s
- timed Pinecone queries completed
- 600 / 600
Works with what you already use. 106 optional integration packages.
Gateways and policies
Sandboxes and browsers
What’s in Mayura?
Everything an agent needs in production.
Any model, with failover
Models as provider/model, with dated prices, retries and fallback chains across eight provider packages and any OpenAI-compatible API.
Cost control
Prices, per-call caps and shared budgets, from the tokens providers report.
Streaming
Show an answer as it is written, with guards on every batch.
Vision
Agents that see images and PDFs, checked by their own bytes.
Memory and context
Native memory with keyword, semantic and hybrid search.
Observability
OpenTelemetry traces with GenAI attributes, for Langfuse, Datadog, Sentry and more.
Also: MCP tools, Code Mode, guardrails, child agents, React, seven databases and the operator console.
Six framework starters · No API key needed
Start in your framework.
A working notebook with persistent threads, exact note approvals and a separate indexing worker. Run the offline flow first, then connect your identity and models.
App Router routes, React chat and a Node worker.
Next.js
App Router routes, React chat and a Node worker.
Hono
Fetch routes with Vite React; additional Bun, Deno and Workers source.
React Router
Resource routes, React chat and a separate worker.
TanStack Start
Server routes with React and a durable indexing worker.
SvelteKit
Native Svelte controls over the headless conversation stores.
Nuxt
Nitro routes and native Vue conversation controls.
Get started in seconds with a project that already works.
Start with a tested application shape, then follow its setup and deployment guide. Your API key goes into.envand nowhere else.
- 1
npx mayura initPick a starter and a model provider. - 2
npm run devBuild, run and restart on every save. - 3
mayura serveServe it; mayura worker runs workflows.
- Support assistantStreamed chat that acts only for the signed-in customer.
support-agent - Approval workflowRefunds that wait for a person to approve the payment.
approval-workflow - Research teamPlanner, parallel researchers and a writer, on one budget.
research-team - Event automationSigned webhooks start workflows that act through MCP.
event-automation - Command-line assistantChat in your terminal; you confirm every write.
cli-agent
Learn by building. Guides, comparisons and research from the people who make Mayura.
Run your first agent approval in Next.js
Run Mayura’s local Next.js starter, review the exact note an agent wants to save, and recover a pending approval after reload. No model API key required.
November 26, 2026 · 2 min read
guideBuild an agent workspace with Mayura UI
Try Mayura 1.4 in Next.js, install editable React components with shadcn, and reconnect to a run without resubmitting it.
November 25, 2026 · 2 min read
guideDesign retrieval around evidence your application can authorize
Build a retrieval agent with scoped ingestion, pinned revisions, exact citation identities and the qualified Modal and Pinecone profile.
October 23, 2026 · 2 min read
What comes next
See what shipped and which integrations are still being qualified.
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. Other services, from more model providers and databases to hosted browsers and identity providers, come as @mayurajs/* packages.
What can Mayura connect to?
106 optional packages: providers, AI gateways, vector stores, rerankers, authorization policies, voice, databases, files, tracing, sandboxes, browsers, identity and deploy targets. Configure credentials explicitly and review each adapter’s permissions and limits in the integrations directory.
Which models can I use?
Through the model registry, OpenAI, Anthropic, Google Gemini, Amazon Bedrock, Azure OpenAI, Mistral, Groq and Ollama, each a provider package with a dated price catalog, named as provider/model. Any OpenAI-compatible API works too, such as DeepSeek, xAI, OpenRouter, Together, Fireworks and local servers. Retries and fallback chains move a call to the next model when one fails.
Can agents run code or use a browser?
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.
Can I use Mayura UI with another backend?
Yes. Use @mayurajs/ui in React 19 or copy the source with shadcn. Supply your own callbacks for individual components or connect the workspace to your own AG-UI transport. See the UI installation guide.
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 (AWS Lambda and Cloud Run functions experimental). It also runs on edge runtimes: Vercel Edge, Cloudflare Workers, Deno and Bun. mayura deploy ships to Docker, Kubernetes and eleven platforms through their own tools. See Deployment.
Can I use Mayura RAG in production?
Yes, within the tested scope of the qualified Modal and Pinecone Loki v28 profile. Mayura returns authorized evidence and citation identities. Evaluate retrieval, citations and answer grounding on your own corpus before making production claims for a different configuration.
Is Mayura ready for production?
Mayura 1.4.1 is published under latest. The documented stable APIs follow the versioning policy. AG-UI and other RAG profiles remain experimental. Read the release evidence and limitations.
Is Mayura open source?
Yes, under the Apache-2.0 license, on GitHub.



