Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Sequential handoff between specialists. Each agent completes its work, yields it
Like a pipeline, but with conditional edges, parallel fan-out, fan-in merging, and loops. Agents execute concurrently in waves — when a node completes, its outgoing edges are evaluated and successor nodes fire when all dependencies are satisfied. Supports configurable iteration limits, cost budgets, timeouts, and exports to Graphviz DOT format for visualization.

### Dynamic Orchestration
GoGrid's most powerful pattern. Agents can spawn child agents, child teams, child pipelines, or child graphs dynamically at runtime. Unlimited scaling with minimal assumptions about how a problem gets solved. For when the developer doesn't know — or shouldn't hardcode — the exact steps to a solution.
GoGrid's most powerful pattern. A Runtime enables agents to spawn child agents, teams, pipelines, or graphs dynamically at runtime. Resource governance controls concurrency limits, nesting depth, and cost budgets across all spawned children. Async futures allow parallel child execution with aggregate metrics tracking.

> All GoGrid patterns are composable. A team can contain pipelines. A graph node can spawn a dynamic orchestrator. The architecture adapts to the problem, not the other way around.

Expand Down
38 changes: 38 additions & 0 deletions pkg/orchestrator/dynamic/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Package dynamic implements GoGrid's Dynamic Orchestration pattern.
//
// Dynamic orchestration enables agents to spawn child agents, teams,
// pipelines, or graphs at runtime. This is GoGrid's most powerful
// pattern — the executing agent decides which orchestration to use
// based on the problem at hand.
//
// A Runtime manages resource governance: concurrency limits, maximum
// nesting depth, cost budgets, and cascading cancellation. Child
// orchestrations inherit the parent's tracing context and are tracked
// for aggregate cost and usage metrics.
//
// Usage:
//
// rt := dynamic.New("coordinator",
// dynamic.WithConfig(dynamic.Config{
// MaxConcurrent: 5,
// MaxDepth: 3,
// CostBudget: 1.00,
// }),
// )
// ctx := rt.Context(ctx)
// result, err := rt.SpawnAgent(ctx, researchAgent, "Find papers on X")
//
// For async spawning, use Go to launch children in the background:
//
// f := rt.Go(ctx, "research", func(ctx context.Context) (string, error) {
// r, err := rt.SpawnAgent(ctx, researchAgent, input)
// if err != nil {
// return "", err
// }
// return r.Message.Content, nil
// })
// output, err := f.Wait(ctx)
//
// The Runtime is made available to child orchestrations via context,
// enabling nested dynamic spawning up to the configured MaxDepth.
package dynamic
Loading