Overview

Enhance Canvas AI to use a two-step agentic workflow instead of the current single-step approach, introducing a planning phase before execution to improve AI decision making and task coordination.

Proposed resolution

Implement a two-phase agentic flow system:

Phase 1: Planning Agent

  • Purpose: Analyze user requests and create detailed execution plans
  • Responsibilities:
    • Break down complex requests into discrete tasks
    • Assess component dependencies and conflicts
    • Create execution roadmap
    • Validate feasibility before execution

Phase 2: Execution Agent

  • Purpose: Execute the plan created by the planning agent
  • Responsibilities:
    • Follow the detailed execution plan

User interface changes

  • Enhanced progress indicators showing planning and execution phases using Polling (separate issue)

API changes

  • New AI agent configuration for planning workflows
  • Modified agent orchestration to support two-phase execution
  • Enhanced function call sequencing and dependency management

Implementation details

TBC

Benefits

  1. Better Planning: Complex tasks are better analyzed before execution
  2. Reduced Errors: Planning phase catches issues before execution

Implementation notes

  • Maintain backward compatibility with single-step workflows
  • Consider plan caching for similar requests
  • Implement proper timeout handling for both phases
  • Ensure planning overhead doesn't significantly impact performance
  • Add configuration options to enable/disable planning phase

Dependencies

  • Requires ai_agents module
  • Requires canvas_ai module
  • May require enhanced temp store for plan persistence

Comments

ahmedjabar created an issue.