Agentic AI Patterns

Course Content

Agentic AI Patterns

9 sections · 50 lessons

How does Agentic AI support task-level customization in complex workflows?


What you need to know

The levers you can vary

LeverExample variation
Task specGoal, constraints, output schema, tone
Tools and permissionsClient A's agent can approve payouts; client B's cannot
Model and reasoning effortSmall model for simple triage; strong model for adjudication
Retrieval scopeEach client's policy documents only
Budgets and approval thresholdsApprove above Rs 25,000 for one client, Rs 1 lakh for another
EvaluationA golden set per configuration

Configuration as validated data

Python
from dataclasses import dataclassALL_TOOLS = {"get_claim", "get_policy", "request_document", "calculate_payable", "approve_payout"}@dataclass(frozen=True)class TaskConfig:    client: str    model: str = "medium"    tools: frozenset = frozenset({"get_claim", "get_policy", "request_document"})    approval_above_inr: int = 100_000    max_steps: int = 12    tone: str = "formal"    has_golden_set: bool = False    def __post_init__(self):        unknown = self.tools - ALL_TOOLS        if unknown:            raise ValueError(f"{self.client}: unknown tools {sorted(unknown)}")        if not self.has_golden_set:            raise ValueError(f"{self.client}: no golden set, cannot ship")        if not 1 <= self.max_steps <= 30:            raise ValueError(f"{self.client}: max_steps out of range")

Safe defaults live in the class. A client config overrides only what it needs. Invalid configs, such as an unknown tool or no golden set, fail at load time, not in production. The orchestrator reads the config and renders the prompt, tool list and limits from it.

Avoiding sprawl

  • One shared base prompt; configs fill a small set of approved slots.
  • Schema-validated configs, reviewed like code.
  • CI runs each active config's golden set on every shared change.
  • Retire configs nobody uses.

A real-life example

A third-party administrator processes health-insurance claims for 30 corporate clients, each with different group-policy rules.

  • Before: the team had copied the agent's prompt per client. After a year there were 30 prompts. A fix to how room-rent caps were read went into 11 of them; the other 19 kept the bug for months.
  • After: one graph, one base prompt, and 30 config records. Client differences: which clauses apply, approval thresholds (Rs 25,000 to Rs 2 lakh), whether maternity cover exists, and the letter tone. Each client has 40 to 80 golden cases.
  • A shared-prompt change now runs about 1,800 golden cases across all clients in CI. When a change improved 28 clients but broke 2 with unusual co-pay rules, CI caught it before release.

Follow-up questions to expect

  • "When is a separate agent justified?" — When the task is truly different (different tools, different goal), not just different parameters.
  • "How do you let clients customise tone without prompt injection?" — Offer choices from a fixed list, not free text inserted into the system prompt.
  • "How do you test many configs cheaply?" — Share cases where the configs agree, and add targeted cases only for each config's differences.