Apache-2.0 · TypeScript · Built on LangGraph · v0.1.0 (latest)Build complex AI agents.
Catch broken workflows before they run.
AGBoss brings Spring-style dependency injection and declarative TypeScript components to LangGraph. Its static compiler catches structural workflow bugs before execution, and deterministic test runners let you verify components and workflows offline without live LLM calls.
npm install @agboss/core @agboss/cliStarting from scratch? Run npx -p @agboss/cli agboss create my-app
Readable workflows. Verified before runtime.
Section titled “Readable workflows. Verified before runtime.”In raw shared-state graphs, a router branch that skips a required producer compiles cleanly under tsc and fails only in production when that branch is taken. AGBoss tracks typed @Dto handoffs across every route and catches structural workflow mistakes before execution with npx agboss check:
- Readable, declarative flow with explicit typed
@Dtohandoffs. - VIP orders route through
ApplyVipCouponAction(CouponDiscountDto) beforeRenderInvoiceAction; standard orders route toRenderStandardInvoiceAction.
@Workflow({ name: "missing-input-fixed-workflow", version: "0.1.0", flow: [ start(MissingInputFixedStart) .returns(CheckoutRequestDto) .toRouter(TierRouter) .chooseOne( // VIP path produces CouponDiscountDto first route(ApplyVipCouponAction) .returns(CouponDiscountDto) .toAction(RenderInvoiceAction) .returns(InvoiceSummaryDto) .toFinish(MissingInputFixedFinish), // Standard path needs only CheckoutRequestDto route(RenderStandardInvoiceAction) .returns(InvoiceSummaryDto) .toFinish(MissingInputFixedFinish), ), ],})export class MissingInputFixedWorkflow {}types: .agboss/types.d.tsok: cases/01-missing-input/agboss-fixed/application.ts — assembly, environment, application, prompts, types- Second branch skips
ApplyVipCouponActionand routes straight toRenderInvoiceAction(which requiresCouponDiscountDto). - TypeScript alone does not catch the missing upstream input;
agboss checkreports the exact missing input and path.
@Workflow({ name: "missing-input-broken-workflow", version: "0.1.0", flow: [ start(MissingInputBrokenStart) .returns(CheckoutRequestDto) .toRouter(TierBrokenRouter) .chooseOne( route(ApplyVipCouponAction) .returns(CouponDiscountDto) .toAction(RenderInvoiceAction), // Skips ApplyVipCouponAction (CouponDiscountDto)! route(RenderInvoiceAction), ), action(RenderInvoiceAction) .returns(InvoiceSummaryDto) .toFinish(MissingInputBrokenFinish), ],})export class MissingInputBrokenWorkflow {}error [input.missing-on-path] missing-input-broken-workflow: render-invoice-action.coupon (CouponDiscountDto) is not produced on the path: missing-input-broken-workflow-start → tier-broken-router → render-invoice-actionRun 02-path-scope-proof on GitHub →
·
Read Path Scope & Provenance docs →
Three core capabilities
Section titled “Three core capabilities”AGBoss layers structured application architecture on top of LangGraph’s durable execution runtime:
Typed Components & Declarative Workflows
Structure agent systems from focused TypeScript classes instead of monolithic shared state. Wire services with constructor dependency injection (@Injectable) and connect @Agent, @Router, and @Action steps through explicit @Dto contracts.
Static Checking & Deterministic Testing
Catch broken routes and test multi-agent behavior offline before calling a live model. Validate every workflow path at build time with agboss check, then run fast, deterministic unit and workflow tests with testWith() and recorded fixtures.
Reliable Execution & Recovery
Run long-lived workflows in production with built-in fault tolerance and cost controls. Roll back failed side effects with compensateWith sagas, enforce @Budget limits, and resume paused or interrupted runs from persistent state.
Runnable examples
Section titled “Runnable examples”Every example in agbossjs/agboss-examples is verified offline with npm run check, npm test, and npx tsx src/demo.ts:
01-hello-agboss
Minimal end-to-end starter demonstrating constructor dependency injection, @Router + @Agent + @Tool composition, @Budget caps, and deterministic offline tests.
02-path-scope-proof
Side-by-side comparison of 4 structural workflow bugs (missing inputs, stale loop data, parallel conflicts, uncompensated actions) that pass tsc in raw graphs but are caught by agboss check.
04-travel-booking-saga
Multi-step flight, hotel, and payment workflow demonstrating automatic compensateWith rollbacks on failure, human approval pauses, and persistent crash recovery.
Browse all 7 verified examples (including 03-support-refund-desk, 05-cluster-work-stealing, 06-enterprise-agent-mesh, and 07-langgraph-migration) →
·
Explore the Distributed Agent Recovery showcase (agbossjs/distributed-agent-recovery) →
Start building with AGBoss
Section titled “Start building with AGBoss”AGBoss is open source under the Apache-2.0 license and runs inside your own Node.js infrastructure with zero vendor lock-in.
Quickstart Guide
Scaffold a new project, wire typed components with dependency injection, and run your first static workflow check in minutes.
Start the Quickstart →FEATURE EXPLORERInteractive Feature Explorer
Inspect 37 interactive TypeScript code examples covering decorators, routing patterns, testing, and production controls.
Open Feature Explorer →APACHE-2.0 · OPEN SOURCEGitHub Repository
Explore the @agboss/core runtime, @agboss/cli static compiler, and executable proof suite on GitHub.