InMemoryVectorStore takes an embedding provider, and KnowledgeBase.asTool() exposes search to the model. Indexing and searching can make embedding requests in addition to the Agent’s model calls.
Complete checkpoint
support.ts
Run it
Verify the result
The answer should say that an unopened item at 14 days is within the 30-day return window and cite[returns]. It should keep the staff-approval condition.
The source ID helps you inspect where an answer came from; a citation alone does not prove that the answer is supported. Evaluate both retrieval and the final response.
Try an unsupported question: ask about international customs fees. The supplied documents contain no answer. Check that the assistant acknowledges the missing evidence.
This catalog is rebuilt on each run. Before adding production documents, choose a persistent vector store, bind retrieval to tenant visibility, and plan document updates/deletions. See knowledge guides.
Require a human decision
Continue to the next chapter.