Skip to content
/ motia Public

Multi-Language Backend Framework that unifies APIs, background jobs, workflows, and AI Agents into a single core primitive with built-in observability and state management.

License

Notifications You must be signed in to change notification settings

MotiaDev/motia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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


🎯 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.

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 β†’

🎯 Step Types

Type Trigger Use Case
api HTTP Request REST endpoints
event Topic subscription Background processing
cron Schedule Recurring jobs
noop Manual External processes

πŸ“– Learn more about Steps β†’


🎯 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 β†’

Example Description
AI Research Agent Web research with iterative analysis
Streaming Chatbot Real-time AI responses
Gmail Automation Smart email processing
GitHub PR Manager Automated PR workflows
Finance Agent Real-time market analysis

Features demonstrated: Multi-language workflows β€’ Real-time streaming β€’ AI integration β€’ Production deployment


🌐 Language Support

Language Status
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.

Feature Status Link Description
Python Types Planned #485 Add support for Python types
Streams: RBAC Planned #495 Add support for RBAC
Streams: Workbench UI Planned #497 Add support for Workbench UI
Queue Strategies Planned #476 Add support for Queue Strategies
Reactive Steps Planned #477 Add support for Reactive Steps
Point in time triggers Planned #480 Add support for Point in time triggers
Workbench plugins Planned #481 Add support for Workbench plugins
Rewrite our Core in either Go or Rust Planned #482 Rewrite our Core in either Go or Rust
Decrease deployment time Planned #483 Decrease deployment time
Built-in database support Planned #484 Add 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!

About

Multi-Language Backend Framework that unifies APIs, background jobs, workflows, and AI Agents into a single core primitive with built-in observability and state management.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published