Skip to main content

Choosing the Right Rice: Understanding Foundation Models in Agentic AI

The Culinary Architecture of Agentic AI β€” Part 2

Updated 15 min readMarkdown
Part of seriesThe Culinary Architecture of Agentic AI
Choosing the Right Rice: Understanding Foundation Models in Agentic AI

If you read the first article in this series, you saw the big picture of an agentic AI system.

We looked at the kitchen as an architecture:

Foundation models β†’ Tools β†’ Orchestration β†’ Frameworks β†’ RAG & Memory β†’ Communication β†’ Security β†’ Observability

But now it is time to walk inside the kitchen.

And the first thing we need to understand is the ingredient at the center of everything:

🍚 The Foundation Model

In our culinary analogy, the foundation model is the rice.

It is one of the most important ingredients in the final dish, but it is not the entire biryani.

That distinction is critical.

A model can reason over information, generate content, interpret instructions, and decide what it might want to do next.

But it doesn't automatically give an AI system:

  • persistent memory

  • access to your databases

  • API integrations

  • code execution

  • permissions

  • workflow management

  • observability

  • security controls

Those capabilities come from the other layers surrounding the model.

So before we start building agents, we need to understand what the model actually provides.


🧠 What Exactly Is a Foundation Model?

A foundation model is a model trained on large and diverse datasets so that it can be adapted to perform many different tasks.

Large language models (LLMs) are one important category of foundation models.

Instead of building a separate model from scratch for every individual task, a foundation model provides a general-purpose capability that applications can build upon.

For example, the same underlying model can potentially be used for:

  • answering questions

  • summarizing documents

  • generating code

  • extracting structured information

  • analyzing conversations

  • reasoning over a problem

  • interacting with tools

  • processing multimodal inputs, when supported

This is why foundation models became such an important building block for modern AI applications.

But there is an important misconception to remove early:

A foundation model is not an agent.

An agentic system is an architecture built around a model.


🍚 Why the Rice Analogy Works

Think about making biryani.

You can have excellent rice.

But rice alone isn't biryani.

You still need:

  • spices

  • vegetables or meat

  • water

  • cooking

  • timing

  • utensils

  • preparation

  • coordination

And eventually, you need someone or something coordinating the entire process.

Agentic AI works similarly.

                 FOUNDATION MODEL
                       β”‚
                       β–Ό
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚  Intelligence   β”‚
              β”‚  + Reasoning    β”‚
              β”‚  + Generation   β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β–Ό            β–Ό            β–Ό
        Tools         RAG         Memory
          β”‚            β”‚            β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β–Ό
                 Orchestration
                       β”‚
                       β–Ό
                 Agent System

The foundation model provides an important part of the intelligence.

The surrounding architecture turns that capability into an agentic system.


🧩 What Does a Model Actually See?

One of the first things to understand is that models don't receive your message in exactly the same form that you see it.

Consider:

"Deploy my application to production."

To us, that's a sentence.

Before a language model processes it, the text is converted into tokens.


🌾 Tokens: The Individual Grains

Tokens are the units of text that a language model processes.

A token might represent:

  • a complete word

  • part of a word

  • punctuation

  • whitespace

  • or another piece of text

The exact tokenization depends on the tokenizer and model.

Conceptually:

"Deploy my application"

          ↓

Tokenizer

          ↓

["Deploy", " my", " application"]

The actual tokens may differ from this simplified example, but the important idea is:

The model operates on tokens, not raw human sentences.

This becomes important for agentic systems because token usage affects things such as:

  • context capacity

  • latency

  • cost

  • how much information can be supplied to the model

And that brings us to the next important concept.


πŸ₯˜ Context Window: The Cooking Pot

Imagine that you're preparing biryani.

You have a cooking pot.

Everything currently being cooked together has to fit inside that working space.

The context window plays a somewhat similar role.

It represents the amount of information a model can process as part of a particular interaction, according to the model's supported limits.

For an agent, that context can contain much more than the user's original question.

It might include:

System instructions
        +
User request
        +
Conversation history
        +
Retrieved information
        +
Previous tool results
        +
Current task state
        +
Other relevant context

And the model uses that information when generating its next output.


⚠️ Context Is Not Memory

This distinction is extremely important.

People often say:

"The model remembers everything."

That's not a safe mental model.

Context is information supplied to the model for the current interaction or processing step.

Memory is an architectural mechanism that allows relevant information to persist beyond that immediate context.

For example:

Current context
      β”‚
      β”œβ”€β”€ User request
      β”œβ”€β”€ Previous messages
      β”œβ”€β”€ Tool results
      └── Retrieved documents

                ↓

             MODEL

Whereas persistent memory might look more like:

Past interaction
       ↓
Memory system
       ↓
Stored information
       ↓
Retrieved when relevant
       ↓
Current context
       ↓
MODEL

We'll explore RAG, embeddings, and memory much more deeply later in this series.

For now, remember:

Context is what the model has available now. Memory is how a system can retain useful information across interactions or tasks.


πŸ”₯ Inference: What Happens When the Model Runs?

When you send a prompt to a model, the model performs inference.

At a simplified level:

Prompt
  ↓
Tokenization
  ↓
Model inference
  ↓
Next-token probabilities
  ↓
Token selection
  ↓
More tokens
  ↓
Final output

A language model generates its response incrementally by predicting what should come next based on the information it has received.

This doesn't mean the model is simply "looking up the next word."

The model has learned complex patterns and representations during training, allowing it to generate responses that can involve language understanding, coding, reasoning, transformation, and other capabilities.


🎲 Why Can the Same Prompt Produce Different Answers?

Model generation can involve probabilistic sampling.

Parameters such as temperature can influence how deterministic or varied generation is, depending on the model and API.

Conceptually:

Lower variation
      β”‚
      β–Ό
More predictable outputs

Higher variation
      β”‚
      β–Ό
More diverse outputs

This matters for agentic systems.

Imagine an agent repeatedly deciding:

"What should I do next?"

If its generation is variable, its decisions can potentially vary as well.

That means agent behavior is not necessarily deterministic simply because the workflow is written in code.

This is one reason production agent systems need:

  • structured outputs

  • validation

  • guardrails

  • evaluation

  • controlled tool access

  • observability

Those aren't separate concerns.

They exist partly because the model itself is probabilistic.


🧠 But What About Reasoning?

This is where things become interesting.

A model can do much more than simply complete a sentence.

Depending on the model and task, it can be used to:

  • analyze a problem

  • break a problem into steps

  • compare alternatives

  • identify relevant information

  • produce structured plans

  • decide which action may be appropriate

This is one of the foundations of agentic behavior.

Consider:

User:
"Find why our deployment failed."

          ↓

       MODEL

          ↓

"I need deployment logs."

          ↓

      TOOL CALL

          ↓

     Log results

          ↓

       MODEL

          ↓

"I found an authentication error."

          ↓

      NEXT ACTION

Notice something important here.

The model isn't necessarily performing the entire operation itself.

It is participating in a loop involving the surrounding system.

That distinction becomes extremely important when we reach orchestration.


πŸ€– An LLM Is Not an Agent

Let's make this distinction explicit.

A model can generate:

"I should check the deployment logs."

But that doesn't mean it actually has the ability to check them.

Something outside the model needs to provide that capability.

For example:

             MODEL
               β”‚
               β”‚ "Check deployment logs"
               β–Ό
        TOOL / EXECUTION LAYER
               β”‚
               β–Ό
          Log system
               β”‚
               β–Ό
          Tool result
               β”‚
               β–Ό
             MODEL

The model provides the intelligence required to decide or interpret.

The tool provides the ability to act.

The orchestration layer determines how the interaction is managed.

This separation is one of the most important architectural ideas in agentic AI.


🧱 Model Capabilities vs Agent Capabilities

Here's a useful way to think about the boundary.

Capability Foundation Model Agent System
Generate language βœ“ βœ“
Interpret instructions βœ“ βœ“
Reason over supplied information βœ“ βœ“
Generate structured output βœ“ βœ“
Access external APIs β€” βœ“
Execute code β€” βœ“
Query a database β€” βœ“
Retrieve external knowledge β€” βœ“
Persistent memory β€” βœ“
Manage workflow state β€” βœ“
Enforce permissions β€” βœ“
Monitor execution β€” βœ“

The exact capabilities depend on the model and system architecture, but the architectural distinction remains useful:

The model provides intelligence; the surrounding system provides capabilities and control.


πŸ—οΈ Not Every Model Is the Same

Once you understand what a foundation model does, the next question naturally becomes:

Which model should I use?

And this is where things can become confusing.

There are many kinds of models and model offerings:

General-purpose language models

Designed to handle a broad range of language tasks.

Reasoning-oriented models

Designed for workloads where deeper multi-step reasoning is important.

Multimodal models

Can work across combinations of modalities such as text and images, depending on the model.

Smaller / efficient models

Useful when latency, cost, throughput, or local deployment constraints matter.

Open-weight models

Can provide greater control over deployment and customization, depending on the model's license and capabilities.

Proprietary hosted models

Typically accessed through a provider's API and can offer managed infrastructure and integrated capabilities.

The important point isn't memorizing model names.

Model names will change.

The architectural characteristics are what matter.


βš–οΈ Choosing a Model Is an Architecture Decision

Suppose you're building an agent that processes thousands of simple requests.

Using the largest available model for every operation may not make architectural sense.

Now imagine a different system that needs complex reasoning over a difficult task.

The requirements may be completely different.

Model selection can involve questions such as:

Capability

Can the model perform the type of reasoning or generation your task requires?

Context capacity

Can it handle the amount of information your application needs to provide?

Latency

How quickly does it need to respond?

Cost

What is the cost at your expected workload?

Tool use

Does the model support the structured interaction patterns your agent requires?

Structured output

Can it reliably produce the format your application needs?

Multimodal capability

Does the application need images, audio, or other modalities?

Deployment

Does the workload require a hosted API, self-hosting, or a particular infrastructure environment?

Privacy and governance

What restrictions apply to the data being processed and where it can be sent?

Reliability

How will the model behave across the actual workload rather than a handful of demonstrations?

These are engineering questions, not simply questions of:

"Which model is smartest?"


πŸ› One Biryani Doesn't Need Every Ingredient

Imagine you're cooking two completely different dishes.

You wouldn't automatically use:

  • the most expensive rice

  • every spice available

  • every cooking technique

  • every utensil

You choose ingredients based on the dish.

Agentic AI works the same way.

A model should be selected based on the job it needs to perform.

For example:

Simple high-volume task
        ↓
Efficiency + cost + latency
        ↓
Smaller / efficient model


Complex reasoning task
        ↓
Capability + reasoning quality
        ↓
More capable reasoning model


Image + text task
        ↓
Multimodal capability
        ↓
Multimodal model


Sensitive workload
        ↓
Privacy + deployment requirements
        ↓
Appropriate deployment model

There isn't a universal model that is automatically correct for every workload.


πŸ”„ Where the Model Fits Inside an Agent

Now we can bring all of this back to the architecture from Part 1.

A simplified agent loop might look like:

              USER REQUEST
                   β”‚
                   β–Ό
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚   MODEL   β”‚
             β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜
                   β”‚
              Decide next
                 action
                   β”‚
                   β–Ό
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚   TOOL    β”‚
             β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜
                   β”‚
              Tool result
                   β”‚
                   β–Ό
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚   MODEL   β”‚
             β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜
                   β”‚
             More actions?
                /      \
              Yes       No
               β”‚         β”‚
               └───┐     β–Ό
                   β”‚   Answer
                   β–Ό
                 Tool

The model sits inside a larger control loop.

And that gives us an important architectural insight:

An agent isn't created simply by putting an LLM inside a loop.

The quality of the system depends on everything around it:

  • what information reaches the model

  • which tools it can access

  • how actions are selected

  • how state is maintained

  • what happens when something fails

  • what permissions exist

  • how results are evaluated

  • how execution is observed

Those are the layers we'll explore throughout this series.


🧩 The Foundation Model Is the Beginning, Not the Finish Line

At this point, you should have a different mental model of an AI agent.

Not:

LLM = Agent

But:

                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                 β”‚    MODEL     β”‚
                 β”‚ Intelligence β”‚
                 β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β–Ό               β–Ό               β–Ό
     Tools           Memory            RAG
        β”‚               β”‚               β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β–Ό
                  Orchestration
                        β”‚
                        β–Ό
                    Security
                        β”‚
                        β–Ό
                 Observability
                        β”‚
                        β–Ό
                 AGENTIC SYSTEM

The foundation model is the core intelligence component.

But the agent is the system around it.


🧭 Why This Matters Before You Start Building Agents

This is where the bigger purpose of this series comes in.

Today, it is incredibly easy to create an agent.

You can install a framework, connect a model, add a few tools, and ask an AI coding assistant to generate the rest.

You might even get a working demo in minutes.

But here's the problem:

Getting an agent to work is not the same as understanding the agent you're building.

If you don't understand the components underneath it, you may not know:

  • why the agent is behaving unpredictably

  • why it keeps consuming context

  • why tool calls fail

  • why responses become expensive

  • why retrieved information isn't useful

  • why memory isn't behaving as expected

  • why a framework abstraction exists

  • where a security boundary should be

  • how to evaluate whether the system is actually improving

You end up debugging abstractions you don't understand.

And that is exactly what this series is designed to prevent.


🧠 The Mental Model to Take Away

If you remember only one thing from this article, remember this:

A foundation model is an intelligence engine, not a complete agent.

The model gives an agent capabilities such as language understanding, generation, and reasoning.

The surrounding architecture gives it:

Knowledge β†’ RAG

Memory β†’ Memory systems

Actions β†’ Tools

Coordination β†’ Orchestration

Communication β†’ Protocols

Protection β†’ Security & human oversight

Measurement β†’ Observability & evaluation

Together, these turn model capabilities into an actual agentic system.


🍚 From Rice to the Rest of the Kitchen

We've now looked at the ingredient at the center of our kitchen.

But there is an obvious problem.

Our model can decide:

"I need to perform this action."

Now what?

Can it open a terminal?

Can it query an API?

Can it modify a file?

Can it deploy infrastructure?

Can it search the web?

Can it execute code?

Not by itself.

It needs hands.

And that's where we go next.


πŸ”ͺ Next: Giving the Chef Hands β€” Tools & Execution

In the next article, we'll move from intelligence to action.

We'll explore:

  • what tools actually are

  • function/tool calling

  • APIs

  • code execution

  • sandboxes

  • browsers and external systems

  • action spaces

  • permissions

  • why tools dramatically expand what an agent can do

  • why giving an agent a tool is also giving it a potential risk

  • how tool design affects agent reliability

Because an intelligent chef without utensils can think about cooking all day.

It still can't cook. πŸ›


πŸ—ΊοΈ The Series So Far

01 β€” The Culinary Architecture of Agentic AI: A Blueprint for Autonomous Systems The complete map of the kitchen.

02 β€” Choosing the Right Rice: Understanding Foundation Models in Agentic AI The intelligence at the center.

03 β€” Giving the Chef Hands: Tools & Execution in Agentic AI Coming next β€” turning decisions into actions.


The goal isn't to memorize every AI framework or model.

It's to understand what exists underneath them.

Once you understand the architecture, the tools become much easier to understand.

About the author

  • I’m an engineer who enjoys turning messy engineering problems into simple, practical solutions. My work sits across AI automation, DevOps, SRE, cloud infrastructure, and developer experience. I like understanding why something is painful, finding ways to make it better, and building tools or workflows that reduce repetitive work and improve how developers operate. I write about the problems I encounter, the things I build, what I learn, and the ideas shaping modern engineering - from AI-assisted development and agentic systems to cloud automation, reliability, and developer tooling. I’m especially interested in the space where engineering, automation, and people meet - building useful technology and communicating it clearly.

No comments yet. Be the first to comment.

The Culinary Architecture of Agentic AI

Part 2 of 5

A layered guide to understanding how modern agentic AI systems are builtβ€”from foundation models and tools to orchestration, RAG, memory, agent communication, security, and observability. Using a culinary architecture metaphor, this series breaks down the components that turn an LLM into a reliable autonomous system.

Up nextGiving the Chef Hands: Tools & Execution in Agentic AIThe Culinary Architecture of Agentic AI β€” Part 3