Curriculum

Agentic AI · Workflow Orchestration

Agentic Workflows

Agentic workflows define structured sequences of LLM calls, tool uses, and branching logic. ReAct, Chain-of-Thought, and self-correction patterns enable reliable multi-step task execution.

The idea

An agentic workflow is a program where LLM calls are first-class steps. Unlike a single prompt, workflows support branching (if the model says X, take path A), iteration (retry until condition), and parallelism (fan-out to multiple sub-agents).

Chain-of-Thought (CoT): instruct the LLM to write reasoning steps before answering. Dramatically improves accuracy on arithmetic, logic, and multi-hop reasoning. Self-consistency samples multiple CoT traces and majority-votes on the final answer.

Self-Correction: after generating an answer, the LLM critiques it (using a separate prompt or a critic model), then revises. Effective when the model can detect its own errors—which is not always the case.

P(y★|x) ≈ Majority{P(yᵢ|x, "think step by step")}ᵢ₌₁ᴹ

Self-consistency: sample M CoT paths, majority-vote on the final answer y★.

What to hold onto

  • Structured OutputsForce LLM output to conform to a JSON schema (OpenAI JSON mode, Instructor library). Eliminates parsing errors and enables reliable downstream tool calls.
  • GuardrailsInput classifiers (prompt injection detection), output validators (toxicity, PII redaction), rate limits. Essential for production agentic systems.
  • Cost-Latency TradeoffChain-of-thought adds tokens and latency. For latency-critical paths, use smaller models or skip CoT. For accuracy-critical paths, always use it.

Live: Self-Correction & Reflection Workflow

Simulate an agent evaluating code output against unit tests and autonomously self-correcting errors.

Status: Unit Test Failed → Self-Correcting

Quick answers

What are Agentic Workflows?

Agentic workflows are structured programs where LLM calls, tool invocations, and branching logic are orchestrated into reliable multi-step pipelines. They enable complex automation tasks by combining reasoning patterns like Chain-of-Thought with deterministic control flow, error handling, and self-correction loops.

What is Chain-of-Thought prompting?

Chain-of-Thought prompting instructs an LLM to output intermediate reasoning steps before its final answer. This mirrors human problem-solving and dramatically improves performance on tasks requiring arithmetic, symbolic reasoning, or multi-hop inference. It can be elicited with the phrase "let's think step by step".