Module 2 · Lesson 4 of 8

Our event assistant has found a venue for $800 and catering for $25 per guest. With 40 guests, the total is $1,800 before other costs.

Adding these amounts does not require an autonomous agent. It requires a calculation. Deciding whether a formal dining room suits a relaxed community gathering is a different kind of task.

Different steps need different kinds of work

A step in a workflow can be called a node. Before connecting nodes, decide what each one actually does.

A function node, as we use the term here, follows a procedure written in code. It might add prices, check capacity, or fetch a booking record. An agent node delegates some choices about how to do the work to a model.

There is also a useful middle case: a fixed model call. “Summarize this venue description in three sentences” uses a model, but its place and purpose in the workflow are already specified.

Three ways to handle a step

  • Ordinary function: calculate 800 + (25 × 40).
  • Fixed model call: summarize the supplied venue description.
  • Agent: investigate whether a venue fits the event, choosing follow-up searches as needed.

An agent can be implemented as a function

These labels describe responsibilities, not mutually exclusive programming types. A Python function can run an entire agent loop. In LangGraph, nodes are functions that receive state and return updates; those functions can contain ordinary code or model-driven behavior.

This implementation detail is documented in the LangGraph Graph API.

That means looking for the word “function” in source code will not tell you whether a step is agentic. Ask what decisions the implementation leaves to the model.

Defined code does not mean an unchanging result

A calendar lookup follows the same code while returning different availability tomorrow. A function can also use randomness or call a model. The useful distinction is whether the procedure is specified, not whether every possible output is identical.

Likewise, an agent does not automatically need more time than every function. A slow external service can dominate either design. Agent loops often add model calls and variable work, so their costs should be measured rather than assumed.

Choose the smallest useful responsibility

Keep exact arithmetic and explicit eligibility rules in code. Use a fixed model call when one bounded interpretation is enough. Give an agent a wider task when it needs to discover which actions are necessary.

For our event, a venue-research agent may be useful. A separate “addition agent” has no clear benefit. Its impressive name would obscure a simple calculation.

A useful design question is: can we already describe the procedure clearly? If yes, start there. Introduce model-directed choices where they solve a real uncertainty.