返回首页
Motia
1 / 2
数字商品
有货
免费

Motia

The Unified Backend Framework That Eliminates Runtime Fragmentation

商品编号: GIS55094069

商品描述

在一个系统中集成 API、后台任务、排队、流处理、状态管理、工作流、AI 代理、可观测性、扩展性和部署。JavaScript、TypeScript、Python 等多种语言在单一核心原语中实现。

详细介绍

Motia Banner

Motia Vercel OSS Program

🔥 The Unified Backend Framework That Eliminates Runtime Fragmentation 🔥

APIs, background jobs, queueing, streaming, states, workflows, AI agents, observability, scaling, and deployment all in one system. JavaScript, TypeScript, Python, and more in a single core primitive

npm version license GitHub stars Twitter Follow Discord

💡 Motia Manifesto🚀 Quick Start📋 Defining Steps📚 Docs


🚀 Create your first Motia App

Get started in seconds:

npx motia@latest create

🎯 What is Motia?

Backend development today is fragmented.

APIs live in one framework, background jobs in another, queues and schedulers elsewhere, and now AI agents and streaming systems have their own runtimes. Add observability and state management on top, and you're stitching together half a dozen tools before writing your first feature.

Motia unifies all of these concerns around one core primitive: the Step.

Just as React made frontend development simple by introducing components, Motia redefines backend development with Steps - a single primitive that handles everything.

Every backend pattern, API endpoints, background jobs, queues, workflows, AI agents, streaming, observability, and state, is expressed with the same primitive.

To read more about this, check out our manifesto.


The Core Primitive: the Step

A Step is just a file with a config and a handler. Motia auto-discovers these files and connects them automatically.

Here's a simple example of two Steps working together: an API Step that emits an event, and an Event Step that processes it.

TypeScript
// steps/send-message.step.ts
export const config = {
  name: 'SendMessage',
  type: 'api',
  path: '/messages',
  method: 'POST',
  emits: ['message.sent']
};

export const handler = async (req, { emit }) => {
  await emit({
    topic: 'message.sent',
    data: { text: req.body.text }
  });
  return { status: 200, body: { ok: true } };
};
// steps/process-message.step.ts
export const config = {
  name: 'ProcessMessage',
  type: 'event',
  subscribes: ['message.sent']
};

export const handler = async (input, { logger }) => {
  logger.info('Processing message', input);
};
Python
# send_message_step.py
config = {
    "name": "SendMessage",
    "type": "api",
    "path": "/messages",
    "method": "POST",
    "emits": ["message.sent"]
}

async def handler(req, context):
    await context.emit({
        "topic": "message.sent",
        "data": {"text": req.body["text"]}
    })
    return {"status": 200, "body": {"ok": True}}
# process_message_step.py
config = {
    "name": "ProcessMessage",
    "type": "event",
    "subscribes": ["message.sent"]
}

async def handler(input, context):
    context.logger.info("Processing message", input)
JavaScript
// steps/send-message.step.js
const config = {
  name: 'SendMessage',
  type: 'api',
  path: '/messages',
  method: 'POST',
  emits: ['message.sent']
};

const handler = async (req, { emit }) => {
  await emit({
    topic: 'message.sent',
    data: { text: req.body.text }
  });
  return { status: 200, body: { ok: true } };
};

module.exports = { config, handler };
// steps/process-message.step.js
const config = {
  name: 'ProcessMessage',
  type: 'event',
  subscribes: ['message.sent']
};

const handler = async (input, { logger }) => {
  logger.info('Processing message', input);
};

module.exports = { config, handler };

👉 With just two files, you've built an API endpoint, a queue, and a worker. No extra frameworks required.

Learn more about Steps →

Motia combines APIs, background queues, and AI agents into one system

💻 Remix your own Motia App in Replit

Open in Replit

🚀 Quickstart

Get Motia project up and running in under 60 seconds:

1. Bootstrap a New Motia Project

npx motia@latest create   # runs the interactive terminal

Follow the prompts to pick a template, project name, and language. motia-terminal

2. Start the Workbench

Inside your new project folder, launch the dev server:

npx motia dev # ➜ http://localhost:3000

That's it! You have:

  • ✅ REST APIs with validation
  • ✅ Visual debugger & tracing
  • ✅ Multi-language support
  • ✅ Event-driven architecture
  • ✅ Zero configuration
  • ✅ AI development guides included (Cursor, OpenCode, Codex, and more)

new-workbench

📖 Full tutorial in our docs →

🤖 AI-Assisted Development

Every Motia project includes detailed AI development guides that work with any AI coding tool:

The guides include patterns for API endpoints, background tasks, state management, real-time streaming, and complete architecture blueprints.

🤖 Learn more about AI development support →

🎯 Triggers

TypeWhen it runsUse Case
apiHTTP RequestREST endpoints
eventTopic subscriptionBackground processing
cronScheduleRecurring jobs

📖 Learn more about Steps →


🔌 Plugins & Adapters

Extend Motia with plugins and customize infrastructure with adapters.

Official Plugins

Pre-installed with every Motia project to enhance your workbench:

PluginDescriptionNPM
@motiadev/plugin-logsReal-time log viewer with filtering and searchnpm
@motiadev/plugin-endpointInteractive API endpoint testing toolnpm
@motiadev/plugin-observabilityPerformance tracing and distributed monitoringnpm
@motiadev/plugin-statesState management and inspection toolnpm
@motiadev/plugin-bullmqBullMQ queue and DLQ managementnpm

View all community plugins →

Official Adapters

Customize your infrastructure with production-ready adapters:

AdapterPurposeNPM
@motiadev/adapter-bullmq-eventsBullMQ-based event processingnpm
@motiadev/adapter-rabbitmq-eventsRabbitMQ event adapternpm
@motiadev/adapter-redis-cronRedis-based cron schedulingnpm
@motiadev/adapter-redis-stateRedis state managementnpm
@motiadev/adapter-redis-streamsRedis Streams for real-time datanpm

Create Your Own


🎯 Examples

🏆 ChessArena.ai - Full-Featured Production App

A complete chess platform benchmarking LLM performance with real-time evaluation.

Live Website → | Source Code →

ChessArena.ai in action (raw GIF)

Built from scratch to production deployment, featuring:

  • 🔐 Authentication & user management
  • 🤖 Multi-agent LLM evaluation (OpenAI, Claude, Gemini, Grok)
  • 🐍 Python engine integration (Stockfish chess evaluation)
  • 📊 Real-time streaming with live move updates and scoring
  • 🎨 Modern React UI with interactive chess boards
  • 🔄 Event-driven workflows connecting TypeScript APIs to Python processors
  • 📈 Live leaderboards with move-by-move quality scoring
  • 🚀 Production deployment on Motia Cloud

📚 More Examples

View all 20+ examples →

ExampleDescription
AI Research AgentWeb research with iterative analysis
Streaming ChatbotReal-time AI responses
Gmail AutomationSmart email processing
GitHub PR ManagerAutomated PR workflows
Finance AgentReal-time market analysis

Features demonstrated: Multi-language workflows • Real-time streaming • AI integration • Production deployment


🌐 Language Support

LanguageStatus
JavaScript✅ Stable
TypeScript✅ Stable
Python✅ Stable
Ruby🚧 Beta
Go🔄 Soon

📚 Resources

🚧 Roadmap

We have a public roadmap for Motia, you can view it here.

Feel free to add comments to the issues, or create a new issue if you have a feature request.

FeatureStatusLinkDescription
Python Types🚧 In Progress#485Add support for Python types
Streams: RBAC✅ Shipped#495Add support for RBAC
Streams: Workbench UI🎨 Design Phase#497Add support for Workbench UI
Queue Strategies✅ Shipped#476Add support for Queue Strategies
Reactive Steps📅 Planned#477Add support for Reactive Steps
Point in time triggers📅 Planned#480Add support for Point in time triggers
Workbench plugins✅ Shipped#481Add support for Workbench plugins
Rewrite core in Rust🚧 In Progress#482Rewrite our Core in Rust
Decrease deployment time🚧 In Progress#483Decrease deployment time
Built-in database support📅 Planned#484Add support for built-in database

🤝 Contributing

We welcome contributions! Check our Contributing Guide to get started.


🚀 Get Started📖 Docs💬 Discord

Star History Chart

Star us if you find Motia useful!