This approach combines the power of pre-trained models with up-to-date, domain-specific knowledge, leading to more accurate and contextually appropriate outputs. To capture the RAG pipeline, you need to log it as a “Retrieval” entity. A Retrieval represents a query that fetches relevant context from a knowledge base or vector database.
const retrieval = trace.retrieval({
id: "retrieval-id",
name: "National Geographic survey report 2025.pdf",
});
retrieval.input("best places 2025")
retrieval.output([
"Tokyo, Japan",
"Barcelona, Spain",
"Singapore",
"Copenhagen, Denmark",
"Pune, India",
"Seoul, South Korea",
])
Replace ‘trace.retrieval’ with ‘span.retrieval’ when creating retrievals within an existing span
