The User Prompt
It all starts with you typing a message. But the AI receives much more than just your words.
- ✍️Your text — the words you just typed
- 🧩Context — what this conversation is about
- 📋Instructions — rules for how it should behave
- 🕑Conversation history — everything said so far
- ⭐Your preferences — saved settings & style
- Opportunity: well-designed prompts and context = better answers with zero model changes.
- Risk: long conversations silently push out earlier context; costs scale with tokens.
- Metric: tokens per request, cost per conversation, context-window utilisation.
The AI Understanding Layer
The AI looks at patterns it learned during training to work out what you actually want.
what job to do: search for flightsFind Preference · A constraint — sort results
by price, lowest firstcheap Goal · Confirms the object of the search:
flights, not hotels or trainsflights Connector · Small words still help the AI
link ideas togetherto Entity · A real-world place —
the destination: Sydney, AustraliaSydney
- Opportunity: replace rigid forms and menus with “just say what you want”.
- Risk: misread intent = confidently wrong actions. Design confirmation steps for high-stakes intents.
- Metric: intent recognition accuracy, clarification-question rate, task abandonment.
The AI Model (LLM)
The Large Language Model predicts the most useful next word, based on patterns learned from billions of examples.
- Opportunity: it can handle inputs nobody wrote code for — the long tail of user requests.
- Risk: hallucination — fluent, confident, wrong. Never ship LLM output as ground truth for facts, prices, or policies without grounding (see RAG, Section 5).
- Metric: answer accuracy vs. human eval, hallucination rate, latency per response.
temperature, top_p) trade determinism for creativity. Generation is autoregressive: each emitted token is appended and the pass repeats. Weights are frozen at inference — the model learns nothing new while answering you.
Context & Memory
The same question can get a completely different answer — depending on what the AI knows about you.
Short-term memory
The current conversation.
…later…
You: “What’s my name?”
AI: “Sarah” ✓
Long-term memory
Saved preferences that persist across chats.
vegetarian restaurants”
External knowledge
Connected databases and APIs.
👥 CRM
🛒 Product catalogue
- Opportunity: injecting user profile + history into prompts is the cheapest quality win available.
- Risk: privacy & consent — users must know what’s remembered and be able to delete it. Wrong memories compound.
- Metric: first-response usefulness, follow-up questions per task, retention lift from personalisation.
Retrieval Augmented Generation (RAG)
Sometimes the AI needs information it was never trained on — like your company’s documents.
The model has never seen your company’s internal documents. Instead of guessing (and hallucinating), it looks the answer up first — like an open-book exam. 📖
- Opportunity: support bots, internal knowledge search, policy Q&A — without retraining any model.
- Risk: answers are only as good as the documents. Stale or contradictory docs = confident wrong answers with citations.
- Metric: retrieval hit rate, answer groundedness, deflection rate (for support), doc freshness.
AI Tools
AI can use tools to do things — not just answer questions.
- Opportunity: every API your product already has can become an AI capability.
- Risk: real-world side effects — wrong booking, wrong email, wrong payment. Define permissions, spending limits, and human-approval gates for irreversible actions.
- Metric: task completion rate, tool-error rate, human interventions per task.
book_table(time:"19:00", size:2); the runtime executes it and feeds the result back as a new message, looping until done. Standards like MCP make tools plug-and-play across apps. Guardrails live in the runtime, not the model.
From Chatbot to AI Agent
A chatbot tells you how. An agent does it for you. This is the biggest shift in modern AI.
You still have to do all of it yourself. 😮💨
- ✓Understands the goal
- ✓Checks your identity
- ✓Finds your account
- ✓Creates a reset link
- ✓Sends the email
- ✓Confirms: “Done — check your inbox ✉️”
- Opportunity: agents collapse multi-step workflows (10 clicks → 1 sentence). Huge for support, ops, and back-office work.
- Risk: autonomy needs trust: audit logs, undo, approval steps, and clear boundaries on what the agent may touch.
- Metric: end-to-end task completion, time-to-done vs. manual, escalation rate, user trust scores.
while not done: observe → reason → call tool → read result. The chatbot is a single model call; the agent is an orchestrated runtime with termination conditions, error handling, retries, and permission scopes. Same model — different harness.
How AI Agents Work Internally
Under the hood, every agent runs the same loop. Click any step — or watch it cycle.
- Planning: show the plan to users before executing — instant trust win.
- Reflection: this is your quality control; weak reflection = agents that “finish” badly.
- Risk: loops can run away — cap iterations, budget, and time. Metric: iterations per task, cost per task, self-correction rate.
Multi-Agent AI Systems
For complex tasks, multiple specialised agents work together — like a project team.
Research Agent
Finds customer needs
Product Agent
Creates the roadmap
Marketing Agent
Creates the campaign
Analytics Agent
Measures success
- Opportunity: specialised agents beat one generalist on complex workflows; you can also review/verify each other’s work (checker agents).
- Risk: coordination overhead, compounding errors passed between agents, and cost multiplication. Start with one agent; add more only when it measurably wins.
- Metric: quality vs. single-agent baseline, cost per completed workflow, hand-off failure rate.
The Full Journey, End to End
Everything you just learned, in one flow. Press replay and watch your prompt travel through the whole system.