Skip to content

Ai Agents

PART 17 — AI Agents

A basic LLM just answers a prompt. An Agent is an LLM given the ability to loop, think, and interact with the real world.

  • Tools / Tool Calling: Giving the LLM functions it can run (e.g., search_web(), execute_sql()).
  • State / Memory: Remembering what happened in previous steps of the loop.
  • Agent Loop: Think → Act → Observe → Repeat until goal is met.
User: "Find my error rate and email the team."
 ↓
Agent (LLM)
 ├── Think: I need to query the database.
 ├── Tool: execute_sql("SELECT count...")
 ├── Observe: Results returned.
 ├── Think: I need to send an email.
 ├── Tool: send_email(results)
 └── Observe: Sent. 
 ↓
Agent: "Done."

Why does an HLD engineer care?

Agents shift the architecture from synchronous request/response to asynchronous, long-running orchestration. You need message queues, state management, state recovery, and guardrails to stop the agent if it gets stuck in an infinite loop.