pub struct GraphDedupConfig {
pub certain_similarity: f64,
pub review_similarity: f64,
pub max_candidates: usize,
}Expand description
Similarity bands that decide when entity dedup pays for a model call.
Dedup asks one question — is this the same thing? — and that is a question about meaning, so the bands are cut on raw cosine similarity between the candidate’s abstract and an existing entity’s, never on the retrieval score (which folds in hotness and utility: a popular unrelated entity would otherwise buy a model call, and every entity gets more popular as the graph grows).
similarity >= certain_similarity → the same entity; resolved locally
review_similarity ..< certain → ambiguous; one model call decides
similarity < review_similarity → new entity; created locallyDefaults (0.92 / 0.82 / 3) are cut from the similarity distribution of
a LongMemEval baseline store (192 entities, 150 sampled candidates, 750
neighbour pairs). BGE-Small puts every same-language pair in a narrow high
band — median neighbour 0.75, median nearest neighbour 0.81 — so the cuts
sit at its tail, not at intuitive-looking round numbers: 0.92 is the 96th
percentile of pairs, where abstracts are paraphrases of each other, and 0.82
the ~78th, below which pairs are merely same-topic. Candidates averaged 1.1
neighbours above 0.82, so a cap of three bounds the worst case without
binding the normal one.
Fields§
§certain_similarity: f64At or above this cosine similarity the candidate is treated as the same
entity and resolved without a model call. Default 0.92.
review_similarity: f64Below this cosine similarity the candidate is treated as new and created
without a model call. Default 0.82.
max_candidates: usizeHow many existing entities, by similarity rank, dedup may fetch and hand
to the model. Caps prompt size and comparison count so neither can grow
with the graph. Default 3.
Implementations§
Trait Implementations§
Source§impl Clone for GraphDedupConfig
impl Clone for GraphDedupConfig
Source§fn clone(&self) -> GraphDedupConfig
fn clone(&self) -> GraphDedupConfig
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 GraphDedupConfig
impl Debug for GraphDedupConfig
Source§impl Default for GraphDedupConfig
impl Default for GraphDedupConfig
Source§impl<'de> Deserialize<'de> for GraphDedupConfigwhere
GraphDedupConfig: Default,
impl<'de> Deserialize<'de> for GraphDedupConfigwhere
GraphDedupConfig: Default,
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 GraphDedupConfig
impl RefUnwindSafe for GraphDedupConfig
impl Send for GraphDedupConfig
impl Sync for GraphDedupConfig
impl Unpin for GraphDedupConfig
impl UnsafeUnpin for GraphDedupConfig
impl UnwindSafe for GraphDedupConfig
Blanket Implementations§
impl<T> AsyncFriendly for T
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>,
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 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>
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().