Skip to content

Commit 1214ebd

Browse files
committed
docs: add unified orchestration layer section to README
1 parent 9aa2f0e commit 1214ebd

1 file changed

Lines changed: 61 additions & 17 deletions

File tree

README.md

Lines changed: 61 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# AgentOS
88

9-
**Open-source TypeScript runtime for production AI agents — multimodal RAG, multi-agent orchestration, 37 channel adapters, 5-tier guardrails, 21 LLM providers.**
9+
**Open-source TypeScript runtime for production AI agents — unified graph orchestration (AgentGraph / workflow / mission), multimodal RAG, 37 channel adapters, 5-tier guardrails, 21 LLM providers.**
1010

1111
[![npm version](https://img.shields.io/npm/v/@framers/agentos?style=flat-square&logo=npm&color=cb3837)](https://www.npmjs.com/package/@framers/agentos)
1212
[![CI](https://img.shields.io/github/actions/workflow/status/framersai/agentos/ci.yml?style=flat-square&logo=github&label=CI)](https://github.com/framersai/agentos/actions)
@@ -43,7 +43,7 @@
4343
- [Human-in-the-Loop (HITL)](#human-in-the-loop-hitl)
4444
- [Channels System](#channels-system)
4545
- [Voice and Telephony](#voice-and-telephony)
46-
- [Workflows](#workflows)
46+
- [Unified Orchestration Layer](#unified-orchestration-layer)
4747
- [Multi-Agent Coordination](#multi-agent-coordination)
4848
- [Observability](#observability)
4949
- [Skills](#skills)
@@ -908,29 +908,73 @@ Voice providers are registered via `EXTENSION_KIND_TOOL` with the `voice-call-pr
908908

909909
---
910910

911-
### Workflows
911+
### Unified Orchestration Layer
912912

913-
**Location:** `src/core/workflows/`
913+
**Location:** `src/orchestration/`
914914

915-
Declarative multi-step workflows with persistence and monitoring.
915+
Three authoring APIs compile to one `CompiledExecutionGraph` IR executed by a single `GraphRuntime`. Persistent checkpointing enables time-travel debugging and fault recovery.
916916

917-
- **WorkflowEngine** -- Instantiates and executes workflow definitions
918-
- **IWorkflowStore** -- Persistence interface for workflow state (supports SQL and in-memory backends)
919-
- **WorkflowTypes** -- Type definitions for workflow definitions, instances, tasks, and progress updates
917+
| API | Level | Use case |
918+
|-----|-------|----------|
919+
| **`AgentGraph`** | Low-level | Explicit nodes, edges, cycles, subgraphs — full graph control |
920+
| **`workflow()`** | Mid-level | Deterministic DAG chains with step/branch/parallel — Zod-typed I/O |
921+
| **`mission()`** | High-level | Intent-driven — declare goal + constraints, PlanningEngine decides steps |
920922

921-
Workflows integrate with the IAgentOS interface:
923+
**Differentiators vs LangGraph / Mastra:** memory-aware state, capability discovery routing, personality-driven edges, inter-step guardrails, streaming at every node transition.
922924

923925
```typescript
924-
// List available workflow definitions
925-
const definitions = agent.listWorkflowDefinitions();
926+
import { AgentGraph, toolNode, gmiNode, START, END } from '@framers/agentos/orchestration';
927+
import { z } from 'zod';
928+
929+
// Low-level: explicit graph with conditional routing
930+
const graph = new AgentGraph({
931+
input: z.object({ topic: z.string() }),
932+
scratch: z.object({ confidence: z.number().default(0) }),
933+
artifacts: z.object({ summary: z.string() }),
934+
})
935+
.addNode('search', toolNode('web_search'))
936+
.addNode('evaluate', gmiNode({ instructions: 'Evaluate quality', executionMode: 'single_turn' }))
937+
.addNode('summarize', gmiNode({ instructions: 'Write summary', executionMode: 'single_turn' }))
938+
.addEdge(START, 'search')
939+
.addEdge('search', 'evaluate')
940+
.addConditionalEdge('evaluate', (s) => s.scratch.confidence > 0.8 ? 'summarize' : 'search')
941+
.addEdge('summarize', END)
942+
.compile();
943+
944+
const result = await graph.invoke({ topic: 'quantum computing' });
945+
946+
// Mid-level: deterministic workflow
947+
import { workflow } from '@framers/agentos/orchestration';
948+
949+
const flow = workflow('onboarding')
950+
.input(z.object({ email: z.string() }))
951+
.returns(z.object({ userId: z.string() }))
952+
.step('validate', { tool: 'email_validator' })
953+
.then('create', { tool: 'user_service' })
954+
.compile();
955+
956+
// High-level: intent-driven
957+
import { mission } from '@framers/agentos/orchestration';
958+
959+
const researcher = mission('research')
960+
.input(z.object({ topic: z.string() }))
961+
.goal('Research {topic} and produce a cited summary')
962+
.returns(z.object({ summary: z.string() }))
963+
.planner({ strategy: 'plan_and_execute', maxSteps: 8 })
964+
.compile();
965+
966+
const plan = await researcher.explain({ topic: 'AI safety' }); // preview plan without executing
967+
```
926968

927-
// Start a workflow instance
928-
const instance = await agent.startWorkflow('data-pipeline-v1', input, {
929-
context: { source: 'scheduled' },
930-
roleAssignments: { analyst: 'gmi-123', reviewer: 'gmi-456' },
931-
});
969+
See [`docs/UNIFIED_ORCHESTRATION.md`](docs/UNIFIED_ORCHESTRATION.md), [`docs/AGENT_GRAPH.md`](docs/AGENT_GRAPH.md), [`docs/WORKFLOW_DSL.md`](docs/WORKFLOW_DSL.md), [`docs/MISSION_API.md`](docs/MISSION_API.md), [`docs/CHECKPOINTING.md`](docs/CHECKPOINTING.md).
970+
971+
#### Legacy WorkflowEngine
932972

933-
// Monitor progress
973+
The original `WorkflowEngine` (`src/core/workflows/`) continues to work for existing consumers. The new orchestration layer is opt-in and runs alongside it.
974+
975+
```typescript
976+
const definitions = agent.listWorkflowDefinitions();
977+
const instance = await agent.startWorkflow('data-pipeline-v1', input);
934978
const status = await agent.getWorkflow(instance.workflowId);
935979
```
936980

0 commit comments

Comments
 (0)