.png?width=160)
Magma | Open Source Typescript Framework for Building AI Agents
Agents at the speed of import
FreeAIFrameworkOpen Source3,032 impressions#4 of its week
Magma is an open-source TypeScript framework for building AI agents with minimal boilerplate.
- for
- Developers building custom AI agents who want control and observability.
- pricing
- open source
- license
- open source
Key features
- Simple API — Create agents with a few lines of TypeScript and class inheritance.
- Provider Flexibility — Switch between OpenAI, Anthropic, Groq without code changes.
- Tool Decorators — Add callable tools to agents via @tool and @toolparam annotations.
- Middleware — Inject custom logic before/after completions or tool execution.
- Job Scheduling — Define cron-style jobs that run automatically within agents.
- Hooks & API Exposure — Expose agent methods as HTTP endpoints using @hook.
- Observability — Built-in logging of agent actions, usage, and error handling.
- MagmaDeploy — One-click deployment of agents to the hosted MagmaDeploy platform.
Use cases
- Add a search tool to an agent for database queries.
- Validate user messages with middleware before LLM calls.
- Run daily cleanup tasks via scheduled jobs.
- Expose a notification handler as a REST endpoint.
Magma | Open Source Typescript Framework for Building AI Agents vs alternatives
Magma | Open Source Typescript Framework for Building AI Agents | Fine | SuperAGI Cloud | Pocketenv | BuildShip | |
|---|---|---|---|---|---|
| Best for | Low-opinion AI agent framework | Code-first AI agent development | Managed autonomous agent hosting | Sandbox runtime for agents | Visual backend building |
| Pricing | Open source | Free | Free | Free | Free |
| DevHunt upvotes | 2 | 75 | 43 | 73 | 118 |
| Launched | Oct 2025 | Jan 2023 | Jan 2023 | Apr 2026 | Jan 2023 |
- Magma | Open Source Typescript Framework for Building AI Agents vs Fine: Fine focuses on building AI agents with a higher-level UI, while Magma provides a low-opinion code-first framework.
- Magma | Open Source Typescript Framework for Building AI Agents vs SuperAGI Cloud: SuperAGI Cloud offers a managed cloud platform for autonomous agents, whereas Magma is a self-hosted library.
- Magma | Open Source Typescript Framework for Building AI Agents vs Pocketenv: Pocketenv provides a sandbox runtime for agents and humans, but does not include the agent framework features like tools and middleware that Magma offers.
- Magma | Open Source Typescript Framework for Building AI Agents vs BuildShip: BuildShip is a visual backend builder; Magma is a programmatic TypeScript framework for agents.
Magma | Open Source Typescript Framework for Building AI Agents FAQ
How do I install Magma?+
Run `npm i @pompeii-labs/magma` to add the package to your project.
Can I use Magma with any LLM provider?+
Yes, you can configure OpenAI, Anthropic, or Groq via the providerConfig.
What is the purpose of @tool decorators?+
They expose class methods as callable tools that the agent can invoke during execution.
How does middleware affect agent flow?+
Middleware can run before or after completions and tool calls, allowing logging, validation, or error handling.
Is Magma free to use and self-host?+
Magma is Apache 2.0 licensed and can be self-hosted at no cost; a hosted option is available on MagmaDeploy.
How are scheduled jobs defined?+
Use the @job decorator with a standard cron expression; jobs are static methods that run without an agent instance.
Summarized by DevHunt from github.com · Sep 28, 2026. Details may change; check the official site.
Magma | Open Source Typescript Framework for Building AI Agents
Fine
SuperAGI Cloud
Pocketenv
BuildShip







