pub struct RagPipeline { /* private fields */ }rag only.Expand description
The RAG pipeline orchestrator.
Coordinates document ingestion (chunk → embed → store) and query
execution (embed → search → rerank → filter). Construct one via
RagPipeline::builder().
Implementations§
Source§impl RagPipeline
impl RagPipeline
Sourcepub fn builder() -> RagPipelineBuilder
pub fn builder() -> RagPipelineBuilder
Create a new RagPipelineBuilder.
Sourcepub fn embedding_provider(&self) -> &Arc<dyn EmbeddingProvider> ⓘ
pub fn embedding_provider(&self) -> &Arc<dyn EmbeddingProvider> ⓘ
Return a reference to the embedding provider.
Sourcepub fn vector_store(&self) -> &Arc<dyn VectorStore> ⓘ
pub fn vector_store(&self) -> &Arc<dyn VectorStore> ⓘ
Return a reference to the vector store.
Sourcepub async fn create_collection(&self, name: &str) -> Result<(), RagError>
pub async fn create_collection(&self, name: &str) -> Result<(), RagError>
Create a named collection in the vector store.
The collection is created with the dimensionality reported by the
configured EmbeddingProvider.
§Errors
Returns RagError::PipelineError if the vector store operation fails.
Sourcepub async fn delete_collection(&self, name: &str) -> Result<(), RagError>
pub async fn delete_collection(&self, name: &str) -> Result<(), RagError>
Delete a named collection from the vector store.
§Errors
Returns RagError::PipelineError if the vector store operation fails.
Sourcepub async fn ingest(
&self,
collection: &str,
document: &Document,
) -> Result<Vec<Chunk>, RagError>
pub async fn ingest( &self, collection: &str, document: &Document, ) -> Result<Vec<Chunk>, RagError>
Ingest a single document: chunk → embed → store.
Returns the chunks that were stored (with embeddings attached).
§Errors
Returns RagError::PipelineError if embedding or storage fails,
including the document ID in the error message.
Sourcepub async fn ingest_batch(
&self,
collection: &str,
documents: &[Document],
) -> Result<Vec<Chunk>, RagError>
pub async fn ingest_batch( &self, collection: &str, documents: &[Document], ) -> Result<Vec<Chunk>, RagError>
Ingest multiple documents through the chunk → embed → store workflow.
Returns all chunks that were stored across all documents.
§Errors
Returns RagError::PipelineError on the first document that fails,
including the document ID in the error message.
Sourcepub async fn query(
&self,
collection: &str,
query: &str,
) -> Result<Vec<SearchResult>, RagError>
pub async fn query( &self, collection: &str, query: &str, ) -> Result<Vec<SearchResult>, RagError>
Query the pipeline: embed → search → rerank → filter by threshold.
Returns search results ordered by descending relevance score. Results
below the configured similarity_threshold are filtered out.
§Errors
Returns RagError::PipelineError if embedding or search fails.