AI EngineeringInterview preparation
Intermediate·Concept·2 min read

Agents, chatbots, and workflows

Practice this question

🔴 MUST KNOW · 🟠 SHOULD KNOW for multi-agent systems.

Overview

  • An AI agent is software that uses a model to choose actions toward a goal, observes results, and decides what to do next within application limits.
  • A chatbot describes a conversational interface; it may or may not contain an agent.
  • A workflow defines the execution process, often with steps and transitions chosen by the developer.

Why this matters

Some requests require choosing between searching, using tools, asking for missing information, or escalating.

An everyday example

An assistant can decide which department to contact, while a checklist specifies a fixed onboarding process.

A technical example

“Help me submit a claim” may require policy lookup, a missing-date question, invoice retrieval, and a draft submission.

How it works

  1. Establish goal and allowed tools
  2. Model proposes next step
  3. Backend validates/executes
  4. Model receives observation
  5. Repeat until completion, approval, failure, or budget limit.

Architecture and flow

See the loop below.

The insurance assistant example

A claims assistant gathers information adaptively but the final claim service enforces eligibility and submission rules.

When to use it

Variable language-driven tasks where the next safe step genuinely depends on observations.

When to avoid it

A known “validate → calculate → save” flow should stay ordinary code or a deterministic workflow.

Interview answer

“An agent lets a model choose bounded next actions. I keep permissions, business rules, budgets, and consequential commits outside model discretion.”

Benefits, trade-offs, and production considerations

  • Agent autonomy increases variable latency, cost, and failure paths.
  • Start with one model call or a fixed workflow, then add autonomy only for measured needs.
  • A framework does not define the agent's trust boundary for you.
Architecture at a glanceFollow the arrows to see how the parts connect.

Preparing the architecture diagram…

Read the full diagram flow
flowchart TD
  G[Goal and trusted task state] --> M[Model proposes next step]
  M --> D{Decision type}
  D -->|Read/search| T[Validate and authorize tool]
  T --> O[Observation]
  O --> B{Budget and progress check}
  B -->|Continue| M
  B -->|Stop| E[Escalate or report failure]
  D -->|Missing information| Q[Ask user and persist state]
  D -->|Consequential write| H[Human approval and business validation]
  D -->|Complete| V[Validate final answer]
  • Goal defines success.
  • Trusted task state carries verified progress.
  • The model proposes, the decision branch constrains, and the tool layer enforces permissions.
  • Observations feed the next decision.
  • Budget checks prevent loops; approval and final validation control external effects and user-visible output.
Adapted from 13_AI.MD · “Agents, chatbots, and workflows”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.