AI prompts
base on Unified Backend Framework for APIs, Events, and AI Agents # Motia
<p align="center">
<img src="https://motia.dev/icon.png" alt="Motia Logo" width="200" />
</p>
<p align="center">
<strong>π₯ A Modern Unified Backend Framework for APIs, Events and Agents π₯</strong>
</p>
<p align="center">
<a href="https://www.npmjs.com/package/motia">
<img src="https://img.shields.io/npm/v/motia?style=flat&logo=npm&logoColor=white&color=CB3837&labelColor=000000" alt="npm version">
</a>
<a href="https://github.com/MotiaDev/motia/blob/main/LICENSE">
<img src="https://img.shields.io/badge/license-MIT-green?style=flat&logo=opensourceinitiative&logoColor=white&labelColor=000000" alt="license">
</a>
<a href="https://github.com/MotiaDev/motia">
<img src="https://img.shields.io/github/stars/MotiaDev/motia?style=flat&logo=github&logoColor=white&color=yellow&labelColor=000000" alt="GitHub stars">
</a>
<a href="https://twitter.com/motiadev" target="_blank">
<img src="https://img.shields.io/badge/Follow-@motiadev-1DA1F2?style=flat&logo=twitter&logoColor=white&labelColor=000000" alt="Twitter Follow">
</a>
<a href="https://discord.gg/EnfDRFYW" target="_blank">
<img src="https://img.shields.io/discord/1322278831184281721?style=flat&logo=discord&logoColor=white&color=5865F2&label=Discord&labelColor=000000" alt="Discord">
</a>
</p>
<p align="center">
<a href="https://www.motia.dev/manifesto">π‘ Motia Manifesto</a> β’
<a href="https://www.motia.dev/docs/getting-started/quick-start">π Quick Start</a> β’
<a href="https://www.motia.dev/docs/concepts/steps/defining-steps">π Defining Steps</a> β’
<a href="https://motia.dev/docs">π Docs</a>
</p>
---
## π― What is Motia?
Motia is a **modern backend framework** that unifies APIs, background jobs, events, and AI agents into a single cohesive system. Eliminate runtime complexity and build unified backends where **JavaScript, TypeScript, Python, etc**, work together in event-driven workflows, with built-in state management, observability, and one-click deployments.
Motia brings cohesion to the fragmented backend world with our core primitive: the **Step**. Think of Steps like React Components, but for backends.

### π§± The Step Philosophy
- **π― Single Purpose**: Each Step performs one task
- **π Language agnostic**: Each Step can be in a different language while being part of the same workflow
- **β‘ Versatile**: Steps can trigger APIs, background jobs, and AI Agents
- **ποΈ Observable**: Everything is observable by default
- **π Workflows**: Collections of connected steps that form complete processes
- **πͺ State Management**: Shared state across all steps with full traceability
---
## π§ The Problem
Backend teams juggle **fragmented runtimes** across APIs, background queues, and AI agents. This creates deployment complexity, debugging gaps, and cognitive overhead from context-switching between frameworks.
**This fragmentation demands a unified system.**
---
## β
The Unified System
Motia unifies your entire backend into a **unified state**. APIs, background jobs, and AI agents become interconnected Steps with shared state and integrated observability.
| **Before** | **After (Motia)** |
| --------------------------- | --------------------------------------- |
| Multiple deployment targets | **Single unified deployment** |
| Fragmented observability | **End-to-end tracing** |
| Language dependent | **JavaScript, TypeScript, Python, etc** |
| Context-switching overhead | **Single intuitive model** |
| Complex error handling | **Automatic retries & fault tolerance** |
---
## π§ Supported Step Types
| Type | Trigger | Use Case |
| ----------- | --------------------- | ------------------------------------- |
| **`api`** | HTTP Request | Expose REST endpoints |
| **`event`** | Emitted Topics | React to internal or external events |
| **`cron`** | Scheduled Time (cron) | Automate recurring jobs |
| **`noop`** | None | Placeholder for manual/external tasks |
---
## π Quickstart
Get up and running in **under 60 seconds**:
### 1. Create Your Project
```bash
npx motia@latest create -i
```
- Enter project details like template, project name, etc
### 2. Write Your First Step
Open `01-api.step.ts` and create a simple API endpoint:
```typescript
exports.config = {
type: 'api', // Step type: "api", "event", "cron", or "noop"
path: '/hello-world', // API endpoint path
method: 'GET', // HTTP method
name: 'HelloWorld', // Step identifier
emits: ['test-state'], // Events this step emits
flows: ['default'], // Flow this step belongs to
}
exports.handler = async () => {
return {
status: 200,
body: { message: 'Hello World from Motia!' },
}
}
```
### 3. Launch the Workbench
Start the visual development environment:
```bash
npm run dev
# Opens at http://localhost:3000
```
π **That's it!** You now have a fully functional Motia app with:
- β
API endpoint at `/hello-world`
- β
Visual debugger and flow inspector
- β
Built-in observability
- β
Hot reload for instant feedback
### 4. Explore the Workbench
From the Workbench, navigate to:
- **π Logs**: Structured logs for each step execution with inputs, outputs, and errors
- **πͺ States**: View internal state and data passed between steps using traceID
- **π Endpoints**: Test all your API endpoints directly from the UI
- **π Flows**: Visually inspect how your steps connect and what each step does
---
## π Examples
| [Finance Agent](https://github.com/MotiaDev/motia-examples/tree/main/examples/finance-agent) | [GitHub Agent](https://github.com/MotiaDev/motia-examples/tree/main/examples/github-integration-workflow) | [Gmail Manager](https://github.com/MotiaDev/motia-examples/tree/main/examples/gmail-workflow) |
| -------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| <br>Financial insights | <br>PR automation | <br>Email automation |
| [Trello Automation](https://github.com/MotiaDev/motia-examples/tree/main/examples/trello-flow) | [RAG Agent](https://github.com/MotiaDev/motia-examples/tree/main/examples/rag_example) | [AI Image Gen](https://github.com/MotiaDev/motia-examples/tree/main/examples/vision-example) |
| ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| <br>Task automation | <br>Knowledge retrieval | <br>Generate images |
---
## π Language Support
Write steps in your preferred language:
| Language | Status | Example |
| -------------- | ------------- | ----------------- |
| **JavaScript** | β
Stable | `handler.step.js` |
| **TypeScript** | β
Stable | `handler.step.ts` |
| **Python** | β
Stable | `handler.step.py` |
| **Ruby** | π Coming Soon | `handler.step.rb` |
| **Go** | π Coming Soon | `handler.step.go` |
| **Rust** | π Coming Soon | `handler.step.rs` |
---
### π¬ **Get Help**
- **π Questions**: Use our [Discord community](https://discord.gg/7rXsekMK)
- **π Bug Reports**: [GitHub Issues](https://github.com/MotiaDev/motia/issues)
- **π Documentation**: [Official Docs](https://motia.dev/docs)
- **π₯ Blog**: [Motia Blog](https://dev.to/motiadev)
### π€ **Contributing**
#### π Roadmap
We're building Motia in the open, and we'd love for you to be a part of the journey.
Check out our public roadmap to see whatβs planned, whatβs in progress, and whatβs recently shipped:
π [View our public Roadmap](https://github.com/orgs/MotiaDev/projects/2/views/2)
We welcome contributions! Whether it's:
- π Bug fixes and improvements
- β¨ New features and step types
- π Documentation and examples
- π Language support additions
- π¨ Workbench UI enhancements
Check out our [Contributing Guide](https://github.com/MotiaDev/motia/blob/main/CONTRIBUTING.md) to get started.
---
<div align="center">
**π Ready to unify your backend?**
[π **Get Started Now**](https://motia.dev) β’ [π **Read the Docs**](https://motia.dev/docs) β’ [π¬ **Join Discord**](https://discord.gg/7rXsekMK)
---
## Star History
[](https://www.star-history.com/#motiadev/motia&Date)
<sub>Built with β€οΈ by the Motia team β’ **Star us on GitHub if you find Motia useful!** β</sub>
</div>
", Assign "at most 3 tags" to the expected json: {"id":"14032","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"