Sitemap

When to build Agents and when not to

6 min read6 days ago

--

As a new parent, every night during my toddler’s bedtime, I have to come up with new stories, a close-to-impossible feat for me. So, over the weekend, I set out to build a storytelling web app with Claude and Replit.

Building with AI is the trend nowadays, and I feel that it is the right way as well, but with building products becoming faster more accessible, it is crucial to make a decision on what to build based on the expected outcome. For this app, the immediate thought would be to build a storytelling agent taking inspiration from Roald Dahl, Enid Blyton, or from our very own Panchatantra. But did I really need an agent for this?

Here’s a breakdown of what I have built and, more importantly, why I chose to build this way.

Goal

My goal is to help me generate good-quality user stories for children between ages 0 and 6. The stories should be in mundane, everyday setting in the Indian context. They should help the child understand regional words. The app is for parents to read to their children and not for children to read on their own.

As a Potterhead, I named it The Burrow, inspired by how comforting the Weasleys’ Home is not just for themselves but for everyone else associated with them.

Press enter or click to view image in full size
The Burrow

User inputs flow through code-level lookups that assemble six layers into one structured prompt:

  1. Story parameters — the scene, story length, and character gender resolved from a hardcoded mapping
  2. Cultural context — Tamil foods like idli and dosa, Kannada festivals like Ugadi, Delhi landmarks like busy markets — pulled from a Python dictionary
  3. Theme guidelines — what “courage” or “kindness” should look like in a children’s story
  4. Guardrails — no savior narratives, no social markers, no fantasy or frightening content, diverse religious names
  5. Language level — “very simple with basic words” for toddlers, “moderately complex with richer vocabulary” for five-year-olds
  6. Output format — JSON with three fields: title, content, moral

With this goal in mind, I did not want to spend money (token usage), did not want to wait too long for the story to be generated, and wanted to ensure the system sticks to a specific list of steps that I predetermine. For all these, an AI workflow suits best.

Anthropic describes 5 different types of workflows. One of them is Prompt chaining workflow.

In the company’s own words — A prompt chaining workflow is ideal for situations where the task can be easily and cleanly decomposed into fixed subtasks. The main goal is to trade off latency for higher accuracy, by making each LLM call an easier task.

Press enter or click to view image in full size
Prompt chaining workflow

In the Prompt chaining workflow, we can accommodate several LLM calls that pass sequentially one after another. This structure is followed so that if any LLM call fails, the loop exits.

The prompt chaining workflow is used in my app, except that there is a single LLM call which is made to Gemini 3.5 Lite and a JSON response is parsed back. I stuck to a single LLM call because my requirement in story generation is fairly straightforward and also because I did not want to bring in more latency with more LLM calls.

The variety in stories and their creativity comes from the model’s temperature setting and the user combinations. There is no story memory or deduplication, and every generation is independent.

For younger children, instead of human characters, a user can pick the child’s favourite animal. The story is simpler, with themes limited to respect, friendship, sharing, and kindness. I have added animal sounds too, especially for younger children, which can be played whenever the user chooses.

Fine-tuning the LLM guardrails

While the system generated stories, they weren't good enough for the kids and weren't in line with what I wanted. While it was tempting to go for a tool or copy an author’s writing style, I figured that all this could be done by specifying certain guardrails that would avoid extra LLM calls and keep it cost-effective.

The saviour trope

Get Priyadarshan Kempraj’s stories in your inbox

Join Medium for free to get updates from this writer.

For instance, I want the child themselves to be the savior in the story because I felt that kids should learn to pick themselves up. But the model kept generating stories that had teachers, other kids or parents in the saviour role.

“Veer’s first day at school was a bit dull, he sat alone at his lunch table. His teacher, Lakshmi Ma’am saw that and called everyone else to sit with him.” While this seems alright, it teaches the wrong lesson that there would always be someone else to sort out stuff. It might not be the right thing to say, especially for older kids. Instead, I wanted this version: “Veer was alone at his lunch table. So he took his home made ladoos and joined the other table, asking his classmates to taste the ladoos.” Same theme, completely different agency.

The fix was a prompt-level guardrail: no savior narratives where one character rescues another.

Big themes for developing minds

Feminism and inclusion are important values. But left alone, the model invented a dramatic situation no five-year-old would encounter. Not “feminism” in the abstract, rather, a girl playing what is stereotypically considered a boys’ game. The idea is to discuss these in mundane everyday settings such as Home, Daycare, Restaurant, etc.

But why is this not an agent?

At the outset, it looks like an agent because the model is making creative decisions such as choosing names for characters, deciding on themes, when to use vernacular language, and how the story flows, what the moral could be, etc. A human doing this job would be making multiple decisions. The output is intelligent, so the system feels intelligent. However, the intelligence is in generation, not in orchestration.

Anthropic’s definition of an agent —

Agents are systems where LLMs dynamically direct their own processes and tool usage, maintaining control over how they accomplish tasks.

OpenAI’s definition of an agent —

Agents are systems that independently accomplish tasks on your behalf.

Let’s see how the agent argument holds up against Anthropic’s parameters —

  • Does my system dynamically direct its own process?

The user fills the form based on which the prompt is assembled. Then the LLM API call happens, which helps render the story. The steps taken to arrive at the story are very similar across age groups. The LLM does not direct dynamically on its own.

  • Does the system choose tools?

The model does not have tools that are called. There is just an LLM call. We do not hit a storytelling platform’s API or read book API.

What would actually make it an agent?

If the model took action on its own by calling tools of its choice. For instance, if I stored the stories generated in a database and if, before generation, the model checks the database and regenerates stories based on what is already available, with the goal of creating new stories every time, then it could be an agent.

If the model decided on its own that ‘feminism’ is too abstract for a 5 year old and picked a more concrete theme instead then it is an Agent that is making the call. Right now, I handle that with a simple age-based mapping.

Open AI mentions 3 instances where you would need an AI agent:

- Complex decision-making

- Difficult-to-maintain rules

- Heavy reliance on unstructured data

The Burrow has none of these. The decision-making is straightforward. The rules are a set of guardrails that fit inside a single prompt. And the input is a simple form, not unstructured data the model needs to make sense of.

In summary, The Burrow provides stories that are enjoyable, and as the only user of the product, my kid has been loving it and listens to the stories very often, especially the stories regarding cats. He keeps asking for different cat colours, and now, adding those does not sound like a bad idea.

The Burrow is a living and breathing example that not every AI product needs to be an agent. If you control the flow and your guardrails fit in a prompt, a simple workflow will provide the solution in a simpler and more cost-effective way. You can save the agent for another day.

Check out https://the-burrow.replit.app/

Sources:

--

--

Priyadarshan Kempraj
Priyadarshan Kempraj

Written by Priyadarshan Kempraj

A Product Manager and a Marketer. Writes on business, users, and tech.