Skip to chapter
Peanut learns to agentRead with page turns →

Chapter 01 of 12 · Aishwarya Ashok

Models and agents

Peanut gets a job

Begin with the model, then follow what changes when software can act. A predictable workflow and an agent can use the same model; the difference is who decides the next step.

Language model (LLM)

A large language model is a machine-learning model trained on large amounts of data to process and generate language.

A builder peanut reads a repair suggestion from a language-model machine; the chair and repair tools remain untouched beside it.
The machine has suggested a repair. The chair is waiting.Peanut is the builder here. The machine represents the language model; the tools beside the chair would turn its suggestion into action.

A generative language model produces a response from the input it receives, using patterns learned during training. That response may be prose, code, or a structured tool request. To turn a proposed repair into an action, an application needs tools and software to run them. This distinction becomes useful as soon as we start building agents.

Source & further reading

Technical reference: Language models ↗

Training versus inference

Training adjusts a model's learned parameters; inference uses a trained model to produce outputs from new inputs.

In two scenes, builder Peanut adjusts a model machine using example cards and feedback, then feeds it a new job and reads the response without changing its settings.
First, adjust the machine using examples. Then give it a new job.Peanut is the builder in both scenes. Adjusting the machine stands for training; using its learned settings for a new job stands for inference.

Training is where the model's parameters change through an optimization process. Inference is where the trained model computes a response. A document added to a prompt supplies information for that response; retraining would change the model itself. For a builder, this helps separate two decisions: what information to provide now, and whether additional training is warranted.

Source & further reading

Technical reference: Training and inference ↗

AI agent

A system that uses an AI model to choose and carry out actions toward a goal.

Peanut inspects a wobbling chair, pushes an orange shim under one leg, and presses the seat again to check the repair.
You asked for a steady chair. Peanut worked out the steps.Peanut represents the whole agent system here, choosing a repair, using a tool, and checking the result.

In an agent system, the model chooses an action and the surrounding software executes it through a tool. The result returns to the model, which can choose another action, ask for help, or finish. You supply the goal and constraints. How much the agent can do along the way depends on its available tools, permissions, and stopping rules.

Source & further reading

Technical reference: Building effective agents ↗

Deterministic workflow

A workflow whose next steps are determined by predefined rules and its inputs or state.

Peanut moves an orange parcel toward a large box beside a scale displaying 7 kg. A packing rule assigns parcels above 5 kg to large boxes and the rest to small boxes.
Heavy parcel, large box. The rule was settled before Peanut arrived.Peanut follows the written packing rule here. The measured weight determines which box it uses.

A predefined workflow can include branches, loops, and error handling. What makes its control logic deterministic is that the same relevant inputs and state select the same path. This is useful when the process is understood well enough to encode. A variable model response or changing external data can still produce different outcomes inside that fixed structure.

Source & further reading

Related distinction: Workflows and agents ↗

Agentic workflow

A process that includes model-driven decisions or actions, often alongside predefined software steps.

Peanut inspects a dented orange parcel beside a fork in a packing conveyor while other parcels continue toward the packing station.
Most parcels keep moving. A few need a closer look.Peanut supplies the model-driven judgment at the inspection fork. The rest of the packing line follows its usual steps.

You can introduce model judgment at one useful point in an otherwise fixed process. An incoming request might follow standard intake steps, then use a model to choose its handler. “Agentic workflow” is used broadly, so identify the actual decision the model owns. That tells a builder more than the label alone.

Autonomy

The degree of freedom an agent has to make decisions and take actions without further human input.

A peanut gardens inside a fenced flowerbed while a reviewer peanut outside considers a move-fence card with an empty approval box.
Peanut may tend the flowerbed. Moving the fence is a separate conversation.The gardening peanut is the agent. The fence marks its permitted work; the reviewer peanut represents the person who can approve a change to that boundary.

You might let a research agent browse freely while requiring approval before it emails a customer. That is a choice about autonomy.

Make the permitted decisions explicit, then support those boundaries with tool permissions and review gates. The agent’s freedom should fit the job it has been given.

Agent loop

The repeated cycle of model decision, action execution, and observation that moves an agent's work forward.

Four scenes show Peanut tightening a dripping tap, observing that it still drips, replacing a washer, and checking the repaired tap above a dry basin.
Check the drip, change the repair, check again.Peanut is the agent throughout. Each check supplies the evidence for its next action, including the final check that the leak has stopped.

Each tool result supplies evidence for the next model decision. A failed repair may lead to a different action; a successful check may end the run. The surrounding software keeps this cycle moving and applies stopping limits. This is how an agent can adapt its next step to what actually happened.

Source & further reading

Technical reference: Agents ↗

Reasoning model

An AI model trained to use intermediate reasoning computation to work through problems before or while producing a response.

Peanut draws an orange route on a final map at a drafting table, with several discarded route sketches beside it.
A few route sketches before the final map.Peanut is working through a problem with a reasoning model. The sketches stand for intermediate computation, not a readable record of the model’s internal processing.

Some models are trained to spend intermediate reasoning computation on a problem before or while producing a response. That extra work can help with tasks that require several connected steps. It also uses time and compute, and correctness needs to be assessed from the result. A visible explanation is distinct from a complete record of internal processing.

Source & further reading

Research example: DeepSeek-R1 ↗