# Magma

A TypeScript framework for building and deploying conversational AI agents quickly, with a tool and middleware system and one-command hosted deployment.

Magma is a framework for creating AI agents without long chains of abstractions: a developer defines the logic they want an agent to have directly, decorates methods as tools the agent can call, and runs the result through a small API. Tools give an agent the ability to perform actions and must each return a string, and middleware methods run custom logic before or after a completion or a tool call, such as logging, validation or sanitizing data, and can throw errors that redirect the conversation flow in a defined way.

Agents can use any of several AI providers, including OpenAI, Anthropic and Groq, and can be deployed in seconds on a separate hosted deployment platform or self-hosted. The project ships with a demo agent used for user research, built with the framework.

It installs as an npm package.

Website: https://github.com/pompeii-labs/magma
