pub struct EmbeddingRegistry { /* private fields */ }Expand description
Generic Qdrant-backed embedding registry.
Owns a QdrantOps instance, a collection name and a UUID namespace for
deterministic point IDs (uuid v5). The in-memory hashes map enables
O(1) delta detection between syncs.
Implementations§
Source§impl EmbeddingRegistry
impl EmbeddingRegistry
Sourcepub fn new(
ops: QdrantOps,
collection: impl Into<String>,
namespace: Uuid,
) -> Self
pub fn new( ops: QdrantOps, collection: impl Into<String>, namespace: Uuid, ) -> Self
Create a registry wrapping an existing QdrantOps connection.
Sourcepub async fn sync<T: Embeddable>(
&mut self,
items: &[T],
embedding_model: &str,
embed_fn: impl Fn(&str) -> EmbedFuture,
) -> Result<SyncStats, EmbeddingRegistryError>
pub async fn sync<T: Embeddable>( &mut self, items: &[T], embedding_model: &str, embed_fn: impl Fn(&str) -> EmbedFuture, ) -> Result<SyncStats, EmbeddingRegistryError>
Sync items into Qdrant, computing a content-hash delta to avoid
unnecessary re-embedding. Re-creates the collection when the embedding
model changes.
§Errors
Returns EmbeddingRegistryError on Qdrant or embedding failures.
Sourcepub async fn search_raw(
&self,
query: &str,
limit: usize,
embed_fn: impl Fn(&str) -> EmbedFuture,
) -> Result<Vec<ScoredVectorPoint>, EmbeddingRegistryError>
pub async fn search_raw( &self, query: &str, limit: usize, embed_fn: impl Fn(&str) -> EmbedFuture, ) -> Result<Vec<ScoredVectorPoint>, EmbeddingRegistryError>
Search the collection, returning raw scored Qdrant points.
Consumers map the payloads to their domain types.
§Errors
Returns EmbeddingRegistryError if embedding or Qdrant search fails.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EmbeddingRegistry
impl !RefUnwindSafe for EmbeddingRegistry
impl Send for EmbeddingRegistry
impl Sync for EmbeddingRegistry
impl Unpin for EmbeddingRegistry
impl UnsafeUnpin for EmbeddingRegistry
impl !UnwindSafe for EmbeddingRegistry
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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>
Wrap the input message
T in a tonic::Request