Query Input
The knowledge base is indexed, now it's time to handle the other half of RAG: what the user actually asks.
Turning a question into a vector
A user's question arrives as plain natural language, no different in kind from any of the document chunks already indexed. To be comparable to those chunks at all, it needs to go through the exact same embedding function:
Why the same function matters
If chunks were embedded with one method and the query with a different one, their vectors wouldn't live in the same "space", comparing them would be meaningless, like comparing a temperature in Celsius to one in Fahrenheit without converting first. Whatever embed/toy_embed function built the vectors in your VectorStore, the query must use that identical function:
Notice toy_embed('How do I reset my password?') shares words like 'password' and 'reset' with the FAQ chunk from earlier lessons, that overlap is exactly what the next lesson's similarity search will detect and rank highly.
NOTE
In a production system using real OpenAI embeddings, this step is one extra API call per user question, small and cheap compared to the final LLM call, but it's still a network round-trip, worth remembering when thinking about a RAG pipeline's latency and cost.