Repository navigation
Components
pavelravvich edited this page Sep 25, 2026
·
14 revisions
A workflow (a set of agents) is built from annotated classes, one per file, in folders by kind —
Angular style. Decorators carry settings; behaviour is an interface the class implements (like
implements OnInit); dependencies come through the constructor. The compiler checks every link.
Decision: ADR-0009.
examples/job-scout/src/ (a workflow — related agents under one directory)
agents/ researcher.ts researcher.prompt.md coder.ts coder.prompt.md
tools/ … @Tool classes
mcp/ … @McpServer + @McpTool facades
job-scout.workflow.ts @Workflow — the module
@Tool({ name: "greenhouse_jobs", effect: "read", description: "…", input: SearchInput, output: SearchOutput,
deps: [JobFitJudge, JOB_SEARCH] })
export class GreenhouseJobs implements ToolHandler<typeof SearchInput, typeof SearchOutput> {
constructor(private readonly judge: FitRater, private readonly search: JobSearch) {}
async run(input: z.output<typeof SearchInput>, ctx: ToolContext) { … } // typed from the schemas
}-
runis checked against the zod schemas; the core validates input and output, applies the timeout and returns errors to the model. -
depslists the constructor's dependencies in order — a missing, extra or reordered entry is a compile error (standard decorators have no parameter-type metadata, so they are listed once). - Test with plain
newand fakes:toolOf(new GreenhouseJobs(fakeJudge, search))— no container.
@Agent({
name: "scout",
description: "…",
model: KIMI,
price: KIMI_PRICE,
thinking: "none",
tools: [GreenhouseJobs],
prompt: new URL("./scout.prompt.md", import.meta.url),
})
export class Scout {}Settings are the agents.<name> fields of Configuration (reasoning, historyLimit, …).
The prompt is a Markdown file next to the agent; {{name}} in it is filled from
@Workflow({ promptVariables }) (an unknown one fails assembly).
@McpServer({ name: "docs", transport: "stdio", command: FILESYSTEM_SERVER, args: [DOCS_DIR] })
export class DocsServer {}
@McpTool({ server: DocsServer, tool: "read_text_file", description: "…", input: …, output: … })
export class ReadDoc {} // agents reference it like any tool: tools: [ReadDoc]@Rag classes in rag/, bound by agents with a required mode — see Knowledge bases.
@Workflow({
name: "job-scout",
version: "1.1.0",
defaults,
budget,
routers,
guards,
compaction,
agents: [Profiler, Scout],
mcp: [],
promptVariables,
providers: [JobFitJudge, { provide: JOB_SEARCH, useValue: jobSearchConfig }],
})
export class JobScout {}-
providersregisters what components inject: classes (@Injectable({ deps }), created by the container) and values (InjectionToken<T>+useValue). The core providesROUTER_FACTORY(Jev routers for cheap decisions inside tools) andENV. -
Assembly (
workflowOf, at startup, before the first request): the dependency graph is checked and every instance is created once, dependencies first. A cycle, an unregistered provider, a class intoolsthat is not a component, a missing prompt file or prompt variable fail with the component's name. - The assembled workflow is the same config the core always ran: profiles,
describe, Studio and tracing work unchanged.npm run describeshows each tool's dependencies:greenhouse_jobs (read, local) ← JobFitJudge (ROUTER_FACTORY), JOB_SEARCH.
-
a tool — one
@Toolclass in the workflow'stools/, then reference it from an agent'stools. -
an agent —
agents/<name>.ts+agents/<name>.prompt.md, then list it in@Workflow({ agents }). -
an MCP server —
@McpServer+@McpToolfacades inmcp/, the server in@Workflow({ mcp }). -
a workflow — a folder with the above and a
*.workflow.ts, registered insrc/workflows.ts.
AGBoss
- Home
- Delivery Pipeline
- Architecture
- Configuration
- Workflow — the graph
- Advanced Routing (DSL)
- Routers
- Guards
- CLI — agboss
- App — createApp
- Context and Authorization
- Testing
- Suites and Comparisons
- Components
- Standard DTOs
- Example: job-scout
- Agents — the loop
- Model providers
- Tools
- Knowledge bases (RAG)
- FinOps
- Tracing
- Observability
- Terns and evaluation
- Profiles and comparisons
- Pause seam
- Decisions (ADR)