Chapter 20
persinsent rag
Notebookllm-zoomcamp-2026-code6 cells
In [1]python · cell 1
python
from sqlitesearch import TextSearchIndex
sqlite_index = TextSearchIndex(
text_fields=['question', 'section', 'answer'],
keyword_fields=['course'],
db_path='faq.db'
)In [3]python · cell 2
python
from dotenv import load_dotenv
load_dotenv()
from openai import OpenAI
openai_client = OpenAI()In [4]python · cell 3
python
from rag_helper import RAGBase
assistant = RAGBase(sqlite_index, openai_client)In [5]python · cell 4
python
assistant.rag('I just discovered the course, can I still join?')Output
'Yes, but if you want to receive a certificate, you need to submit your project while the course is still accepting submissions.'
In [ ]python · cell 5
python
In [ ]python · cell 6
python
