For the student
One feature can be built three ways: one prompt, a fixed chain of steps, or an agent. They differ in who decides the next step, and that decides the cost, the speed and how each one fails. The prices in this lesson (₹0.50 and 2 seconds for each model call) are made up for the comparison; real prices differ.
The feature and the three designs
- The feature: a student asks the Campus Helpdesk the fee for a branch and year
- One prompt (a chatbot): the college's information page (office timings, the hostel fee) is pasted into the prompt and the model answers once. The fee for each branch and year is not on the page; it is in the accounts office's fee table
- Fixed chain (a workflow): the model picks out the branch and the year, your code runs
get_fee, which reads the fee table, and the model writes the reply - Agent: the model has
get_fee and find_notice and chooses its own next step in a loop, stopped after 6 model calls
The comparison
- Who decides the next step: nobody (one prompt), the programmer (fixed chain), the model (agent)
- Model calls: 1, 2, and lookups + 1 for the agent (at most 6)
- Cost at ₹0.50 a call: ₹0.50, ₹1.00, and up to ₹3.00
- Time at 2 seconds a call: 2 seconds, 4 seconds, and up to 12 seconds
- Same path every time: yes, yes, no
- How each fails: one prompt guesses what it cannot see; the chain misses questions off its path; the agent picks a wrong tool or takes extra steps
The three cases
- Asha's fee (CSE year 2) is only in the fee table: the fixed chain answers for ₹1.00 every time; one prompt would guess
- 1,000 questions a month: the chain costs ₹1,000, an agent averaging 4 calls costs ₹2,000, so ₹1,000 more
- Ravi's question needs
get_fee and find_notice: the agent answers in 3 calls (2 lookups + 1 answer), ₹1.50; the chain gives half an answer - Priya's hostel fee is printed on the information page: one prompt answers for ₹0.50
How to choose
- Write down ten real questions first
- Try one prompt; move to a fixed chain only when the answer needs data the prompt cannot see
- Move to an agent only when different questions need different steps
- Budget an agent for its step limit, not for its shortest run
Try it
- Pick a feature from your college or a shop and sketch it all three ways: one prompt, a fixed chain, an agent
- For each sketch, write who decides the next step, the model calls per answer and one way it fails
- Choose one design and give two reasons