AI Autonomy

Create autonomous agents with an AI planner that breaks goals into tasks and coordinates execution through workflows.

Overview

AI Autonomy takes Mosaic to the next level. Instead of manually defining workflows, you provide a high-level goal and let an AI planner figure out the best approach. The planner decomposes goals into tasks, assigns appropriate models, and creates optimized workflows.

Using the Planner

The Planner class generates workflows from natural language goals:

planner-basic.ts

How It Works

When you call planner.plan(), the AI:

  1. 1Analyzes your goal to understand requirements
  2. 2Breaks it down into discrete, actionable tasks
  3. 3Assigns the best model for each task based on complexity
  4. 4Optimizes execution order (parallel where possible)
  5. 5Returns a ready-to-execute Workflow

Example Generated Workflow

For the goal "Implement login functionality", the planner might generate:

generated-workflow.ts

Note

The planner intelligently parallelizes independent tasks (like validation and styling) while keeping dependent tasks sequential.

Autonomy Slider

Control how much freedom the AI planner has. Combine manual workflows with AI planning for the perfect balance:

Full ManualFull Autonomous

Slide between defining every task yourself and letting AI handle everything

autonomy-hybrid.ts

Best Practices

  • Be specific: Clear goals produce better workflows. "Add login" is vague; "Add email/password login with JWT tokens" is specific.
  • Start supervised: Review generated workflows before executing them in production.
  • Use constraints: Provide context about your stack, coding standards, or requirements.

Next Steps