pub struct SemanticQuery {
pub subject: String,
pub purpose: Option<String>,
pub text: String,
pub embedding: Vec<f32>,
pub embedding_model: String,
pub index_snapshot: String,
pub limit: usize,
pub max_sensitivity: Sensitivity,
}Expand description
A semantic query whose exact vector and index identity are journalable.
Fields§
§subject: String§purpose: Option<String>§text: StringThe query as written — a search input, not only provenance.
It is carried beside the vector rather than derived from it because a retriever may legitimately want both: dense similarity for meaning and the literal terms for exact matches that embeddings famously lose — identifiers, error codes, product names. A retriever that fuses the two is doing hybrid retrieval, and everything it needs is already in this struct.
Where the fusion is declared is SemanticRetriever::profile, which
is in the effect key: changing a weighting or switching fusion off is
replay divergence rather than a silently different ranking. That is the
supported axis, and it is per-retriever on purpose — a per-call knob
would let one run rank two ways with nothing on the record saying which.
The shipped InMemorySemanticRetriever ignores this field and ranks on
the vector alone. It is a reference implementation, not a statement about
what the seam permits.
embedding: Vec<f32>Exact query vector, obtained through
StepCtx::embed.
It is in the retrieval effect’s key, so a replay must reproduce it exactly — which is why producing it is itself a journaled effect rather than a call a skill makes on its own. An embedding API is a network observation: two calls with the same text are not obliged to return the same floats, and a model revision guarantees they will not. Computing one inside the deterministic zone therefore quarantines a healthy run at the next replay, for a reason nothing on the record explains.
embedding_model: StringStable embedding model and revision.
index_snapshot: StringImmutable vector-index snapshot searched by this query.
limit: usize§max_sensitivity: SensitivityHighest sensitivity this retriever may receive.
Trait Implementations§
Source§impl Clone for SemanticQuery
impl Clone for SemanticQuery
Source§fn clone(&self) -> SemanticQuery
fn clone(&self) -> SemanticQuery
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SemanticQuery
impl Debug for SemanticQuery
Source§impl<'de> Deserialize<'de> for SemanticQuery
impl<'de> Deserialize<'de> for SemanticQuery
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for SemanticQuery
impl PartialEq for SemanticQuery
Source§impl Serialize for SemanticQuery
impl Serialize for SemanticQuery
impl StructuralPartialEq for SemanticQuery
Auto Trait Implementations§
impl Freeze for SemanticQuery
impl RefUnwindSafe for SemanticQuery
impl Send for SemanticQuery
impl Sync for SemanticQuery
impl Unpin for SemanticQuery
impl UnsafeUnpin for SemanticQuery
impl UnwindSafe for SemanticQuery
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 more