Skip to content

Latest commit

 

History

History
27 lines (14 loc) · 1.64 KB

File metadata and controls

27 lines (14 loc) · 1.64 KB

Cookbook: PDF Bot w/ multi-turn conversation

NOTE: This cookbook is identical to the single-turn converastion cookbook, except that the chain & configuration are changed to support multi-turn conversations.

This cookbook creates a multi-turn conversation capable RAG chain with PDF files stored in a UC Volume.

Create a UC Volume with PDF files

Create a UC Volume and load PDF files. You can use the PDFs from the directory sample_pdfs to get started quickly - these PDFs are a few recent research papers from Matei's lab.

Create a Vector Index

Open and follow the steps in the notebook 1_load_pdf_to_vector_index to load PDF files from the UC Volume to a Vector Index. The sample notebook uses the BGE embedding model hosted on FMAPI.

Prototype a RAG Chain

  1. Open the notebook 2_rag_chain_multi_turn and run the code locally to test the chain. This chain uses the Databricks-DBRX-Instruct model hosted on FMAPI.

Log, evaluate, deploy a RAG Chain

  1. Take the JSON output from the last cell in the 1_load_pdf_to_vector_index notebook and overwrite the baseline_config in Cell 17 of 3_multi_turn_pdf_driver_notebook.py configuration so your chain will be logged with the configuration of the vector index you just created.

    • Pro tip: Modify the prompts here to try improving the quality of the RAG chain!
  2. Run all cells in this notebook to log, evaluate, and deploy this chain!

  3. Share the deployed Review App with your users to interact with the chain and provide feedback.