How to learn AI, ML and Agentic AI engineering — the path I actually walked

A learning path written by K Laxman, a Senior AI Engineer who ships production Generative AI systems — not a generic link list. It starts from "you can already code" and goes straight at large language models, retrieval and agents. Every stage ends in something you build, and links to the production system it was used to build.

The order is the argument: LLM fundamentals → RAG → Agent loops → Tools / MCP → Harness engineering → Evals + tracing → Production architecture → System design.

27 stages across 8 tracks, about 66 hours of study plus the builds. 45 of 46 resources are free.

Choose a path

Projects to build — Generative AI and agentic engineering

  1. Token and cost lens (Foundation, ~4h). A small CLI or web page that takes a prompt and shows its tokens, its cost across three providers, and how much of a 128k window it uses — then the same for a Hindi or Telugu version of the text. Done when: You can predict a monthly bill from traffic numbers within 20%.
  2. Structured extraction service (Foundation, ~8h). An API that turns invoices, resumes or receipts into validated JSON: schema-constrained output, a parse-or-repair retry, business-rule checks, and a 30-document labelled test set. Done when: Field-level accuracy on your test set, and a logged repair rate.
  3. RAG over your own documents, with evals (Core, ~16h). A question-answering bot over a real corpus (your notes, a product's docs). Hybrid search, a reranker, cited answers, a refusal when nothing relevant exists — and a recall@k and answer-quality report. Done when: Recall@5 and answer accuracy before and after each change, in the README.
  4. An agent loop with no framework (Core, ~10h). A while loop, three real tools (search, a file read, a calculator or database query), typed arguments, a step limit, a cost ceiling, an approval gate before any write, and a trace of every step. Done when: Task success rate on 20 tasks, with average steps and cost per task.
  5. Workflow patterns, then the same thing as a graph (Core, ~10h). Implement routing and evaluator-optimizer in plain code. Then rebuild the evaluator-optimizer as a LangGraph graph with a conditional edge and checkpointing, and compare the two honestly. Done when: Quality, latency and cost for each version on the same 20 inputs.
  6. An MCP server for a system you use (Core, ~8h). Expose something real — your RAG bot, a database, a calendar, a GitHub repo — as an MCP server with a few well-named, well-described tools. Use it from an MCP client, then improve the tool descriptions using failed transcripts. Done when: Correct-tool-choice rate before and after rewriting the descriptions.
  7. A long-running coding agent harness (Advanced, ~20h). Wrap an agent so it can build a small app across many sessions: an initializer that writes a feature list marked pass/fail, a progress file each session reads first, one feature per session, tests or a browser check before every commit. Done when: Features passing after N sessions, and how often a session broke a passing feature.
  8. A multi-agent research assistant (Advanced, ~16h). A lead agent that plans, three parallel sub-agents that search and summarise with citations, and a final synthesis. Compare it with a single agent on the same questions. Done when: Quality per question (judged against your rubric) and tokens per answer, single vs multi.
  9. Evals and tracing in CI (Advanced, ~10h). Take any project above and add a regression suite that runs on every change: code-based graders first, an LLM judge you have checked against your own labels, traces stored per run, and a build that fails when the score drops. Done when: A pull request that was blocked by your eval, and the example that caught it.
  10. A real-time voice agent that survives outages (Capstone, ~24h). Streaming speech in and out, a fast path that answers within a latency budget, slow tools run asynchronously, and failover to a second LLM and TTS provider when the first one times out. Done when: p95 time-to-first-audio, and a recorded session with the primary provider switched off.
  11. Ship one to real users (Capstone, ~30h). Pick the project above you are proudest of and put it in front of people: authentication, rate limits, a cost ceiling, monitoring, a fallback, and a short write-up of the architecture and its numbers. Done when: Real users, a dashboard, and a one-page write-up you could walk an interviewer through.

AI — Understand the model, then ground it in your own data

The most common job going, and the one with the widest gap between a demo and something you would put in front of a customer. Understand what the model actually is, then learn to feed it your data without it inventing things.

Track 1 — LLM fundamentals

Understand the thing everything else sits on (~6 hours)

If you only ever do one item on this page, do the first one. Almost every confused conversation I have about AI systems traces back to someone never having watched this.

The whole pipeline, end to end

You can trace a token from raw internet text all the way to a chat reply, naming every stage.

pretraining · tokenisation · transformers · inference · SFT · RLHF · hallucination · tool use · reasoning models

In short:

  1. Pretraining makes a document completer. Trained to predict the next token over a huge slice of the internet, the base model continues text. It does not follow instructions yet.
  2. Post-training makes an assistant. Supervised fine-tuning on example conversations, then reinforcement learning from human (or AI) feedback, turns the completer into something that answers.
  3. Hallucination is the default. The model always produces a fluent continuation. Unless training taught it to recognise what it doesn't know, a confident guess is the most likely text.

Build this — Re-implement decoding. Take any provider that returns logprobs and implement greedy, temperature and top-p sampling yourself. Write a README explaining, in your own words, when you'd use each. It is thirty lines of code and it makes §0.5 permanent.

You're done when: You can explain, without notes, why a model hallucinates confidently rather than saying 'I don't know'.

Common traps:

Check yourself:

  1. Why does a model hallucinate confidently instead of saying "I don't know"? Answer: It was trained to produce likely text, and in its training data questions are usually followed by confident answers. Saying "I don't know" has to be specifically trained in, and it only works for things the model can tell it doesn't know.
  2. What is the difference between a base model and an assistant model? Answer: The base model continues documents. The assistant is the same network after SFT and RLHF, trained to respond to instructions in a conversation format.

Put to work in: Jarvis — six interchangeable providers behind one loop · CAMSCode — enterprise AI coding assistant

Getting output your code can actually parse

You can make a model return JSON your program can trust, and you know what to do the one call in a thousand where it doesn't.

JSON schema · constrained decoding · refusals · repair passes · streaming partials

In short:

  1. Ask for a schema, not "JSON please". Provider structured-output modes constrain decoding to your JSON schema, so the reply is valid JSON of the right shape — not just valid-looking text.
  2. Valid is not correct. The schema guarantees shape. It says nothing about whether the values are true. Validate the business rules in your own code.
  3. Plan for the one in a thousand. Refusals, truncation at the token limit and schema features the provider doesn't support all still happen. Parse, and on failure repair once or fail cleanly.

Build this — A parse-or-repair loop. Ask for a schema, parse the reply, and on a parse failure send the error text back for one repair attempt before giving up. Log how often the repair fires. That number is the difference between a demo and something you can put in front of a customer.

You're done when: You can say what your system does when the model returns prose instead of JSON — and it isn't 'crash'.

Common traps:

Check yourself:

  1. The model returns prose instead of JSON. What does your system do? Answer: Catches the parse error, sends the error text back for one repair attempt, and if that also fails, returns a clear error or fallback — logged and counted.
  2. The JSON parses and matches the schema. What can still be wrong? Answer: The values. A date can be in the wrong year, a total can fail to add up. Schema validation checks shape; your own checks cover meaning.

Put to work in: CAMSCode — enterprise AI coding assistant · Intelligent document processing

Track 2 — Retrieval-Augmented Generation

The part most people do badly (~10 hours)

Everyone can build a RAG demo in an afternoon. Almost nobody can tell you why theirs returns the wrong chunk. The difference between those two people is this track — and the eval set at the end of it.

RAG properly — all fifteen techniques

You can name, and choose between, the retrieval strategies. Not just 'embed, store, search'.

indexing · retrieval · generation · multi-query · RAG-Fusion · query decomposition · step-back prompting · HyDE · routing · query construction · multi-representation indexing · RAPTOR · ColBERT · CRAG · adaptive RAG

In short:

  1. Three stages, three failure points. Indexing (split and embed), retrieval (find the right chunks) and generation (answer from them). A wrong answer came from exactly one of them.
  2. Most techniques fix the query or the index. Multi-query, HyDE, step-back and decomposition rewrite the question; multi-representation indexing and RAPTOR change what gets stored. Each fixes a specific miss.
  3. Corrective and adaptive RAG add judgement. Grade the retrieved chunks before answering, and re-retrieve or fall back when they are weak, instead of generating from whatever came back.

Build this — RAG over your own notes — plus a 30-question eval set. The bot is the easy half. The assignment is the eval set: thirty real questions with known answers, and a score you can quote. Without it you have a demo, and you will not be able to tell whether tomorrow's change helped.

You're done when: Given a wrong answer, you can separate retrieval failure from generation failure in under a minute.

Common traps:

Check yourself:

  1. An answer is wrong. What is the one-minute test that tells you where? Answer: Look at the retrieved chunks. If the answer isn't in them, it's a retrieval failure. If it is and the model still got it wrong, it's a generation failure.
  2. When does HyDE help? Answer: When questions are short and phrased very differently from the documents. Embedding a hypothetical answer lands closer to real answers than the bare question does.

Put to work in: CAMS Lens — SEBI-grounded compliance intelligence · Agentic Research & Decision Intelligence Assistant

Chunking — the decision that quietly decides everything

You can explain why your chunk size is what it is, instead of because a tutorial said 512.

fixed vs semantic splitting · overlap · chunk size vs recall · metadata on the chunk · contextual retrieval

Interactive explainer on the live page: context budget — You can explain why your chunk size is what it is, instead of because a tutorial said 512.

In short:

  1. The chunk is the unit of retrieval. You can only retrieve what you stored. If the answer is split across two chunks, or buried in a huge one, retrieval can't deliver it cleanly.
  2. Size is a trade-off. Small chunks match precisely but lose context; large chunks keep context but dilute the embedding. Overlap reduces boundary losses at the cost of duplication.
  3. Give each chunk its context. Prepending the document title, section heading or a short generated summary (contextual retrieval) makes a chunk findable on its own.

Build this — Same questions, four chunkings. Take the eval set from the stage above and run it against four indexes: 256 fixed, 512 fixed, 512 with overlap, and semantic. One table, four scores. You will never again accept a chunk size on faith, and you now own a number you can quote in an interview.

You're done when: You can name the chunk size you use, the one you tried before it, and the score difference between them.

Common traps:

Check yourself:

  1. Your chunks say "the policy above applies" and retrieval returns them useless. What is the fix? Answer: Add context to each chunk — document and section titles, or a generated one-line summary — so it stands on its own when retrieved.
  2. How do you choose between 300-token and 1,000-token chunks? Answer: Index both and run the same questions against each. Compare recall@k and answer quality; pick with numbers, not intuition.

Put to work in: CAMS Lens — SEBI-grounded compliance intelligence

When retrieval is the bug

You can tell a retrieval problem from a generation problem before you touch the prompt.

hybrid search · reranking · recall@k · query rewriting · the missing-document case

In short:

  1. Measure recall@k first. For a set of questions with known source documents, how often is the right one in the top k results? Until you know that, prompt tweaks are guesses.
  2. Hybrid search covers both kinds of miss. Keyword search (BM25) catches exact terms and identifiers; vectors catch paraphrase. Combining them fixes misses either one makes alone.
  3. Rerank a wide net. Retrieve 50 cheaply, then let a cross-encoder reranker pick the best 5. The reranker reads query and chunk together, which is far more precise.

Build this — Measure recall@k before you tune anything. For each question in your eval set, record whether the answer-bearing chunk appeared in the top k at all. If it didn't, no prompt on earth was going to save that answer. Split your failures into 'never retrieved' and 'retrieved and ignored' — they have completely different fixes.

You're done when: You have a recall@k number for your own corpus, and you fixed retrieval before you touched the prompt.

Common traps:

Check yourself:

  1. Users search for error code "E4031" and get nothing useful. Why, and what fixes it? Answer: Embeddings don't represent exact identifiers well. Add keyword search (hybrid) so exact matches get found.
  2. Recall@5 is 60% but recall@50 is 95%. What do you add? Answer: A reranker. The right documents are being found; they just aren't ranked high enough. Rerank the top 50 down to 5.

Put to work in: CAMS Lens — SEBI-grounded compliance intelligence · Agentic Research & Decision Intelligence Assistant

Track 4 — Evals, tracing & observability

The stage everyone skips (~5 hours)

This is the one that separates a demo from a product. As a system gets complicated, evals and tracing stop being nice-to-have and become the only way you can change anything without breaking it. If you cannot state your system's accuracy as a number with a dataset behind it, you do not have a system — you have a vibe.

Dataset → evaluator → task → interpretation

You can build an evaluation harness before you build the feature.

datasets · evaluators · LLM-as-judge and its failure modes · tracing · regression detection

In short:

  1. An eval is a dataset plus a grader. Inputs with expected outputs or criteria, run through your system, scored the same way every time. Without one, every change is a guess.
  2. Start small and real. Thirty real questions with checked answers beat a thousand synthetic ones. Add every production failure to the set as you find it.
  3. Trace everything. Record each run's prompts, retrieved chunks, tool calls and outputs. When a score drops, the trace shows which step changed.

Build this — Put a number on the RAG bot. Add the eval set and tracing to what you built in Track 2. Report the score in the README. Then change the chunk size and report it again — that delta is the whole discipline.

You're done when: You can say what your system's accuracy is, with a number and a dataset behind it.

Common traps:

Check yourself:

  1. "The new prompt feels better." What do you ask for? Answer: The score on the eval set before and after, on the same data, and the examples that got worse.
  2. Where should new eval examples come from once you're live? Answer: Production failures — user reports, low ratings and traced errors — added to the dataset so they can't regress silently.

Put to work in: CAMS Lens — grounded answers that have to be right

LLM-as-judge — and where it stops being trustworthy

You can grade an open-ended answer automatically, and you know which of those grades to disbelieve.

pairwise vs pointwise · position bias · agreement with humans · error analysis · when to just read the outputs

In short:

  1. A judge is a model you must evaluate. Label a sample yourself and measure how often the judge agrees. Until you have that number, the judge's scores are unverified.
  2. Pairwise is steadier than pointwise. "Which of these two is better?" is more reliable than "rate this 1–10". Swap the order and check again to cancel position bias.
  3. Binary criteria beat vague scales. "Does the answer cite a source from the context? yes/no" is far easier to judge consistently than "rate helpfulness".

Build this — Grade your judge. Hand-label thirty of your own outputs. Have the judge label the same thirty. Report the agreement rate. Below about 80% the judge is telling you a story, and you have just learned that for the price of an afternoon.

You're done when: You can quote the agreement rate between your judge and your own labels — and you know which failure category it gets wrong.

Common traps:

Check yourself:

  1. How do you know your judge is trustworthy? Answer: Hand-label 50–100 examples and measure agreement with the judge. Then read the disagreements to see which failure type it misses.
  2. What is position bias, and how do you control it? Answer: The judge prefers whichever answer it sees first (or second). Run each pair in both orders and only count consistent verdicts.

Put to work in: CAMS Lens — grounded answers that have to be right

ML — The classical craft — rows, columns, and not fooling yourself

Quieter than the AI headlines and still what most companies actually need. A table, a column you want to predict, and the discipline to know whether it worked. Boosted trees have not stopped winning just because language models arrived.

Track 4 — Classic ML

Still what wins on the data most companies actually have (~10 hours)

The half of the job the AI headlines skipped, and the half that quietly pays for most ML salaries: a table of rows, a column you want to predict, and the discipline not to fool yourself about how well it worked. Boosted trees did not stop winning on tabular data just because language models arrived — if your data lives in a database rather than in documents, this is the work.

Supervised learning, end to end

You can go from a CSV to a model with an honest score, and say what the score means.

train/validation/test · baselines · choosing the metric · cross-validation · over- and underfitting

In short:

  1. Three splits, three jobs. Train to fit, validation to choose settings, test to report — once, at the end. Reuse the test set for decisions and it stops being a test.
  2. Beat a baseline first. Predict the majority class, or last week's value. If your model can't clearly beat that, it isn't learning anything useful.
  3. The metric is a product decision. Accuracy, precision, recall and cost-weighted error reward different mistakes. Pick the one that matches what a wrong answer costs.

Build this — A model with a baseline you have to beat. Pick any tabular dataset. Write down the dumbest possible predictor first — the mean, the majority class — and score it. Then beat it, and report both numbers. If you cannot beat the dumb one, that is the finding.

You're done when: You can say why a 99%-accurate model can be worthless, without looking it up.

Common traps:

Check yourself:

  1. Why can a 99%-accurate fraud model be worthless? Answer: If 1% of transactions are fraud, predicting "not fraud" every time scores 99%. Look at recall and precision on the fraud class.
  2. What is the validation set for, if you have a test set? Answer: Making choices — hyperparameters, features, which model. The test set is kept untouched so the final number is honest.

Put to work in: Driver Drowsiness Detection

Leakage, imbalance, and the ways you fool yourself

You can spot the mistakes that make a model look brilliant offline and useless in production.

data leakage · time-based splits · class imbalance · distribution shift · error analysis

In short:

  1. Leakage is information from the future. A feature that wouldn't exist at prediction time (an outcome field, a post-event timestamp) makes offline scores look great and production scores collapse.
  2. Split on time when time matters. If the real system predicts next month from this month, validate the same way. Random splits let the model peek ahead.
  3. Read the errors. Error analysis — looking at 50 wrong predictions by hand — finds leakage, label noise and shifts that no aggregate metric will show.

There is no single video for this one, and that is telling: it is the part of ML that gets learned by being burned. The two habits that matter — split on time whenever the real system will predict the future, and look at fifty actual errors before you touch the model — will save you more than any algorithm choice.

Build this — Break your own model on purpose. Take the model from the previous stage and introduce a leaked feature deliberately. Watch the score jump. That jump is exactly what a subtle leak looks like, and now you know its shape.

You're done when: Given a suspiciously good result, leakage is the first thing you check — and you know where to look.

Common traps:

Check yourself:

  1. Your churn model scores 0.99 AUC. What do you check first? Answer: Leakage. Look for features that are only known after the customer churned — cancellation date, final bill, support tickets about closing.
  2. Why is a random split wrong for forecasting next month's demand? Answer: Training rows from after the test rows let the model use the future. Train on the past and test on a later period.

Trees, boosting — and when to reach for deep learning

You choose a model class on the shape of the data, not on what is fashionable.

decision trees · random forests · gradient boosting · when deep learning wins · when it does not

In short:

  1. Tables → gradient boosting. On structured, tabular data, gradient-boosted trees (XGBoost, LightGBM, CatBoost) are usually the strongest and cheapest choice.
  2. Images, audio, text → deep learning. Neural networks win where the raw input is unstructured and the features must be learned rather than engineered.
  3. Pretrained beats from-scratch. With little data, fine-tuning a pretrained model — or using an LLM or embedding model directly — beats training a network from zero.

Build this — Same dataset, three model classes. Boosted trees, a linear model, and a small neural net on identical splits. Report all three, plus training time. The answer on tabular data will usually surprise anyone who only reads AI news.

You're done when: Asked whether to use deep learning, your first question is about the data, not the model.

Common traps:

Check yourself:

  1. Tabular data, 50k rows, 30 columns. What do you try first? Answer: A gradient-boosted tree model, against a simple baseline. Deep learning rarely wins here, and costs far more to tune.
  2. Someone asks "should we use deep learning?" What is your first question? Answer: What is the data — its type and how much of it is labelled. That decides the model class far more than the model does.

Put to work in: Table Recognition System

Track 4 — Evals, tracing & observability

The stage everyone skips (~5 hours)

This is the one that separates a demo from a product. As a system gets complicated, evals and tracing stop being nice-to-have and become the only way you can change anything without breaking it. If you cannot state your system's accuracy as a number with a dataset behind it, you do not have a system — you have a vibe.

Dataset → evaluator → task → interpretation

You can build an evaluation harness before you build the feature.

datasets · evaluators · LLM-as-judge and its failure modes · tracing · regression detection

In short:

  1. An eval is a dataset plus a grader. Inputs with expected outputs or criteria, run through your system, scored the same way every time. Without one, every change is a guess.
  2. Start small and real. Thirty real questions with checked answers beat a thousand synthetic ones. Add every production failure to the set as you find it.
  3. Trace everything. Record each run's prompts, retrieved chunks, tool calls and outputs. When a score drops, the trace shows which step changed.

Build this — Put a number on the RAG bot. Add the eval set and tracing to what you built in Track 2. Report the score in the README. Then change the chunk size and report it again — that delta is the whole discipline.

You're done when: You can say what your system's accuracy is, with a number and a dataset behind it.

Common traps:

Check yourself:

  1. "The new prompt feels better." What do you ask for? Answer: The score on the eval set before and after, on the same data, and the examples that got worse.
  2. Where should new eval examples come from once you're live? Answer: Production failures — user reports, low ratings and traced errors — added to the dataset so they can't regress silently.

Put to work in: CAMS Lens — grounded answers that have to be right

LLM-as-judge — and where it stops being trustworthy

You can grade an open-ended answer automatically, and you know which of those grades to disbelieve.

pairwise vs pointwise · position bias · agreement with humans · error analysis · when to just read the outputs

In short:

  1. A judge is a model you must evaluate. Label a sample yourself and measure how often the judge agrees. Until you have that number, the judge's scores are unverified.
  2. Pairwise is steadier than pointwise. "Which of these two is better?" is more reliable than "rate this 1–10". Swap the order and check again to cancel position bias.
  3. Binary criteria beat vague scales. "Does the answer cite a source from the context? yes/no" is far easier to judge consistently than "rate helpfulness".

Build this — Grade your judge. Hand-label thirty of your own outputs. Have the judge label the same thirty. Report the agreement rate. Below about 80% the judge is telling you a story, and you have just learned that for the price of an afternoon.

You're done when: You can quote the agreement rate between your judge and your own labels — and you know which failure category it gets wrong.

Common traps:

Check yourself:

  1. How do you know your judge is trustworthy? Answer: Hand-label 50–100 examples and measure agreement with the judge. Then read the disagreements to see which failure type it misses.
  2. What is position bias, and how do you control it? Answer: The judge prefers whichever answer it sees first (or second). Run each pair in both orders and only count consistent verdicts.

Put to work in: CAMS Lens — grounded answers that have to be right

Agentic AI Engineering — A model, in a loop, with tools — and the harness that makes it reliable

Where I spend my own time, and where the marketing is furthest from the engineering. It is a while loop with an approval gate — the hard parts are the tools, the evaluation and the failure isolation, not the magic. The job title for that work is harness engineering, and it is the shift: the model is bought in, the harness is what you build.

Track 1 — LLM fundamentals

Understand the thing everything else sits on (~6 hours)

If you only ever do one item on this page, do the first one. Almost every confused conversation I have about AI systems traces back to someone never having watched this.

The whole pipeline, end to end

You can trace a token from raw internet text all the way to a chat reply, naming every stage.

pretraining · tokenisation · transformers · inference · SFT · RLHF · hallucination · tool use · reasoning models

In short:

  1. Pretraining makes a document completer. Trained to predict the next token over a huge slice of the internet, the base model continues text. It does not follow instructions yet.
  2. Post-training makes an assistant. Supervised fine-tuning on example conversations, then reinforcement learning from human (or AI) feedback, turns the completer into something that answers.
  3. Hallucination is the default. The model always produces a fluent continuation. Unless training taught it to recognise what it doesn't know, a confident guess is the most likely text.

Build this — Re-implement decoding. Take any provider that returns logprobs and implement greedy, temperature and top-p sampling yourself. Write a README explaining, in your own words, when you'd use each. It is thirty lines of code and it makes §0.5 permanent.

You're done when: You can explain, without notes, why a model hallucinates confidently rather than saying 'I don't know'.

Common traps:

Check yourself:

  1. Why does a model hallucinate confidently instead of saying "I don't know"? Answer: It was trained to produce likely text, and in its training data questions are usually followed by confident answers. Saying "I don't know" has to be specifically trained in, and it only works for things the model can tell it doesn't know.
  2. What is the difference between a base model and an assistant model? Answer: The base model continues documents. The assistant is the same network after SFT and RLHF, trained to respond to instructions in a conversation format.

Put to work in: Jarvis — six interchangeable providers behind one loop · CAMSCode — enterprise AI coding assistant

Getting output your code can actually parse

You can make a model return JSON your program can trust, and you know what to do the one call in a thousand where it doesn't.

JSON schema · constrained decoding · refusals · repair passes · streaming partials

In short:

  1. Ask for a schema, not "JSON please". Provider structured-output modes constrain decoding to your JSON schema, so the reply is valid JSON of the right shape — not just valid-looking text.
  2. Valid is not correct. The schema guarantees shape. It says nothing about whether the values are true. Validate the business rules in your own code.
  3. Plan for the one in a thousand. Refusals, truncation at the token limit and schema features the provider doesn't support all still happen. Parse, and on failure repair once or fail cleanly.

Build this — A parse-or-repair loop. Ask for a schema, parse the reply, and on a parse failure send the error text back for one repair attempt before giving up. Log how often the repair fires. That number is the difference between a demo and something you can put in front of a customer.

You're done when: You can say what your system does when the model returns prose instead of JSON — and it isn't 'crash'.

Common traps:

Check yourself:

  1. The model returns prose instead of JSON. What does your system do? Answer: Catches the parse error, sends the error text back for one repair attempt, and if that also fails, returns a clear error or fallback — logged and counted.
  2. The JSON parses and matches the schema. What can still be wrong? Answer: The values. A date can be in the wrong year, a total can fail to add up. Schema validation checks shape; your own checks cover meaning.

Put to work in: CAMSCode — enterprise AI coding assistant · Intelligent document processing

Track 3 — Agents & tools

A model, in a loop, with tools. That's it. (~17 hours)

This is the track I care most about, because it is the one where the industry's marketing is furthest from the engineering. An agent is not a mysterious autonomous intelligence. It is a while loop. Write one by hand and the mystique never comes back — and then build the harness around it, which is where the actual work has moved.

The agent loop, by hand

You can write an agent without a framework and explain every line of it.

environment · tool schemas · the while loop · context accumulation · approval gates

Interactive explainer on the live page: agent loop — You can write an agent without a framework and explain every line of it.

In short:

  1. An agent is a while loop. Call the model; if it asks for a tool, run it, append the result to the conversation, and call again. Stop when it answers without a tool call.
  2. The context is the agent's memory. Every tool result goes back into the context. The model knows only what the loop has put there so far.
  3. You own the stopping conditions. A step limit, a cost ceiling and approval gates for risky actions belong in your code, not in the prompt.

Build this — Write the loop. No framework.. A while loop, three tools, JSON-schema arguments, one approval gate before anything destructive. This is the keystone exercise of the whole page — do not substitute a framework tutorial for it.

You're done when: You can draw the loop on a whiteboard and point at exactly where a tool result re-enters the context.

Common traps:

Check yourself:

  1. Where exactly does a tool result re-enter the loop? Answer: It is appended to the message history as a tool-result message, and the whole history is sent on the next model call.
  2. When should you NOT build an agent? Answer: When you can write the steps down in advance. Use a fixed pipeline, and keep agents for tasks where the path genuinely depends on what is found along the way.

Put to work in: Jarvis — that loop, in production, running live in your browser · OpsPilot — agentic request triage & remediation

Workflows and graph loops — the five patterns

You can pick the simplest pattern that solves a task, and draw any agent system as a graph of steps with a loop in it.

prompt chaining · routing · parallelization · orchestrator-workers · evaluator-optimizer · state, nodes and edges · conditional edges and cycles · checkpointing

In short:

  1. Five patterns cover most systems. Prompt chaining (fixed steps), routing (classify, then specialise), parallelization (split or vote), orchestrator-workers (a model plans the subtasks) and evaluator-optimizer (generate, critique, revise).
  2. A graph is the loop, drawn. Nodes are steps, edges are control flow, and state is what travels between them. An agent is a graph with a conditional edge pointing back to an earlier node.
  3. Every cycle needs an exit. A loop edge must have a condition that ends it — a passing check, a round limit, a budget. Without one, the graph is an infinite loop with a bill attached.

Build this — One task, two patterns, a number for each. Take a writing or extraction task. Solve it once as a prompt chain and once as an evaluator-optimizer loop (generate → critique → revise, with a round limit). Run both on the same 20 inputs and record quality, latency and cost. Then draw the second one as a graph: which edge is the loop, and what stops it?

You're done when: Given a new task, you can say which pattern fits, why the simpler ones don't, and where the loop's exit condition lives.

Common traps:

Check yourself:

  1. Customer emails go to billing, technical or sales, each with its own prompt. Which pattern is that? Answer: Routing — classify the input, then send it to a specialised prompt or model.
  2. What turns a workflow graph into an agent? Answer: A cycle whose next step the model decides: a conditional edge back to the model node, taken until the model chooses to stop (or a limit stops it).

Put to work in: Research Intelligence Agent — orchestration in practice · OpsPilot — routing and remediation workflows

Tools and MCP — connecting agents to real systems

You can design a tool an LLM actually uses correctly, and expose it over MCP.

tool design · argument validation · MCP architecture · tool servers · when a tool is too broad

In short:

  1. The tool description is a prompt. The model chooses tools and fills arguments from the name, description and schema alone. Write them for a new colleague with no other context.
  2. Narrow tools, typed arguments. One clear job per tool, enums instead of free strings where possible, and validation on every call — the model's arguments are untrusted input.
  3. MCP standardises the plumbing. An MCP server exposes tools and resources once; any MCP-capable client (desktop apps, IDEs, your own agent) can then use them without custom glue.

Build this — Wrap your Track 2 RAG bot as an MCP server. One tool, a real schema, connected to a client you didn't write. The moment someone else's agent can call your thing, tool design stops being theoretical.

You're done when: You can say why a tool named `do_stuff(input: string)` will be called wrongly, and rewrite it so it won't be.

Common traps:

Check yourself:

  1. Why will `do_stuff(input: string)` get called wrongly? Answer: The name and schema tell the model nothing about when to call it or what to pass. Split it into specific tools with typed, described parameters.
  2. What does MCP give you that a function call in your own code doesn't? Answer: Reuse: the same server works across every MCP client, and tools can be added or updated without changing the agent's code.

Put to work in: Intelligent Document Processing — multi-agent system

Harness engineering — the part that isn't the model

You can say what a harness is, name its five pieces, and point at the one your own agent is missing.

guides vs sensors · context assembly · tool orchestration · verification loops · cost envelopes · behavioural evals

Interactive explainer on the live page: harness — You can say what a harness is, name its five pieces, and point at the one your own agent is missing.

In short:

  1. The harness is everything but the model. Context assembly, tool orchestration, verification, limits and logging. It decides what the model sees and what happens to what it produces.
  2. Guides steer, sensors check. Guides (instructions, examples, conventions) shape behaviour before the action; sensors (tests, linters, validators) check the result after it.
  3. Close the loop with verification. Let the agent run the check itself — the test suite, the type checker — and feed failures back. That catches errors no prompt prevents.

The shift this track has been building toward. Prompt engineering was how you got one good answer out of a 4k context window; it stopped scaling the moment a task ran longer than a few hundred lines. What replaced it is not a better prompt — it is everything around the model: what you put in the context, which tools it can reach, what checks its work, what stops it spending your money, and what you can read afterwards when it went wrong. Swapping models moves output quality by ten or fifteen per cent. Changing the harness decides whether the system works at all.

Build this — Put a harness around the loop you already wrote. Take your Track 3 agent and add the five pieces one at a time, measuring after each: a conventions file it always reads, a deterministic check it cannot talk its way past, one verification gate that re-runs its work before the result counts, a per-task token ceiling that kills the run, and a trace you can read afterwards. Keep the model fixed the whole time — the point is to see how far the harness alone moves it.

You're done when: You can point at one failure your harness now catches that the model used to get away with — and say which of the five parts caught it.

Common traps:

Check yourself:

  1. Your coding agent keeps breaking imports. Guide or sensor? Answer: Both, but the sensor matters more: run the build or type check after each edit and feed errors back. A prompt rule alone will be ignored eventually.
  2. Name the five parts of the harness in the explainer above. Answer: Context (what the model sees), tools (what it can do), verify (checks on what it produced), budget (steps and cost it may spend), and trace (a record of every run).

Put to work in: Jarvis — tool allow-lists, call budgets and a visible trace

Multi-agent systems — when one context window isn't enough

You can tell when splitting work across agents pays for itself, and build an orchestrator whose sub-agents don't trip over each other.

orchestrator and sub-agents · parallel context windows · token cost vs quality · task locking · shared state via git or files · outcome-based evaluation

In short:

  1. Sub-agents buy context, not intelligence. Each sub-agent explores in its own clean context window and returns a short summary. The win is breadth and parallelism on tasks too big for one window.
  2. It costs a multiple of the tokens. Anthropic reports multi-agent research using roughly 15× the tokens of a chat. It pays off only when the task is valuable and genuinely splits into independent parts.
  3. Coordination is the hard part. Agents need clear task boundaries, a way to claim work (a lock file, a queue) and shared state they can merge (git, files). Most failures are two agents doing the same thing.

Build this — An orchestrator with three researchers. Build a lead agent that splits a research question into three sub-questions, runs three sub-agents in parallel with separate contexts, and merges their cited summaries. Compare against a single agent on 10 questions: quality (judged against your own rubric), tokens and wall-clock time. Keep the multi-agent version only if the numbers justify the cost.

You're done when: You can quote what your multi-agent version costs in tokens compared with one agent, and what it buys.

Common traps:

Check yourself:

  1. When is a single agent the better choice? Answer: When the subtasks depend on each other, share most of their context, or the task fits in one window. Parallel agents add cost and coordination for no gain there.
  2. Two parallel agents keep fixing the same bug. What do you add? Answer: A way to claim tasks — a lock file or queue entry per task — checked before starting work, plus merging shared state often.

Put to work in: Research Intelligence Agent — agentic research & decision support

Frameworks — deliberately last

You choose a framework because it removes work you understand, not because you're lost.

LangGraph and friends · what they abstract · what they hide

In short:

  1. A framework hides the loop. LangGraph and similar libraries give you state, retries, persistence and graphs of steps. They are the same loop you wrote, with decisions made for you.
  2. Adopt for features, not for learning. Durable state, human-in-the-loop pauses and tracing are real reasons. "I don't know how agents work" is not — that is what the previous stages fixed.
  3. Know the escape hatch. Before committing, find out how to see the exact prompt sent and how to override one step. Debugging something you can't see is the real cost.

Framework material comes last on purpose. Read one only after you have written the loop, the patterns and a harness yourself. You will find you already know what every abstraction is for — and you will notice the ones that are solving a problem you don't have.

You're done when: You can name one thing your chosen framework does that you would rather do yourself, and say why.

Common traps:

Check yourself:

  1. Name one good reason to adopt a framework. Answer: Durable, resumable state for long workflows, or built-in human-approval pauses — features that are genuinely tedious to build and test yourself.
  2. What should you check in your framework before production? Answer: That you can see and log the exact prompt and tool calls for any run, and override any single step without forking the library.

Track 4 — Evals, tracing & observability

The stage everyone skips (~5 hours)

This is the one that separates a demo from a product. As a system gets complicated, evals and tracing stop being nice-to-have and become the only way you can change anything without breaking it. If you cannot state your system's accuracy as a number with a dataset behind it, you do not have a system — you have a vibe.

Dataset → evaluator → task → interpretation

You can build an evaluation harness before you build the feature.

datasets · evaluators · LLM-as-judge and its failure modes · tracing · regression detection

In short:

  1. An eval is a dataset plus a grader. Inputs with expected outputs or criteria, run through your system, scored the same way every time. Without one, every change is a guess.
  2. Start small and real. Thirty real questions with checked answers beat a thousand synthetic ones. Add every production failure to the set as you find it.
  3. Trace everything. Record each run's prompts, retrieved chunks, tool calls and outputs. When a score drops, the trace shows which step changed.

Build this — Put a number on the RAG bot. Add the eval set and tracing to what you built in Track 2. Report the score in the README. Then change the chunk size and report it again — that delta is the whole discipline.

You're done when: You can say what your system's accuracy is, with a number and a dataset behind it.

Common traps:

Check yourself:

  1. "The new prompt feels better." What do you ask for? Answer: The score on the eval set before and after, on the same data, and the examples that got worse.
  2. Where should new eval examples come from once you're live? Answer: Production failures — user reports, low ratings and traced errors — added to the dataset so they can't regress silently.

Put to work in: CAMS Lens — grounded answers that have to be right

LLM-as-judge — and where it stops being trustworthy

You can grade an open-ended answer automatically, and you know which of those grades to disbelieve.

pairwise vs pointwise · position bias · agreement with humans · error analysis · when to just read the outputs

In short:

  1. A judge is a model you must evaluate. Label a sample yourself and measure how often the judge agrees. Until you have that number, the judge's scores are unverified.
  2. Pairwise is steadier than pointwise. "Which of these two is better?" is more reliable than "rate this 1–10". Swap the order and check again to cancel position bias.
  3. Binary criteria beat vague scales. "Does the answer cite a source from the context? yes/no" is far easier to judge consistently than "rate helpfulness".

Build this — Grade your judge. Hand-label thirty of your own outputs. Have the judge label the same thirty. Report the agreement rate. Below about 80% the judge is telling you a story, and you have just learned that for the price of an afternoon.

You're done when: You can quote the agreement rate between your judge and your own labels — and you know which failure category it gets wrong.

Common traps:

Check yourself:

  1. How do you know your judge is trustworthy? Answer: Hand-label 50–100 examples and measure agreement with the judge. Then read the disagreements to see which failure type it misses.
  2. What is position bias, and how do you control it? Answer: The judge prefers whichever answer it sees first (or second). Run each pair in both orders and only count consistent verdicts.

Put to work in: CAMS Lens — grounded answers that have to be right

Track 5 — Production architecture

Where AI engineering becomes engineering (~6 hours)

The gap between a working prototype and a system real users depend on is not model quality. It is latency, failure isolation, cost, caching and observability — ordinary distributed-systems work, applied to a component that is slow, expensive and occasionally wrong.

A production case study worth reading twice

You can reason about an AI system the way you'd reason about any distributed system.

streaming & stateful inference · full-duplex voice · asynchronous delegation · WebRTC · latency budgets · session affinity · prompt caching · failure isolation · observability

In short:

  1. Separate the fast path from the slow path. The user-facing loop must answer within a latency budget; long work (search, tools, other agents) runs asynchronously and reports back.
  2. Stream everything. Start speaking or rendering at the first token. Time-to-first-token matters more to how fast it feels than total generation time.
  3. State has an address. Stateful sessions (voice, WebRTC) must reach the same server or share state. Session affinity and prompt caching keep them fast and cheap.

Build this — Instrument something you already built. Take the Track 3 agent. Add a latency budget per turn, a cost counter, provider failover, and a trace you can actually read when it misbehaves at 2am.

You're done when: You can draw your system's fast path and slow path as separate lines, and say what happens when the slow one stalls.

Common traps:

Check yourself:

  1. Your voice agent must look up an order (3 seconds). What does the user hear meanwhile? Answer: An immediate acknowledgement from the fast path, while the lookup runs asynchronously and its result is spoken when it arrives.
  2. Why does prompt caching matter for a long session? Answer: The long, unchanging prefix (system prompt, tools, early history) is reused instead of reprocessed, which cuts latency and input cost on every turn.

Put to work in: Jarvis — per-turn provider failover and streaming · Dialogflow CX voicebot — production conversational system

What happens when the provider is down

You can name every way your system fails and say what it does instead of failing.

timeouts · provider failover · graceful degradation · rate limits and backoff · approval gates · cost ceilings

In short:

  1. Every call needs a timeout. A provider that hangs is worse than one that errors. Set timeouts per call and treat a timeout as a failure to route around.
  2. Fail over, then degrade. Retry with backoff on rate limits, switch to a second provider on outages, and when everything fails, give a reduced answer rather than an error page.
  3. Put ceilings in code. Cost per request, calls per user and actions that need approval are enforced by the system, not requested in the prompt.

There is no resource here on purpose — I have not read one that beats the lesson. This stage is learned the day a provider deprecates a model without telling you and every call in production starts returning 404. Write down, for your own system, what happens on: a timeout, a 429, a malformed reply, a tool that hangs, and a model id that no longer exists. If any answer is 'the request just fails', that is your next afternoon's work.

Build this — Break it on purpose. Point your primary provider at a dead endpoint and run your happy path. Then rate-limit it. Then make a tool hang for sixty seconds. Fix what you find, in that order — the fixes are a timeout, a backoff, and a fallback, and they are perhaps eighty lines between them.

You're done when: You have run your own system with its primary provider unplugged, and a user still got an answer.

Common traps:

Check yourself:

  1. Your primary LLM provider returns 503 for ten minutes. What happens to a user request? Answer: It times out quickly, fails over to a second provider (tested with the same evals), and if that fails, returns a clear degraded response — not a spinner.
  2. Why add jitter to retry backoff? Answer: So thousands of clients don't retry at the same instant and knock the recovering service over again.

Put to work in: Jarvis — per-turn provider failover and streaming · OpsPilot — agents behind an approval gate

Explore more

GitHub · LinkedIn · Email