All writing
Part 1 of 3Demystifying AI Agents

Demystifying AI Agents Part 1: Augmented LLM and Prompt Chaining

A no-fluff intro to AI Agents, why they're not as scary as they sound, and a look into the first two patterns: Augmented LLM and Prompt Chaining.

6 min read

So we're all living in this AI moment—where everyone wants to build something smart, something automated, something that feels like magic. And right in the center of all this noise, there's one buzzword that keeps showing up: AI Agents.

I'll be honest, they caught my eye too. The idea of a system that just does stuff for you—completes research, writes emails, schedules posts, fixes bugs—without needing constant human instructions? That's the kind of future I wanted to play with. But when I first heard about agents, they felt… advanced. Like something you needed to study before touching. So I told myself I'd wait until I "fully understood" AI and prompt engineering.

Turns out, that was the wrong move.

Because while agents can look like they're solving really complex problems, under the hood, they're often just a clever mix of AI calls arranged in the right order. They're not magic. They're just well-orchestrated workflows.

I've broken this series into three readable parts. Here's the lineup:

  • Part 1 (this one): What are AI agents? Why you shouldn't be intimidated. And we'll dive into the first two types: Augmented LLM and Prompt Chaining
  • Part 2: The next three—Routing, Parallelization, and Orchestrators
  • Part 3: Evaluators, Truly Autonomous Agents, and where I think this space is heading

At the core, an AI agent is just something that can perceive, decide, and act. Sometimes even learn. It could be something as simple as reading a prompt and triggering a few responses—or something as advanced as chaining multiple tools and models together. Either way, the goal is always the same: reduce human effort and move faster.

And the use cases? They're everywhere. A research assistant that answers questions using live web searches. A marketing bot that generates and schedules content. A DevOps helper that watches your logs and auto-fixes stuff. Once you get the hang of it, you'll see agents hiding in plain sight.

So that's what made me want to dig deeper—not into the hype, but the actual workflows. I wanted to understand what kinds of agents are out there and how each of them works.

Augmented LLMs

Let's start with the first one that's already reshaping how AI apps are built—Augmented LLMs.

Think of it like giving your language model superpowers. Instead of expecting it to know everything from its training data, we help it out by injecting fresh or domain-specific knowledge right when it's needed. That's the magic of augmentation.

So how do we do that? There are a few simple but powerful ways:

  • Vector search / RAG (Retrieval-Augmented Generation) – great for adding recent or private context
  • Function calling – where the LLM doesn't just talk, it takes action using your code
  • API or database injections – pull live data right into the response flow

When done right, it makes the LLM feel smarter, more grounded, and far more useful for real-world apps.

A few examples you've probably seen in the wild:

  • A customer support chatbot that pulls your order info from a database
  • A finance assistant that grabs live stock prices
  • A coding tool that fetches documentation or relevant StackOverflow answers mid-generation

These are all powered by Augmented LLMs.

Here's a TypeScript snippet I love using with the AI SDK, where the model is smart enough to call a tool that fetches weather data:

typescript
import { generateText, tool } from 'ai';
import { openai } from '@ai-sdk/openai';
import { z } from 'zod';
 
const result = await generateText({
  model: openai('gpt-4'),
  system: 'You are a weather assistant.',
  tools: {
    getWeather: tool({
      description: 'Get the current weather at a location',
      parameters: z.object({
        latitude: z.number(),
        longitude: z.number(),
        city: z.string(),
      }),
      execute: async ({ latitude, longitude, city }) => {
        const response = await fetch(
          `https://api.open-meteo.com/v1/forecast?latitude=${latitude}&longitude=${longitude}&current=temperature_2m,weathercode,relativehumidity_2m&timezone=auto`
        );
 
        const weatherData = await response.json();
        return {
          temperature: weatherData.current.temperature_2m,
          weatherCode: weatherData.current.weathercode,
          humidity: weatherData.current.relativehumidity_2m,
          city,
        };
      },
    }),
  },
  prompt: 'What is the weather like in San Francisco today?',
});
 
console.log(result.text);
// → "In San Francisco today, it's 22°C and sunny."

And to visualize what's happening under the hood, here's a simple diagram that shows how the LLM and external tools work together:

Diagram showing how an Augmented LLM coordinates with external tools

All of this boils down to one simple thing: instead of forcing your model to guess, you guide it with context. That's what makes Augmented LLMs such a foundational building block for AI agents.

Prompt Chaining

After getting comfortable with Augmented LLMs, the next pattern I explored was something that felt oddly familiar—Prompt Chaining.

If you've ever broken a big task into smaller steps just to make it manageable, congratulations—you've already understood the core idea.

Prompt chaining is all about splitting a problem into a sequence of prompts, where each one handles a small part of the job. The output of one becomes the input to the next. This makes things modular, easier to debug, and way more controlled than tossing everything into one giant prompt and hoping for the best.

It's like thinking out loud in steps—except your assistant happens to be GPT.

You'll see prompt chains used all over:

  • Generating a blog outline first, then fleshing out each section
  • Pulling data from messy text, summarizing it, and converting it to clean JSON
  • Classifying a user's intent, and then picking the next action based on that result

What I love most about chaining is that it makes the reasoning more interpretable. You're not just reading the final result—you get to see how the model got there.

Here's a simple example using the AI SDK. The first step summarizes a sentence, the second formats that summary into a tweet. Simple, scoped, and easy to reuse:

typescript
import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
 
const step1 = await generateText({
  model: openai('gpt-4'),
  prompt: 'Summarize this: "AI agents are evolving from simple bots to autonomous systems that reason, plan, and act."',
});
 
const step2 = await generateText({
  model: openai('gpt-4'),
  prompt: `Turn this summary into a tweet:\n\n${step1.text}`,
});
 
console.log(step2.text);
// → "AI agents are evolving fast—from bots to reasoning, planning, autonomous systems. Exciting times!"

And here's a quick visual to show how the steps connect:

Diagram showing how prompt chaining steps connect in sequence

When you start combining these chains with other techniques like augmentation or tool calling, that's when it really starts to feel like you're building an intelligent system—one block at a time.

That's a wrap for Part 1.

We walked through what AI Agents really are, broke the myth of complexity, and explored the first two foundational patterns—Augmented LLMs and Prompt Chaining. These might seem simple on the surface, but trust me, they're powerful building blocks that unlock a ton of use cases when combined thoughtfully.

In the next part, we'll dive into Routing, Parallelization, and the role of an Orchestrator—the pieces that bring scale, coordination, and real-time decision-making into play.

It gets more exciting from here.

Stay tuned for Part 2.