From the course: Oracle Cloud Infrastructure Generative AI Professional Cert Prep

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Demo: RAG plus memory plus tracing

Demo: RAG plus memory plus tracing

(intro music playing) - In this demo, we'll use retrieval-augmented generation with memory. We'll also see how to trace LAngChain calls with LangSmith. So let begin with the import of the classes. Imported class here is ConversationalRetrievalChain, which allows us to use rag with memory. We'll use Chroma of Vector db. We'll also use OCIGenAI service and OCIGenAIEmbeddings. Using this block of code, we enable the tracing of LAngChain calls to LangSmith. You can learn more about LangSmith on this page. You'll need to create an account and create an API key. Next we create an LLM using OCIGenAI class. We create HTTP client, which will connect to Chromedb server. We create embeddings using OCIGenAI embeddings. We create chroma vector db using client and embeddings. We create a retriever out the vector db by using as a retriever model. We are passing in search type as similarity, and the search box as {"K":8}, which will fetch the top eight documents. Next we create a conversational…

Contents