Skip to content

Introduction ​

chamvi is a TypeScript framework for self-hosted, channel-driven AI agents. You write agents in your own repository, build them into a Docker image and run them on your own infrastructure. A webhook, a schedule or a manual call starts a run, and the run survives restarts, retries and approval pauses.

The LLM side is the Vercel AI SDK v7. chamvi adds what the AI SDK leaves out on purpose: channels, a run queue, persistence, concurrency control, approvals and a graceful shutdown.

Status

chamvi is pre-1.0: minor versions may break the API, and the upgrading guide lists what changed. Every package in the reference is published, and the deployment kit (the base image, the Helm chart and the template repository) exists. Work still ahead is on the roadmap; pages about it carry a Planned badge.

Why chamvi? ​

The AI SDK runs the model and its tool loop, and stops there. An agent that reacts to webhooks and schedules also needs:

  • a place to queue the work,
  • a way to survive a pod restart halfway through a run,
  • a guard against posting the same comment twice after a retry,
  • a way to wait a day for a human to approve a tool call.

That usually means a hosted orchestrator, or a lot of glue code. chamvi is that layer as a library.

ConcernAI SDK on its ownWith @chamvi/core
IntakeYou call generateText from your handlerdispatch() stores a queued run; an idempotencyKey turns a redelivery into the existing run
ConcurrencyTwo webhooks for the same issue race each otherOne run at a time per concurrencyKey, enforced through the store across replicas
DurabilityA crash loses the conversationA checkpoint after every step; a recovered run continues from the latest one
Side effectsA retried tool call posts againdefineEffectTool() records each result per effect key and can check the remote system first
ApprovalsYou build the pause, the storage and the callbackawait approve(ctx, { title }) inside the tool pauses the run in waiting, across restarts; the answer replays the call
LimitsstopWhen per callmaxSteps, maxTokens and timeoutMs per run, settled as completed or failed
ShutdownRuns die with the processdrain() waits for in-flight runs, then marks the rest interrupted for another replica

Design principles ​

  • Channels first. Every run comes from a channel and starts from one normalized envelope. Deduplication and concurrency are decided at intake, before any model call; outbound is tool-driven, so the engine never posts on its own.
  • Self-hosted. Agents run in your process, on your cluster, with your provider keys. Nothing phones home and there is no paid console.
  • No orchestrator server. Runs, leases, locks and idempotency keys live in a pluggable store. Replicas coordinate through that store; Redis is never required.
  • Built on the AI SDK, not around it. LanguageModel, ModelMessage and ToolSet pass through unchanged. If you know tool() and ToolLoopAgent, you know how to write a chamvi tool.
  • A small concept surface. About ten concepts: App, Agent, Channel, Run, Step, State, Tool, Workspace, Repository. The core ships Agent, Channel, Run, Step, State, Tool and Repository.
  • No spam. Retries and restarts must not repeat comments, pushes or notifications. That is what effect tools and the message keys of channel emit() are for.

How it compares ​

chamvi sits next to several good tools. The difference is mostly where the orchestration runs and who owns it.

ToolWhat it isWhere chamvi differs
InngestEvent-driven durable functions with step memoization, run by the Inngest server (cloud or self-hosted)No separate server: the engine is a library and the store is your database
Trigger.devA platform for background jobs and AI tasks, with its own workers and dashboard (cloud or self-hosted)Runs in your own Node process; the deploy kit is a plain Docker image and Helm chart
MastraA TypeScript agent framework with its own agent, workflow and memory abstractionsKeeps AI SDK types as they are and focuses on channels, durable runs and operations
Cloudflare AgentsStateful agents on Durable ObjectsNot tied to a vendor runtime: any Node >=26.0.0 host and any store that passes the contract
Workflow SDK (workflow, @ai-sdk/workflow)Durable functions through 'use workflow' and 'use step' directives with deterministic replay, wired in through a bundler integrationUses step checkpoints instead of replay, so plain code runs as written, without a compiler step

Each of these is a better fit in some setups: if you already run Inngest or Trigger.dev, or deploy to Cloudflare or Vercel, use what fits that platform. chamvi targets one owner running their agents on their own cluster.

What ships today ​

@chamvi/core contains:

@chamvi/store-memory holds the memory repositories for development and tests, @chamvi/store-db the PostgreSQL ones. @chamvi/test-kit adds an engine on memory repositories, the repository port suites and a controllable clock for tests.

The engine starts runs only through engine.dispatch(), which channels call: @chamvi/channel-cron fires cron subscriptions; @chamvi/http serves REST, MCP and webhooks; @chamvi/github takes GitHub deliveries.

Next steps ​

  • Installation: install the core and a model provider.
  • Quick Start: define an agent and run it once.
  • Your First Agent: an agent folder on @chamvi/app, from chamvi dev to chamvi start --check in CI.
  • Guide: the concepts, one page each.