Let’s Get Certified
Module 06 / 15 · Application development

Diagnose the first failing stage of a chain

Inspect document evidence, orchestration and the final prompt before changing model size.

Diagnose the first failing stage of a chain

Work through the decision

The assistant gives the wrong torque value. The index contains the correct manual, but the trace shows that the retriever returned the previous edition. Would changing the wording of the final answer repair the evidence?

Check your reasoning

Follow the data through parsing, chunk selection, ranking, prompt assembly and generation. Identify the first stage at which the expected passage disappears. If retrieval selected the wrong edition, fix eligibility or indexing and rerun the same question. If the correct evidence was supplied but the value was misread, inspect the prompt and generator next.

Watch the source lesson at 43:30

Compare the choices

Pipeline tracing
Inspect inputs and outputs of each stage under a stable request ID to locate the first divergence from the reference behavior.
Controlled chunk experiment
Vary the chunk design while holding source data, questions, embedding model and evaluation method fixed. Compare evidence and answer metrics.
Orchestration framework
Use a framework when its composition, tool interfaces or tracing simplify the required workflow. Pin dependencies and test boundaries.
Qualitative error analysis
Read representative failures and label failure modes such as missing evidence, unsupported claims, wrong units or unsafe content. Use those labels to guide a focused test.

Test the decision

A framework can organize these calls and their traces. It still needs explicit contracts and tests. Compare chunk candidates using the same questions and labels, then inspect generated answers for factual support, unsafe claims and unsupported omissions.

Practice the guide skills

  1. Must a fixed four-stage pipeline use an agent framework? Watch 43:30 · Continue at 44:00
    Check your answer

    Compare explicit functions with a framework such as LangChain for orchestration, retriever interfaces, tool integration and tracing. Choose the simplest option that supports the required contract and maintainability.

  2. A response is fluent but contradicts the supplied document. Where did the defect arise? Watch 55:30 · Continue at 56:00
    Check your answer

    Inspect retrieved evidence, the final prompt and the output. If the correct clause reached the model, investigate grounding and interpretation. Separately classify omissions, unsupported claims and unsafe output.

  3. Compare two chunk designs fairly. Watch 21:42 · Continue at 27:30 · Continue at 40:00
    Check your answer

    Keep the query set, model, retriever settings and labels fixed. Compare evidence recall, answer quality and context size on matching cases, including cross-section and short-document questions.

Official objectives for this lesson

Related lesson · Troubleshooting and optimization

Knowledge check

Diagnose the first failing stage of a chain quiz

Answer 3 questions. Check each answer for an explanation.