Introduction
AGBoss — short for Agent Graph Builder Open Source System — is an open-source, Spring-style TypeScript framework for building reliable, testable AI agents and multi-agent workflows on top of LangGraph.
While LangGraph provides the underlying graph execution runtime and checkpointing engine, AGBoss provides the application architecture layer: declarative component decorators (@Application, @Workflow, @Agent, @Router, @Arbiter, @Action, @Tool), constructor dependency injection (@Injectable), explicit @Dto data contracts, a declarative workflow DSL (HarnessDSL), a build-time workflow verifier (agboss check), and a deterministic offline testing harness (@agboss/core/testing).
It is published on npm as two complementary Apache-2.0 packages:
@agboss/core(dependencies) — the production runtime, decorators, DI container, storage repositories, testing/evaluation subpaths, and bundled AI coding skills.@agboss/cli(devDependencies) — the project scaffolder (agboss create), code generator (agboss generate), static workflow compiler (agboss check), and local developer/evaluation UIs.
Why build with AGBoss on LangGraph?
Section titled “Why build with AGBoss on LangGraph?”As a multi-agent system grows beyond a small prototype—especially when maintained alongside AI coding assistants (Claude Code, Cursor, Codex, Windsurf, Copilot)—raw shared-state graphs (Annotation.Root) and untyped string edges become difficult to validate and test. AGBoss addresses this through 7 architectural principles:
- Computational Role Segregation: Distinct decorators (
@Agent,@Router,@Arbiter,@Action,@Tool) separate LLM reasoning, routing decisions, quorum consensus, and external side effects into focused component classes. - Static Workflow Validation (
agboss check& Path Scope): The@Workflowflowarray declares paths with one chained method call per line (start(ChatWorkflowStart)→.returns(WorkflowStartTextDto)→.toRouter(MainRouter)→.chooseOne(...)).npx agboss checkruns static path-dominance analysis, generates.agboss/types.d.tswith narrowedProduced<Dto, Producer>types, and rejects missing inputs ([input.missing-on-path]), stale loop data ([input.outdated-on-path]), or uncompensated actions ([flow.uncompensated-action]) before runtime. - Constructor Dependency Injection & Single
@ApplicationRoot: Wire typed environment contracts (AppEnvironment,secret(),env(),env.optional()), shared@ModelProviderpools,@Budgetceilings,@ChannelRolepauses,@HealthCheckprobes, and replaceableInMemory*orSqlite*WAL repositories in one container—and swap implementations or test doubles cleanly in tests. - Deterministic Offline Testing (
@agboss/core/testing): Boot the application container withtestWith(Application), control concurrent interleavings and virtual time (VirtualClock), and test any component in isolation offline without live LLM calls using 10 dedicated unit runners (testTool,testToolInterceptor,testAction,testRouter,testArbiter,testRag,testJudge,testCompaction,testPii,testGuardrail). - Prompt Prefix Cache Invariance & Boundary PII: Static system prompt verification (
[prompt.input-in-instructions]) and deterministic HMAC pseudonymization (PiiAction.replaceWithToken()) preserve LLM KV-cache prefixes across turns while restoring real values only inside authorized@Toolcalls. - Built-in AI Coding Skills & Progressive Crystallization: Every scaffolded project includes
AGENTS.mdand offline-synced.claude/skills/agboss/reference guides, plusagboss describe --json(configHash,promptHash,schemaHash) for crystallizing settled LLM paths into deterministic TypeScript.
How AGBoss is organized
Section titled “How AGBoss is organized”| Layer | Public Entry | Key Primitives |
|---|---|---|
| Application & Flow | agboss |
@Application, createApp, @Workflow, @WorkflowStart, @WorkflowFinish, start, route, caseOf, ThisWorkflow |
| Components & DI | agboss |
@Agent, @Action, @Router, @Arbiter, @Tool, @ToolInterceptor, @Judge, @InputGuardrail, @OutputGuardrail, @Compaction, @Injectable, ExecutionContext, ApplicationContext, Clock, Logger |
| Data Contracts & Units | @agboss/core/dto, @agboss/core/units |
@Text, @Integer, @Decimal, @Flag, @OneOf, @ListOf, @Nested, oneOf, listOf, optional, historyOf, usd(), seconds(), minutes(), hours() |
| Models & Integrations | @agboss/core/models, @agboss/core/mcp, @agboss/core/rag, @agboss/core/a2a |
@ModelProvider, RateLimitPolicy, PromptCaching, @McpServer, @McpTool, @McpExpose, @Rag, SqliteFtsConnector, @A2AAgent, @A2AExpose |
| Testing & Evaluation | @agboss/core/testing, @agboss/core/eval |
testWith, TestConcurrency, VirtualClock, testTool, testToolInterceptor, testAction, testRouter, testArbiter, testRag, testJudge, testCompaction, testPii, testGuardrail, @EvalSuite |
Where to go next
Section titled “Where to go next”- Install
agbossand@agboss/clifrom npm and follow the Quick start to scaffold, statically verify, and test your first workflow. - Explore the 7 standalone, runnable applications in
agbossjs/agboss-examples(documented in the Examples guide). - Read the 7 Architectural Principles and AI Coding Skills (
AGENTS.md).