openloops
Open source, Apache 2.0

Build production-grade enterprise agents in minutes, not days, weeks, or months.

openloops is an open source harness for AI agents. A TypeScript runtime that handles persistence, tool execution, MCP trust and approvals, scheduled jobs and user management, so you can focus on the one thing that makes your agent yours: the loop that decides how it thinks.

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

npm install openloops

Works with

OpenAIOpenAIAnthropicAnthropicGoogle GeminiGoogle GeminiMongoDBMongoDBSentrySentryLangfuseLangfuseOllamaOllama

01 / What it is

An agent is built like a car

An AI agent has an engine (the model), a chassis (the harness) and a body (the loop). openloops is the chassis: it handles persistence, tools, users and approvals, so you only write the body that decides how your agent thinks.

See it explained with cars

02 / Features

What you get out of the box

Everything an agent needs to survive in production, already built

Multi-user by design

Chats, tasks, context and MCP servers are scoped to the current user from the start.

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 scheduled jobs

The same agent works without a person in the chat, daily, weekly, monthly or once, 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 and token login 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

Hooks, identity, guardrails, usage tracking, users and resuming chats
More examples on GitHub
Coming soon

A marketplace of ready-to-use loops

Don't write a customer support agent from scratch. Pick a loop built for your use case and swap it in with one line.

ReactLoopCodeSpecialistLoopCustomerSupportLoopSecurityAnalystLoopFinanceLoop

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

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/agentic-jobs

Scheduled tasks, 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, scheduled jobs) 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 for multi-user products?+

Yes. Chats, tasks, context and MCP servers are scoped to the current user from the start, and user management and token login are included.

Ready to build your first agent?

Install openloops and have a working, persisted, multi-user 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