openloops
Open source, Apache 2.0

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

openloops handles persistence, tool execution, MCP integration, and user management, so you can focus on the one thing that makes your agent yours: how it thinks.

npm install openloops

One line decides what your agent does

import { Agent } from 'openloops/core'
import { Logger } from 'openloops/common'
import { PlanExecuteLoop } from 'openloops/loops'
 
const logger = new Logger()
const agent = new Agent({ loop: new PlanExecuteLoop() })
 
const result = await agent.run({
input: { message: 'what is the current price of Bitcoin?' },
currentUser,
})
 
logger.info(result.data.lastAnswer, '[Demo] Result')

What you get out of the box

Everything an agent needs to survive in production, already built

Multi-user by design

Chat history, task state, and MCP configuration are scoped per user from the start.

Zero-boilerplate persistence

Messages, tasks, and every tool call are saved automatically to MongoDB.

Production-grade execution

Retries, confirmation prompts, and crash recovery are built into the runtime.

Native MCP support

Connect any MCP server and its tools become regular tools instantly.

Sub-agent orchestration

An agent can launch and coordinate other agents to split up a problem.

Any LLM provider

OpenAI, Anthropic, and self-hosted local models all work the same way.

Works with

OpenAIOpenAIAnthropicAnthropicMongoDBMongoDBSentrySentryLangfuseLangfuseOllamaOllama

See how little code this actually takes

Running an agent, adding hooks, setting an identity, and writing a custom tool

import { Agent } from 'openloops/core'
import { Logger } from 'openloops/common'
import { CurrentUser } from 'openloops/base'
import { PlanExecuteLoop } from 'openloops/loops'
 
const logger = new Logger()
const currentUser = await CurrentUser.asyncFromDB(userId)
const agent = new Agent({ loop: new PlanExecuteLoop() })
 
const result = await agent.run({
input: { message: 'hi, how are you?' },
currentUser,
})
 
logger.info(result, '[Demo] Result')

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: the runtime

openloops/loops

Built-in loops, starting with PlanExecuteLoop

openloops/tools

Tool, BaseParams, and built-in tools

openloops/skills

Skill, for LLM-backed reasoning steps inside a loop

openloops/mcps

MCP server CRUD and connection handling

openloops/users

User management

openloops/llmcalls

LLM usage and cost tracking

openloops/base

CurrentUser, CurrentSession

openloops/common

Logger and shared utilities

openloops/clients

HTTP clients used by built-in tools

openloops/authentication

Authentication utilities

openloops/chats

Chat and conversation persistence internals

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)Requires configuring a checkpointer (e.g. Postgres) yourselfLocal memory (ChromaDB + SQLite) by default, machine-bound and scoped to a single run
Multi-user scopingBuilt in: chats, context, and MCP servers are per-user from the startNot a concept of the framework, you build itNot natively supported by default
Tool execution and retriesBuilt into the runtimeYou write the retry and error-handling logicConfigured per task, not automatic
MCP supportNative: MCP tools become Tool instances automaticallyRequires a separate adapter package and manual wiringAvailable through a separate tools integration, not automatic per-user loading
User managementIncluded (openloops/users)Not included, you build your ownNot included
LLM usage and cost trackingIncluded (openloops/llmcalls)Not included in OSS, available via paid LangSmithNot included as a first-class module
ObservabilitySentry and Langfuse, enabled via env varsRequires your own tracing setup, or paid LangSmithRequires a third-party tracing integration
Pre-built agentsGrowing marketplace of ready-to-use loopsYou build every agent from primitivesNo built-in agent marketplace
What you writeNode functions (plain async functions)Nodes and the graph's edges, explicitlyAgents, tasks, and crew orchestration, declared per role
Mental modelA state machine your loop drives itselfA graph you declare and compile ahead of timeA crew of role-based agents coordinated for you

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