Free course · read lesson 1 without signing up

AI Engineering: RAG & Fine-tuning

Go beyond prompts — context engineering, tokenizers, embeddings, vector databases, RAG pipelines and fine-tuning, hands-on.

100% free English & हिंदी

6 lessons · ~78 min

What you will learn

Lesson 1 — read it free, no signup

This is the real first lesson, not a sample.

Your prompt was perfect — so why was the answer wrong?

Here is a scene every AI engineer knows. You polish a beautiful prompt, send it... and the model answers using some stale detail from twenty messages ago. The problem was not your sentence — it was everything else sitting in the context window with it. Context engineering is the discipline of deciding what goes into that window: which instructions, which examples, which documents, how much chat history. Prompt engineering (our Prompting course) teaches you to word one message well; context engineering manages the whole window. Think of packing one small suitcase for a wedding trip: everything wants in, but only what earns its place gets packed. 🧳 As models get smarter, this packing skill starts to matter more than clever wording. ✨

The context budget: every token pays rent

The window has a fixed size, and four things compete for it: your instructions, your examples, the chat history, and any retrieved documents (hello, RAG). Beginners assume more context is always safer. It is not. Stuffing in an 80-page policy manual when two sections answer the question gives the model more places to get lost — accuracy drops — and on paid APIs every extra token is billed, so the bloated prompt also costs real money. 💸 Picture a call centre bot at an IT services company: feed it only the leave-policy section for a leave question and it answers crisply; feed it the whole HR manual and it may confidently quote the travel policy instead. A good context engineer treats the window like a budget: every line must earn its place. Trimming context is not laziness — it is the engineering. 🎯

One fixed context windowinstructionsexampleschat historyretrieved docsall four compete for the same limited space

Placement: where you put things changes what gets seen

Researchers testing long contexts found something odd, now nicknamed lost in the middle: models recall information placed at the start and end of the context best, while facts buried in the middle get missed far more often. Remember the tip from our prompting course — keep the key instruction near your latest message? This is the science behind it. So place critical rules and the actual question near the end, and let bulky reference material sit earlier. Then help the model navigate: structure the context into clearly labelled sections — headings, or simple XML-style tags like rules or data written in angle brackets — so it can jump straight to "the rules" instead of re-reading everything. A well-labelled context is like a well-labelled masala dabba: the right thing turns up in seconds. 🏷️

Long chats: summarize, truncate, or write it down

A long-running chat eventually overflows the window, and you must choose what happens to old history. Truncate means simply dropping the oldest messages — cheap and fast, but early decisions vanish. Summarize means compressing old turns into a short note — a little slower, but the gist survives. Real-world example: Claude Code (from our AI-coding course) runs compaction — when its window fills, it summarizes the older part of the session to make room while keeping the important instructions. 🧹 The third trick is the most elegant: rules that must never be forgotten do not belong in chat history at all. Put them in a persistent rules file — Claude Code re-reads CLAUDE.md fresh every time, so those instructions survive any compaction — instead of repeating them message after message. The same trade-off appears everywhere: a customer-support bot might keep a one-line summary of every old ticket but the full text of only the latest one. History is rented space; a rules file is owned. 📌

💡 Before adding anything to the context, ask one question: does the model need this to answer THIS request? If not, leave it out — a lighter window is a sharper (and cheaper) window.

One skill behind everything that comes next

Step back and the pattern appears. RAG is context engineering: out of a million stored chunks, which three deserve window space? Agents are context engineering: which tool results and notes does the agent carry into its next step? Long chats are context engineering: what gets summarized, what gets dropped, what lives in a rules file? Master the window, and the rest of this course — building RAG pipelines, tuning retrieval, deciding when fine-tuning is the better tool — becomes a series of sensible packing decisions instead of mysteries. Our railway slogan says mind the gap; a good AI engineer also minds the window. 🚆 Keep that packing instinct sharp — every lesson ahead leans on it. ✨

+ 4 practice questions in this lesson, inside the app

Signup is free and only saves your progress, exam and certificate.

Free AI & job skills, in English & हिंदी.

Back to Skill the Gap