logo

Command Palette

Search for a command to run...

Goals & LLM's

Thrusday, July 31
Tech

Lately, I've been obsessed with Agentic Systems. If you use X or LinkedIn, you've probably seen the terms AI agents, AI Workflows and statements like "Automate your work", "This agent will replace you", etc. While the demos are exciting, I found myself wanting to cut through the hype and understand how they really work from the ground up.

So, I decided to go back to first principles. Forget the fancy frameworks for a moment. If I were to build a system that uses an LLM to complete a goal, what are the absolute, non-negotiable building blocks?

This is the first in a three-part series where I'll share my journey of breaking down agentic systems into simple, logical components. Let's start at the very beginning.

It All Starts with a Goal (G)

Before you can build anything, you need to know what you want to accomplish. Every system is built to achieve a Goal. Think of a goal G as:

  • A desired final state (“Send an email”, "Get morning coffee").
  • A success recogniser R—something (or someone) that can say, “Yes, we’re done.”
Keep it simple: for now, R is just a yes/no switch. Later can refine it to handle “good-enough” cases.

As I thought about it, I realized not all goals are same. To get organized, I sorted them into three simple categories:

  • Class A: The "Recipe Exists" Goals. These are goals that I know are achievable because a procedure to get them done already exists . A perfect example is booking a flight from SF to New York for next Tuesday. It might have a few steps, but there is a known, reliable path to get it done.
  • Class B: The "Figure It Out" Goals. These are goals where I don't know for sure if there's a clear path to success . My goal might be to "write a viral blog post." I can try different things, but there's no guaranteed recipe for virality. The procedure is open-ended, and I just have to keep working until I (hopefully) complete the goal.
  • Class C: The "Nope, Can't Do It" Goals. These are goals that are known to be impossible under the rules of our universe . For instance, if my goal is to "Building a perpetual motion machine" no procedure in existence—no matter how clever—is ever going to achieve it . We can safely ignore these for now.

Enter the Procedure (ρ)

For any achievable goal (Class A or B), I need a Procedure (ρ). This is just my term for any finite recipe that produces actions to move me closer to my goal .

This "recipe" isn't just a simple checklist. In my definition, a procedure can be sophisticated:

  • It can be adaptive, changing its actions based on new information.
  • It can use randomness to try different things.
  • It can even consult oracles (or experts) when it gets stuck.

With a Class A goal, at least one ρ already exists. For Class B we may have to discover ρ, and Class C means no ρ will ever work.

The Superpower: LLMs as Action-Takers

This is where things get exciting. We have this incredible new tool: the Large Language Model (LLM). We can think of LLM as an intelligent black box that takes text as input and produces relevant text as output.

But the real "aha!" moment comes with that we can instruct the LLM to output its response in a structured format, like JSON or a list of actions.

Why is this a superpower? Because structured text isn't just for reading; it's for doing. We can use the LLM's output into a direct command to run any other part of the system as we already know which how its format gonna be.

For example, We can give the LLM a prompt:

"I want to know the weather in New York."

But the LLM does not have real time knowledge. So instead of just getting a sentence back, We can tell it to give me a command:

{ "function": "get_weather", "parameters": { "city": "New York" } }

Now we can use this output to run the function get_weather with the appropriate parameters. Suddenly, the LLM has gone from a conversationalist to an action-taker. It’s the engine we can use to execute the individual steps in any procedure.

Next Up: Assembling the Pieces

So, we have three foundational building blocks:

  • A clear Goal.
  • A Procedure to achieve it.
  • An LLM to execute the steps in that procedure.

Now a question arises that sits at the heart of modern AI design: Who is in charge of creating the procedure to reach the goal?

Am I, the human, writing the step-by-step recipe? Or am I giving the LLM the end goal and trusting it to figure out the recipe on its own?

How we answer that question is, the core difference between a Workflow and an Agent. And that's exactly what I'll break down in Part 2.