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.
Auto Trait Implementations§
impl Freeze for RagPipeline
impl !RefUnwindSafe for RagPipeline
impl Send for RagPipeline
impl Sync for RagPipeline
impl Unpin for RagPipeline
impl UnsafeUnpin for RagPipeline
impl !UnwindSafe for RagPipeline
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request