pub struct VectorFilter {
pub namespaces: Vec<Namespace>,
pub domains: Vec<Domain>,
pub min_score: Option<f32>,
}Expand description
Filter criteria specific to vector similarity search.
This type provides a subset of SearchFilter fields that are applicable
to vector search operations, making the API more type-safe and explicit.
§Fields
| Field | Description |
|---|---|
namespaces | Filter by memory namespaces |
domains | Filter by memory domains |
min_score | Minimum cosine similarity threshold (0.0 to 1.0) |
§Example
use subcog::storage::traits::VectorFilter;
use subcog::models::Namespace;
let filter = VectorFilter::new()
.with_namespace(Namespace::Decisions)
.with_min_score(0.7);Fields§
§namespaces: Vec<Namespace>Filter by namespaces.
domains: Vec<Domain>Filter by domains.
min_score: Option<f32>Minimum similarity score (0.0 to 1.0).
Implementations§
Source§impl VectorFilter
impl VectorFilter
Sourcepub fn with_namespace(self, namespace: Namespace) -> Self
pub fn with_namespace(self, namespace: Namespace) -> Self
Adds a namespace filter.
Sourcepub fn with_domain(self, domain: Domain) -> Self
pub fn with_domain(self, domain: Domain) -> Self
Adds a domain filter.
Sourcepub const fn with_min_score(self, score: f32) -> Self
pub const fn with_min_score(self, score: f32) -> Self
Sets the minimum score threshold.
Trait Implementations§
Source§impl Clone for VectorFilter
impl Clone for VectorFilter
Source§fn clone(&self) -> VectorFilter
fn clone(&self) -> VectorFilter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VectorFilter
impl Debug for VectorFilter
Source§impl Default for VectorFilter
impl Default for VectorFilter
Source§fn default() -> VectorFilter
fn default() -> VectorFilter
Returns the “default value” for a type. Read more
Source§impl From<&SearchFilter> for VectorFilter
impl From<&SearchFilter> for VectorFilter
Source§fn from(filter: &SearchFilter) -> Self
fn from(filter: &SearchFilter) -> Self
Converts a SearchFilter to a VectorFilter, extracting only
the fields applicable to vector search.
Source§impl From<SearchFilter> for VectorFilter
impl From<SearchFilter> for VectorFilter
Source§fn from(filter: SearchFilter) -> Self
fn from(filter: SearchFilter) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for VectorFilter
impl RefUnwindSafe for VectorFilter
impl Send for VectorFilter
impl Sync for VectorFilter
impl Unpin for VectorFilter
impl UnwindSafe for VectorFilter
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].