Demo: the order-support assistant answers with citations
On This Lesson 3 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
build the assistant that prepares MID-068-LAB1.
Draft outline details
Step by step
- Start from the MID-067 index; add a
POST /support/askendpoint. - Retrieve top 20 with language filter, keep the top 4 above the similarity threshold.
- Build the prompt with numbered sources and the decline instruction; call the model through Spring AI (verify API and model name before recording).
- Planned mistake: a question about a topic Shop does not cover gets a confident answer from model memory because the prompt had no decline rule and no threshold. Fix: add the rule and return a fixed decline when nothing passes the threshold.
- Return
{answer, sources:[{articleId,title}]}and test shipping, returns, payment, and one out-of-scope question. - Log the question, retrieved chunk ids, scores, and answer for later diagnosis.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.