pub struct Intent {
pub id: String,
pub label: String,
pub terms: Vec<String>,
pub members: Vec<String>,
pub centroid: Option<Vec<f32>>,
pub support: u32,
pub seeded_support: u32,
pub last_ts: u64,
pub tools: BTreeMap<String, f32>,
pub skills: BTreeMap<String, f32>,
/* private fields */
}Expand description
One cluster: the queries it covers and the capabilities invoked after them.
label and terms are derived, not stored: they are computed from the
members at read time and deliberately excluded from equality. c-TF-IDF scores
a term against the other clusters, so a value frozen when this cluster was
last written is wrong the moment another cluster appears.
Fields§
§id: StringCluster id, unique within the graph. Opaque — it names a row.
label: StringDisplay name (the medoid member). Never affects ranking.
terms: Vec<String>Distinguishing keywords. Never affects ranking.
members: Vec<String>The texts this cluster covers — the match key.
centroid: Option<Vec<f32>>Optional precomputed L2-normalized mean of the members’ embeddings. Absent when the producer clustered lexically.
support: u32Confirmed search-then-invoke observations behind this cluster.
seeded_support: u32How many of Self::support came from a seeding pass — a baseline
capture or a trace replay — rather than from live serving traffic.
Provenance only: nothing reads it during ranking, and two graphs differing only here rank identically and compare equal. It exists so a caller can see how much of a cluster’s confidence rests on seeded evidence, and discount it if the seed turns out to have taught something wrong.
Invariant: seeded_support <= support, enforced on load. Omitted from
the wire form when zero, so a live-only graph serializes byte-identically
to one produced before this field existed.
last_ts: u64Epoch-millis of this cluster’s most recent observation. Drives the
recency factor and eviction; 0 (default) means “as old as the graph”.
tools: BTreeMap<String, f32>Tool id → count of confirmed invocations. Orders the arm; the magnitude is discarded by the fusion.
skills: BTreeMap<String, f32>Skill id → count of confirmed invocations. Orders the arm; the magnitude is discarded by the fusion.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Intent
impl<'de> Deserialize<'de> for Intent
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>,
Auto Trait Implementations§
impl Freeze for Intent
impl RefUnwindSafe for Intent
impl Send for Intent
impl Sync for Intent
impl Unpin for Intent
impl UnsafeUnpin for Intent
impl UnwindSafe for Intent
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
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