LyraLearn AI Learning Platform
Exams
← Module 9 Β· Agent Design Patterns
🎧 Listen

Agent vs Pipeline

The most valuable judgment in agent design is knowing when not to build one. Most needs that sound agentic are actually a deterministic pipeline β€” a fixed sequence of steps, a couple of which happen to be model calls. The guiding rule is simple: prefer the simplest thing that works, and reach for a true agent only when nothing simpler can.

Contrast diagram of a fixed deterministic pipeline with one model call versus an agent whose path branches unpredictably each run.

What a pipeline is

A pipeline is ordinary application code where you decide the control flow. The steps are known in advance and run the same way every time; the LLM is just one component inside a flow you wrote. LyraLearn's Tutor is the textbook example:

  1. Embed the learner's question.
  2. Retrieve the most relevant lesson chunks.
  3. Call the model once with that context.
  4. Return the grounded answer.

Every run takes that exact path. Nothing decides its own next step. This is a pipeline with a single model call β€” and for grounded Q&A it's the right design, not a compromise.

Why pipelines win by default

When the steps are knowable, a pipeline beats an agent on every axis that matters in production:

An agent gives all of this up. You only make that trade when you're getting something real for it.

When you actually need an agent

Reach for a true agent when the task is genuinely open-ended β€” when the steps honestly can't be enumerated ahead of time and depend on what earlier steps reveal. Signs you've crossed that line:

A research task that branches based on what it finds qualifies. Answering "which lesson covers temperature?" does not β€” that's retrieval plus one call.

The honest default: start with a pipeline. Add model calls where you need judgment, keep the control flow in your code, and only escalate to an agentic loop when a real task proves a pipeline can't express it. Most never will β€” and that, not the loop, is the sign of good design.

🧠 Quiz yourself on this lesson →

Ask the AI Tutor

Grounded in the course lessons β€” it cites its sources and says when it doesn't know.