What's Factory?
Mastra Factory is a web application for working with coding agents. Connect your repository, bring issues into a work board, and guide a change through investigation, planning, implementation, and pull request review.
Start with one issue and keep control of the decisions at each phase. Review the proposed work and plan before deciding whether to merge the result.
Mastra Factory is a separate project from the code it changes. Create the Factory project in its own directory, outside the repository you want agents to work on. Factory clones that repository into an isolated sandbox for each session, then makes changes there and opens pull requests. It never edits your local checkout. Connecting an existing repository is the standard setup, and it doesn't need to be new or empty.
Choose your starting point
| Your task | Start here |
|---|---|
| Set up your first Factory | Get started |
| Turn an issue into a pull request | Create your first pull request |
| Join a Factory your team already runs | Models, then GitHub |
| Bring work from another service | Linear or Slack |
| Run Factory for a team | Deployment |
Understand the pieces
Use Factory from a web or mobile browser, or interact with agents through Slack. GitHub supplies repositories and issues, and Factory writes pull requests back to it. Linear can also bring issues into Factory.
Mastra Factory brings together the Factory Server, auth, sandboxes, and storage. The server provides the web UI and coordinates work. Mastra Factory works with your preferred model providers.
Choose the large language models (LLMs) for your coding agents through a model provider with an API key or a supported subscription.
Where Factory runs
Factory supports three setups:
- Fully on Mastra platform: Run the Factory Server, authentication, storage, and sandboxes on Mastra platform.
- Local server with platform resources: Run the Factory Server on your computer while Mastra platform provides authentication, storage, and sandboxes.
- Fully self-hosted: Run the server and configure your own authentication, storage, and sandbox providers without Mastra platform services.
You can configure authentication, storage, and sandboxes independently of where the server runs. New Factory projects use platform services by default. See Deployment for deployment options.
Understand Factory terms
| Term | Meaning |
|---|---|
| Factory project | The server configuration and dependencies for a Factory. Keep it in its own directory so its configuration and Git history stay independent of the target repository. |
| Target repository | The codebase you ask agents to change. |
| Platform project | The Platform resource used to manage the server's database and deployment environments. |
| Factory | A codebase and its settings, work, and sessions in the UI. |
| Intake | Incoming issues or pull requests that are available for work. |
| Work item | A card tracking an issue or another task through the Work board. |
| Review item | A separate card tracking review of a pull request. |
| Session | The agent conversation and workspace associated with a piece of work. |
Follow a change
Issues arrive in Intake, where you can start an investigation. The agent investigates the issue, requests your input when needed, then plans and implements the changes. It opens a pull request with its own Review card and session. Follow the review and inspect the changes. Then decide whether to merge the pull request.
The original Work item and the PR's Review item have separate completion rules. See Work items for the actions, automation settings, and external events that move cards.
Factory acts on its own for some steps and waits for a person on others. On its own, it syncs issues from connected sources, proposes investigations, and moves cards in response to source events. These steps always wait for a person:
- Starting a run on a card, unless Auto-start runs is on and the item is eligible.
- Accepting a non-bug task before it enters planning or building.
- Approving a plan before implementation continues, unless Auto-approve plans is on.
- Merging a pull request.
Watch progress on the Factory's Overview page, in each session's transcript, and in the Audit log.
Next steps
- Get started and investigate one GitHub issue.
- Continue to Create your first pull request after investigation.
- Troubleshoot setup when an expected result is missing.