Skip to content

Pipeline

peter-olai edited this page May 7, 2025 · 3 revisions

Chat Service Pipeline

This page describes the main pipeline for processing user queries in the chat service, including RAG (Retrieval-Augmented Generation).

Pipeline Steps

  1. Query Embedding: Convert the user’s query (or a combination of query and context) into an embedding using the embeddings model.
  2. Context Retrieval: Perform a similarity search in the database to pull out relevant pieces of text (e.g., task guidance, environment details).
  3. Prompt Generation: Combine the user’s query, retrieved context, and additional information (like user actions or environmental variables) into a well-structured prompt.
  4. LLM Generation: Send the prompt to the LLM to generate a helpful, natural language response.
  5. Return Answer: Deliver the response back to the VR environment, where the NPC can relay the information to the user.

RAG Pipeline Implementation

  • Query Processing & Embedding: Clean and preprocess the user query, then generate an embedding vector.
  • Similarity Search: Use cosine similarity to compare the query embedding with stored document embeddings and retrieve the top N relevant documents.
  • Prompt Generation: Combine the base prompt, user query, retrieved context, and any additional VR data.
  • LLM Response: Pass the prompt to the LLM and post-process the response if needed.

For more details, see chat_service_pipeline.

Diagram

Pipeline Diagram

Place an exported pipeline diagram image in the diagrams/ folder to display it here.

Clone this wiki locally