openloops
Open source, Apache 2.0

Build production-ready, multitenant AI agents for your SaaS in minutes, not days, weeks, or months.

Anthropic and OpenAI give you the engine. Openloops gives you the chassis, with the AGI loop, the tools and everything an agent needs in production. You build the body: a customer support agent, a financial auditor, a meeting copilot.

New to AI agents? See what openloops is, explained with cars

npm install openloops

Works with

OpenAIOpenAIAnthropicAnthropicGoogle GeminiGoogle GeminiMongoDBMongoDBSentrySentryLangfuseLangfuseOllamaOllama

01 / Live demo

Add an agent to your SaaS

Openloops is an open source harness for building AI agents. A TypeScript runtime that handles persistence, tool execution, MCP trust and approvals, automations and user management for each of your organizations, so you only add what makes your agent yours: your interface, your tools and your MCPs. Embed the agent in your app and ship.

02 / Features

What you get out of the box

Everything an agent needs to survive in production, already built

Multitenant by design

Support multiple organizations, with users that belong to them. Chats, tasks, context and MCP servers are scoped from the start, so each customer gets their own agent space.

Zero-boilerplate persistence

Messages, tasks and every tool call are saved to MongoDB, and a conversation resumes exactly where it stopped, even in the middle of a confirmation.

Safe tool execution

Arguments are validated, destructive tools wait for the user's confirmation, and identifiers the model invents never reach a real system.

MCP with a trust flow

Connect any MCP server and its tools become regular tools. Each server is approved before its first tool runs and reviewed again when it changes.

Autonomous runs and automations

The same agent works without a person in the chat, on a schedule or when another system sends it an event, with a history of every run.

Guardrails

Input guards block card numbers, emails, code or anything you define before the model sees the message.

Usage and cost tracking

Every LLM call is recorded. Get tokens and cost per answer, per chat and per user.

Users and authentication

User management, login with refresh tokens and password reset are included, so you don't need a parallel system for identity.

Any LLM provider

OpenAI, Anthropic, Google, self-hosted models such as Ollama and private deployments on Bedrock, GCP or Azure work the same way, chosen per chat.

03 / Code

See how little code this actually takes

Agents, tools, MCP servers, automations, hooks, identity, guardrails, usage tracking, users and resuming chats
More examples on GitHub
Coming soon

A marketplace of plugins for openloops

Extend your agents with ready-made packages instead of building every tool yourself. Install a plugin and your agent gets new abilities.

Web browsing toolsReady-made guardrails

04 / Compare

How it compares to other frameworks

An honest comparison against the self-hosted, open-source versions of LangGraph and CrewAI
 openloopsLangGraph (OSS)CrewAI (OSS)
PersistenceBuilt in, zero config (MongoDB)You choose and configure a checkpointer: in-memory, SQLite or Postgres, the last two in separate packagesMemory is opt-in and stored as local files (ChromaDB and SQLite, or LanceDB in newer versions), tied to the machine
Multi-user scopingBuilt in: chats, tasks, context, and MCP servers are per-user from the startConversations are scoped by a thread_id. Mapping them to users, and scoping memory and tools per user, is up to youNot a concept of the framework, you build it
Tool execution and retriesValidation, confirmation of destructive tools, duplicate and invented-id protection, and LLM and MCP retries are built into the harnessPer-node RetryPolicy and error handling that you configureRetry limits are configured per agent or task
MCP supportNative: servers are a per-user record, tools load on demand, and every server goes through an approval flowA separate package (langchain-mcp-adapters) with a client that you wire into the graphNative mcps field on agents, or MCPServerAdapter. Servers are declared in code, not loaded per user
See the full comparison

05 / Modules

One package, organized by what you need

Openloops ships as a single package with subpath exports, so you only pull in what you use.
openloops/core

Agent, AgentLoop, RunContext, Harness: the runtime

openloops/loops

AgiLoop, the default loop, and the skills loops share

openloops/tools

Tool, BaseParams, and built-in tools such as web search and fetch_url

openloops/skills

Skill, for LLM-backed reasoning steps inside a loop

openloops/guardrails

Guard and ready-made input guards

openloops/mcps

MCP server management, connection checks and trust decisions

openloops/automations

Automations: tasks the agent runs by schedule or by event, their runs and the runner that executes them

openloops/chats

Chats and their messages: list, read, update, delete

openloops/users

User management

openloops/authentication

Login and token issuing

openloops/llmcalls

LLM usage and cost tracking

openloops/base

CurrentUser, CurrentSession

openloops/common

Logger and shared utilities

openloops/clients

LLMClient and the HTTP clients used by built-in tools

06 / FAQ

Frequently asked questions

Is openloops free and open source?+

Yes. Openloops is open source under the Apache 2.0 license and free for commercial use.

What do I need to run it?+

Openloops is a TypeScript package. You install it with npm or yarn, and it saves messages, tasks and every tool call to MongoDB, so a conversation resumes exactly where it stopped.

Does it include an API or an HTTP layer?+

No. Openloops is a package that your backend calls: it provides the use cases (running agents, chats, users, automations) and your backend exposes the endpoints and owns the authorization of each one. The integration guide lists which endpoint calls which use case.

Which LLM providers does it support?+

OpenAI, Anthropic, Google and self-hosted models such as Ollama work the same way, and the model is chosen per chat. It also supports private provider deployments in your own cloud account, such as Anthropic on Amazon Bedrock, Google Cloud (GCP) and Azure.

Does it support MCP?+

Yes. Connect any MCP server and its tools become regular tools. Each server is approved before its first tool runs and reviewed again when it changes.

How is openloops different from LangGraph or CrewAI?+

Persistence, per-user scoping, tool safety, MCP and cost tracking come built in instead of being something you wire yourself. The comparison page lists the differences feature by feature.

Can I use it in a multitenant SaaS?+

Yes. Openloops supports multiple organizations, and users belong to them. Chats, tasks, context and MCP servers are scoped from the start, and user management and login are included, so you can offer an agent to each of your customers.

Can I write my own loop?+

Yes. Openloops ships AgiLoop, a general purpose loop that works out of the box, and you can write your own as an advanced option.

Ready to build your first agent?

Install openloops and have a working, persisted, multitenant agent running in minutes.

npm install openloops
Apache 2.0, free for commercial use
TypeScript, works with any LLM provider

Not sure where to start? Read the explanation