Lesson 31 / 31
Revision: Cheat Sheet and Self-Check
Review the key ideas of the whole course.
Cheat sheet
Landscape: frameworks supply reusable plumbing; LangChain composes steps, LlamaIndex connects data; install only the packages you need; pin versions. LangChain core: ChatPromptTemplate, chat models, StrOutputParser/PydanticOutputParser, the | operator builds a RunnableSequence; every runnable has invoke, batch, stream; RunnableLambda, RunnableParallel, RunnablePassthrough. Reliability: @tool from docstring and hints, RunnableBranch routing, .with_retry, .with_fallbacks, callbacks and tracing, chat history by session. Retrieval: Documents, splitters with overlap, embeddings, vector stores, retrievers, a RAG chain of context + question, filters, MMR, reranking. LlamaIndex: Document → Node → VectorStoreIndex → retriever → query engine with source_nodes; set Settings; persist and reload. Agents: tool-calling loop with limits; LangGraph for stateful flows, checkpoints and approvals; guardrails. Ship: fake-model unit tests, evaluation datasets, traces, cost and latency control, secrets, pinned dependencies; drop the framework when it adds nothing.
Quick check: Your chain's JSON parsing sometimes fails because the model adds extra text. What is the most robust fix?
- Use native structured output or a Pydantic parser, validate, and retry on failure
- Ignore the errors
- Increase chunk size
- Remove the parser
Answer
Use native structured output or a Pydantic parser, validate, and retry on failure — Constrained output plus validation and retry handles stray text.
Quick check: Which stage of a RAG app most often explains a wrong answer?
- The Python version string
- The font of the UI
- Retrieval did not return the relevant passage
- The length of the repo name
Answer
Retrieval did not return the relevant passage — If the evidence is missing from the prompt, the model cannot use it.
Quick check: What should an agent loop always include?
- Write access to every system
- Unlimited iterations
- Step and budget limits, argument validation and logging of tool calls
- No tests
Answer
Step and budget limits, argument validation and logging of tool calls — Limits, validation and logs keep autonomous loops safe and debuggable.