
Ask today and you get a PDF. Ask tomorrow and you get an Excel file. Why is AI like this?
Why AI gives different answers every time
AI gives non-deterministic results. Say I ask for a script for a video. One day it gives a PDF, the next day a spreadsheet, another day just text. Until we tell it exactly what we want, it gives output in whatever way it likes. Every LLM has this behaviour, because it's choosing likely words, not following fixed rules. (Read how LLMs work for the why.)
What is prompt engineering?
To make the output predictable, so it answers the exact way we want, we have to tell it precisely what we need. That's prompt engineering. If you want reliable answers from AI, in the format you want, every time, you need prompt engineering.
The RACE framework
For everyday work, a simple framework is RACE:
- R: Role Who should the AI act as? "You are a scriptwriter for 60-second Instagram reels."
- A: Action What exactly should it do? "Write a script on two-factor authentication."
- C: Context What does it need to know? "The audience is Kerala college students; the tone is friendly; the language is Malayalam."
- E: Expectation What should the output look like? "Plain text, with sections for hook, problem, main message and call to action, under 150 words."
Compare "write a reel script about 2FA" with the RACE version above. The second gives you the same shape of answer every time. Try it today: write one prompt with RACE for something you do every week.
AI agents: from telling to doing
A chatbot tells you how to do it. An agent does it for you. That's the difference.
Tell a chatbot "make me a video with this script", and it gives you the script and instructions on how to make the video. That's what a normal chatbot gives.
An AI agent, given the script and details of the video, works out where to create the audio, where to create the visuals, goes to those tools, edits the whole video and hands it to you. It's like assigning work to a person: they find what's needed and complete it.
Chatbot: "Book me a ticket"
- Lists booking websites
- Explains the steps
- You do the booking
Agent: "Book me a ticket"
- Checks the sites against your budget
- Books the best option
- "Done, booked for Friday"
So an agent can perform actions using tools. That's what makes agents different from normal chatbots. It's also why agents need careful guardrails and permissions: an agent that can book a ticket can also book the wrong one, and an attacker who tricks it with a malicious instruction (prompt injection) can make it act against you. Securing agents is a fast-growing job in itself.
How to learn this
- Prompting: practise RACE on real tasks; keep the prompts that work in a document.
- Agents: learn Python first. Agent developers connect a model to tools (search, email, calendars, APIs) with code.
- Security: learn how prompt injection works and how to limit what an agent is allowed to do.
Build agents, don't just use them
Python in Malayalam
Every agent is a model plus code that connects it to tools. Learn that code from scratch, online, explained in Malayalam.
Keep reading
Frequently asked questions
What is prompt engineering?
Writing instructions for an AI precisely enough that it gives the output you want, in the format you want, consistently.
What is the RACE framework for prompts?
A simple structure for prompts: Role (who the AI should act as), Action (what to do), Context (background it needs) and Expectation (the format and length of the output).
Why does ChatGPT give different answers to the same question?
LLMs are non-deterministic: they pick likely words with some randomness. A precise prompt with clear context and expected format makes the output much more consistent.
What is the difference between a chatbot and an AI agent?
A chatbot answers and gives instructions. An AI agent can use tools and take actions to complete the task itself, such as checking booking sites and booking a ticket within your budget.