Skip to content

feat: Planner agent for automatic pipeline routing #98

Description

@anderskev

Summary

Amelia needs a Planner agent that sits before the pipeline registry and automatically routes user requests to the right workflow pipeline based on intent analysis.

The pluggable pipeline infrastructure already exists (Pipeline base class, PipelineMetadata, registry with PIPELINES dict). What's missing is the routing intelligence — today users must explicitly specify which pipeline to run.

Current State

Component Status
Pipeline base class + generics Done
Pipeline registry (registry.py) Done
Implementation pipeline Done
Review pipeline Done
Planner agent (intent → pipeline routing) Not started
Additional pipelines (investigation, brainstorm, etc.) Not started
Replan mechanism (cross-pipeline re-routing) Not started

What This Unlocks

  1. Single entry point — Users describe work naturally ("investigate why builds are slow", "brainstorm auth approaches") and Amelia routes to the correct pipeline without explicit --pipeline flags.
  2. New pipelines become useful — Adding investigation or brainstorm pipelines has no value without something to route to them. The Planner makes the registry meaningful.
  3. Replan/escalation — If a pipeline discovers it's the wrong fit, a Planner can catch the signal and re-route.

Proposed Phases

Phase 1: Planner agent + intent routing (high value, medium effort)

  • New Planner agent that classifies user intent via LLM call
  • Thin routing node that maps intent → pipeline name → get_pipeline()
  • Fallback to implementation pipeline when intent is ambiguous
  • Profile option: orchestration_mode: fixed | dynamic (fixed = current behavior, dynamic = Planner-routed)

Phase 2: One new pipeline to prove generalization (medium value, medium effort)

  • Add an investigation or analysis pipeline (debug issues, analyze problems)
  • Validates that the Planner + registry architecture works end-to-end with >2 pipelines

Phase 3: Replan mechanism (lower value, higher effort)

  • Cross-pipeline state transfer when a pipeline signals wrong fit
  • Planner catches replan signals and re-routes mid-execution

Phase 4: Dashboard visualization (polish)

  • Show active pipeline selection in the workflow view
  • Visualize Planner decision in execution timeline

Success Criteria

  • Planner agent classifies intent and selects pipeline
  • orchestration_mode: dynamic routes through Planner; fixed preserves current behavior
  • At least one additional pipeline works end-to-end via Planner routing
  • Pipelines remain pluggable (add new ones without core changes)

Metadata

Metadata

Assignees

Labels

acceptedAccepted for implementationenhancementNew feature or requestlowLow priority - nice to have

Fields

No fields configured for Feature.

Projects

Status
Planned

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions