Module 03 — AI Orchestration with Kestra

Grounding LLMs in real context, then letting them reason with goals and tools — inside a versioned, observable workflow

Key Concepts

Core

Context Engineering

Generic AI assistants hallucinate outdated syntax or invented plugin properties because they're frozen at a training cutoff. Supplying current docs before generation is what makes output trustworthy.

hallucinationplugin docsgrounding
Core

AI Copilot

Generates flow scaffolding from natural language, grounded in the plugin docs for your installed Kestra version. The "5% Rule": Copilot handles the structure, you tweak credentials and edge cases.

5% rulenatural languageiterative refinement
Core

RAG — Static & Web Search

Two-phase grounding: ingest documents into embeddings once (KV Store), or retrieve live web results at query time (Tavily). Either way, the LLM answers from real content instead of memorized guesses.

IngestDocumentKestraKVStoreTavilyWebSearch
Core

Agents

AIAgent runs an agentic loop: call the LLM → execute any requested tool → feed results back → repeat until done. You specify the goal; the agent decides how — including when to stop.

AIAgentagentic looptool use
Advanced

Multi-Agent Systems

One agent treats another AIAgent as a tool. An analyst delegates web research to a specialist agent, keeping each agent's responsibility narrow and easier to debug.

AIAgent as tooldelegationseparation of concerns
Production

Best Practices

Deterministic, repeatable workflows still win for compliance-critical steps — agents are for genuinely dynamic decisions. Track token cost, inject keys via secret(), rotate every ~90 days.

determinismsecret()token cost

Single Agent vs Multi-Agent

Single Agent

   Goal
    ↓
   LLM ──→ Tool
    ↑        ↓
 results ←───┘
    ↓
  Answer

Multi-Agent

       Goal
        ↓
  Analyst Agent
    ↓        ↑
  delegates  synthesizes
    ↓        ↑
 Research Agent (tool)
    ↓
Structured Report