RAG Workflow in Lyzr

  1. Query Reception The user’s question or request is received by the agent.
  2. Document Retrieval The agent queries configured vector stores or knowledge bases to fetch top-N relevant passages.
  3. Reranking & Filtering Retrieved passages are optionally reranked and filtered for relevance and quality.
  4. Prompt Assembly Selected passages are inserted into a structured prompt template alongside the original query.
  5. Generation The LLM processes the prompt and generates a response that references the retrieved context.
  6. Citation & Delivery Final answers include citations or links to the source documents, enhancing transparency and traceability.

Core Components

  • Vector Store: A scalable database for embedding vectors (e.g., FAISS, Pinecone, Weaviate).
  • Embedding Model: Converts text into high-dimensional vectors reflective of semantic meaning.
  • Reranker: Reorders retrieved results to surface the most relevant information.
  • Prompt Template: Defines how retrieved context and user input are combined to form the LLM prompt.
  • Citation Module: Automatically formats and attaches source references to generated outputs.