Open-source reference app for building and running background AI coding agents on Vercel — from chat prompt to committed code changes without keeping your laptop involved.
Open Agents is a fully open-source, production-ready template for deploying background AI coding agents on Vercel. It covers the entire stack: a Next.js web UI, a durable agent workflow runtime, isolated sandbox VMs, and deep GitHub integration. Users send a chat message and the agent takes over — exploring code, editing files, running shell commands, and optionally committing and opening a pull request when done.
The project is built around a key architectural insight: the agent runtime and the sandbox VM are intentionally separate. The agent does not run inside the execution environment — it runs outside and interacts through tools (file reads, edits, grep, bash). This means agent execution is not tied to a single HTTP request lifecycle, sandbox VMs can hibernate and resume independently, and model providers can be swapped without touching the sandbox implementation.
The agent itself is a ToolLoopAgent from Vercel’s AI SDK, armed with twelve tools including file operations, shell execution, web fetch, sub-task delegation, and a skills system. It supports multiple AI providers (Anthropic Claude and OpenAI models) through a unified gateway layer, with provider-specific behavioral overlays in the system prompt for each model family (Claude, GPT, Gemini).
Open Agents is designed to be forked and adapted — not used as a black box. The monorepo layout (apps/web, packages/agent, packages/sandbox, packages/shared) cleanly separates concerns so teams can swap out the sandbox backend, extend the tool set, or integrate their own auth provider while keeping the rest intact.
npx skillsArchitecture
Open Agents is a layered monorepo (Turborepo) structured as Web → Agent workflow → Sandbox VM. The Next.js app in apps/web handles auth, session CRUD, chat streaming, and workflow triggering via the runAgentWorkflow function in apps/web/app/workflows/chat.ts. Chat requests start a Vercel Workflow ("use workflow" directive) rather than executing the agent inline, so each agent run is a durable, resumable, multi-step process. The packages/agent package exports a single openAgent ToolLoopAgent that receives a sandbox context as a call option and communicates with the VM through tool calls. The packages/sandbox package abstracts the Vercel sandbox API, exposing connect/disconnect, git clone, snapshot restore, and port management. The agent is deliberately kept outside the VM — it never runs inside the sandbox, only issues commands to it — which decouples agent lifecycle from sandbox lifecycle and allows each to evolve independently.
Tech Stack
The web app is Next.js 16.2 with React 19, using the App Router and streaming Server Components. Database persistence uses Drizzle ORM against a Neon Postgres instance, with migrations applied automatically on every deployment. Auth is handled by Better Auth with Vercel OAuth and a GitHub App as social providers. The agent package depends on Vercel’s ai SDK (ToolLoopAgent, streaming, gateway), @ai-sdk/anthropic, and @ai-sdk/openai, unified through a custom createGateway abstraction in packages/agent/models.ts that applies Anthropic extended thinking settings per model. Redis/Upstash KV is optionally used for skills metadata caching. The build system is Turborepo with pnpm workspaces, using Bun as the test runner and Ultracite (oxlint + oxfmt) for linting and formatting.
Code Quality
The codebase has comprehensive test coverage using Bun’s built-in test runner across all major packages — packages/agent/tools/tools.test.ts mocks the AI SDK and sandbox registry to exercise tool behavior in isolation, while apps/web has extensive unit tests for session logic, model access, rate limiting, webhook processing, and UI components. TypeScript strict mode is enforced project-wide via shared tsconfig. Error handling is explicit throughout the workflow layer — runAgentWorkflow distinguishes abort errors from setup failures, preserves step timing on every error path, and always closes the stream and clears the active stream marker in a finally block. The Vercel Workflow "use step" annotations provide automatic step caching and retry semantics. Naming is consistent and idiomatic across the monorepo.
What Makes It Unique The defining technical choice in Open Agents is agent-sandbox separation enforced at the architecture level: the agent process (running as a Vercel serverless Workflow) and the execution environment (a Vercel sandbox VM) are distinct systems that communicate exclusively through a typed tool interface. This makes the sandbox a pure execution environment rather than a control plane, enables snapshot-based hibernation and resume without agent involvement, and lets the team swap sandbox backends without changing any agent code. The provider-aware system prompt layer — which injects Claude-specific, GPT-specific, Gemini-specific, and generic behavioral overlays at runtime based on the model gateway ID — is another concrete differentiator that makes a single agent codebase behave optimally across multiple frontier models without per-model forks.
Licensing Model MIT licensed — all features available in self-hosted deployments with no restrictions or license keys required.
Self-Hosting Notes Self-hosting requires a Vercel account (for the Workflow SDK and sandbox runtime), a Neon Postgres database, and a GitHub App for repo integration. The sandbox VM runtime is provided by Vercel’s infrastructure; there is no fully self-contained local sandbox alternative in the current implementation. Optional features (Redis caching, ElevenLabs voice transcription, snapshot-based sandbox restore) require additional service credentials but are not required for core functionality.
No Code Platforms · AI Development · Developer Tools
Visual LLM workflow platform with RAG pipelines, agent capabilities, and model management for building production AI applications.
Developer Tools · Game Development · Design Tools
Free, MIT-licensed 2D and 3D game engine with one-click multi-platform export and no royalties.
Developer Tools · Databases · Search
The open-source Postgres development platform that replaces Firebase with authentication, real-time APIs, edge functions, storage, and vector embeddings — all built on PostgreSQL.