Skip to main content

Module rag

Module rag 

Source
Expand description

Retrieval-Augmented Generation pipeline. Retrieval-Augmented Generation (RAG) pipeline for knowledge base search.

Provides document ingestion (chunking + embedding + storage) and context-aware retrieval for LLM injection.

§Main types

  • RagPipeline — Orchestrates ingestion and retrieval.
  • Document — A document to ingest into the knowledge base.
  • DocumentChunk — A chunk of a document after splitting.
  • ChunkingStrategy — How to split documents into chunks.
  • RagConfig — Pipeline configuration.
  • RagResult — Query result containing scored chunks and formatted context.
  • ScoredChunk — A chunk paired with its relevance score.

Structs§

Document
A document to ingest into the RAG knowledge base.
DocumentChunk
A chunk produced by splitting a Document.
RagConfig
Configuration for the RAG pipeline.
RagPipeline
Retrieval-Augmented Generation pipeline.
RagResult
Result of a RAG query.
ScoredChunk
A scored chunk returned by the RAG query.

Enums§

ChunkingStrategy
Strategy for splitting documents into chunks.