KNOWLEDGE / LEARN BY DOING
Learn AI by doing
Build your understanding of RAG, prompts, agents, and vector search. Run a small example, change one thing, then test what you know.
12 hands-on lessons · 60 explained questions · No API key needed
The labs use JavaScript and Node.js 22 or newer. Each includes its data, a downloadable script, expected output, and a follow-up exercise. You can read the explanations and questions without running code.
RAG & retrieval
Keep evidence intact, combine rankings, and measure what was found.
Keep rules and exceptions together
Split a tiny returns policy two ways, then check which chunks contain the complete answer.
LAB 02Combine keyword and semantic results
Use reciprocal rank fusion to merge keyword and semantic candidates without mixing their raw scores.
LAB 03Check whether a citation supports the answer
Reject invented source IDs and distinguish a valid citation from a supported claim.
LAB 04Measure retrieval precision and recall
Calculate precision and recall on a tiny labeled retrieval result before changing your pipeline.
Prompt & context
Separate instructions, budget context, and validate the result.
Separate instructions from source text
Build a clearly structured request, then enforce a tool boundary outside the prompt.
LAB 02Fit useful context into a budget
Reserve room for output, keep important evidence, and remove history with an explicit rule.
LAB 03Validate a structured response
Test four responses against a small application contract, including valid JSON with invalid fields.
Agent engineering
Build tool boundaries, stop failed loops, and manage memory.
Validate a tool call before execution
Build a tiny dispatcher that rejects unknown tools and malformed arguments before execution.
LAB 02Stop retries and failed loops
Give a controller a fixed attempt budget and distinguish success, permanent failure, and exhaustion.
LAB 03Retrieve the right user’s current memory
Select a current preference while rejecting expired and unrelated records.
Vector search
Understand similarity and retrieve from the right records.