In the PizzaMate™ RAG system, what are the two subflows and what is the purpose of each?
The two subflows are document ingestion and retrieve and answer. Document ingestion takes the PDF as input and produces a vector database with embedded chunks; it runs only when the database is created or the PDF information changes. Retrieve and answer takes a user query, performs a vector similarity search to find the most relevant chunks, and uses an LLM to answer the query; it runs whenever a user asks a question.
In the PizzaMate™ RAG system, the flow is divided into two subflows that serve different purposes and run at different times. The document ingestion subflow processes the PDF file and produces a vector database containing embedded chunks. This subflow needs to be run only when the database is first created or when the information in the PDF has changed. The retrieve and answer subflow handles live user questions: it takes a user query, runs a vector similarity search in the database to find the most relevant chunks, and then uses those chunks to answer the query by invoking an LLM. This second subflow runs every time a user asks a question.
Key points
- Document ingestion: reads the PDF, splits text into chunks, embeds them, and stores them in a vector database.
- Document ingestion runs only when the database is created or the PDF content changes.
- Retrieve and answer: takes a user query, searches the vector database for the most relevant chunks, and invokes an LLM to generate an answer.
- Retrieve and answer runs whenever a user asks a question.
Related questions
AI Agents and Applications
Andrea De Mauro
MEAP Edition Version 7 · Manning Publications