pub struct SemanticQuery {
pub subject: String,
pub purpose: Option<String>,
pub text: String,
pub embedding: Vec<f32>,
pub index: IndexIdentity,
pub limit: usize,
pub max_sensitivity: Sensitivity,
pub as_of: Timestamp,
}Expand description
A semantic query as the journal records it.
Assembled by the runtime from a SemanticSearch, the wired
Embedder and the wired SemanticRetriever’s IndexIdentity. Every
field is in the retrieval effect’s key, so a re-indexed corpus or a changed
embedding revision is divergence a replay reports rather than a different
answer nothing explains.
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.
index: IndexIdentityThe space and snapshot this query was resolved against.
limit: usize§max_sensitivity: SensitivityHighest sensitivity this retriever may receive.
as_of: TimestampThe lifecycle cutoff this selection was screened at.
A semantic index is derived and therefore stale by construction: it keeps naming versions after they are superseded, expire, or are erased. Live dispatch screens every hit against the authoritative store at this instant — the run’s journaled clock, so the cutoff is on the record beside the selection it shaped rather than being an ambient wall clock two machines disagree about.
Trait Implementations§
Source§impl Clone for SemanticQuery
impl Clone for SemanticQuery
Source§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