# Production agent in TypeScript

> Build an agent with tools, memory and workflows you can deploy.

- Category: Build agents · Difficulty: Advanced
- Estimated monthly cost: $0–$29/mo. Mastra is open source. Model usage is pay-per-token. Langfuse Hobby free, Core $29.
- Model: GPT-6.1 Sol or Claude Sonnet 5.5 ($2 in / $10 out per 1M tokens)
- MCP servers: none
- Last checked: 2026-10-21 · Hands-on tested: no (built from official docs)
- Canonical: https://getagentloadout.com/loadouts/ts-production-agent/ · JSON: https://getagentloadout.com/data/loadouts/ts-production-agent.json

## Tools
- [Mastra](https://mastra.ai): TypeScript framework for agents, typed workflows, memory and evals. Pricing: Open source $0/mo (Framework is free; pay for models). Source: https://dbggr.dev/articles/agent-frameworks-compared/
- [Langfuse](https://langfuse.com): Open-source tracing, evals and prompt management for LLM apps and agents. Pricing: Hobby $0/mo (50k units/month, 2 users); Core $29/mo (100k units/month, unlimited users); Pro $199/mo (Unlimited history, high rate limits; extra units $8 per 100k). Source: https://langfuse.com/pricing
- [Claude Code](https://claude.com/product/claude-code): Anthropic's agentic coding tool for the terminal and IDEs. Included in paid Claude plans. Pricing: Pro $20/mo ($17/mo billed yearly; 5-hour and weekly usage limits); Max 5x $100/mo (5x Pro usage per session); Max 20x $200/mo (20x Pro usage per session). Source: https://claude.com/pricing

## Starter prompt

```
Using Mastra, implement the agent in agent-plan.md with typed tools, a workflow with a human-approval step before any write action, and Langfuse tracing. Add the eval cases and a CI script.
```

## Config (agent-plan.md)

```markdown
Agent: <name>
Tools: <3-5 tools>
Memory: per-user thread
Workflow: plan -> act -> verify -> report
Evals: 25 cases in evals/
```

## Setup steps
1. Write the plan.
2. Build tools first, then the workflow.
3. Add evals before adding features.

## Why this works
One TypeScript stack for agents, workflows and evals.

## Watch out
Pick LangGraph instead if your team is Python-first.

## Related loadouts
- [Build your own MCP server](https://getagentloadout.com/loadouts/build-mcp-server/)
- [Discord bot in an afternoon](https://getagentloadout.com/loadouts/discord-bot/)
- [Personal research agent](https://getagentloadout.com/loadouts/research-agent/)

Some links may be affiliate links; it never affects rankings. Rankings are never for sale.
