pub struct Retriever {
pub tunables: RetrievalTunables,
}Fields§
§tunables: RetrievalTunablesImplementations§
Source§impl Retriever
impl Retriever
Sourcepub fn candidates(
&self,
indexes: &Indexes,
store: &SqliteStore,
request: &QueryRequest,
) -> Result<Candidates>
pub fn candidates( &self, indexes: &Indexes, store: &SqliteStore, request: &QueryRequest, ) -> Result<Candidates>
Index-side candidate generation: dense and lexical top-k, both best-first. Separated from rank() so the eval harness can feed rank() through its CachingStore while candidates come from real indexes.
Sourcepub fn rank<S: Store + ?Sized>(
&self,
store: &S,
request: &QueryRequest,
pool: &Candidates,
reranker: Option<&dyn RerankScorer>,
) -> Result<Vec<QueryResult>>
pub fn rank<S: Store + ?Sized>( &self, store: &S, request: &QueryRequest, pool: &Candidates, reranker: Option<&dyn RerankScorer>, ) -> Result<Vec<QueryResult>>
Fuse, gate, and blend pre-computed candidates. With a scorer the primary term is its 0..1 cross-encoder score gated at rerank_gate; without one it is cosine similarity gated at the legacy cosine_gate, recomputed from stored embeddings for candidates that arrived through the lexical list only.
Sourcepub fn rank_project_first<S, G>(
&self,
store: &S,
request: &QueryRequest,
project: &str,
generate: G,
reranker: Option<&dyn RerankScorer>,
) -> Result<ProjectFirst>
pub fn rank_project_first<S, G>( &self, store: &S, request: &QueryRequest, project: &str, generate: G, reranker: Option<&dyn RerankScorer>, ) -> Result<ProjectFirst>
Ranks project’s memories first and searches request’s wider scope
only when nothing in the project clears the bar. generate makes the
candidates for either request. The project was not named by the
caller, so its pass never gets the relaxed floor of an exhausted named
scope.
Sourcepub fn rank_project_preferred<S, G>(
&self,
store: &S,
request: &QueryRequest,
project: &str,
generate: G,
reranker: Option<&dyn RerankScorer>,
) -> Result<ProjectFirst>
pub fn rank_project_preferred<S, G>( &self, store: &S, request: &QueryRequest, project: &str, generate: G, reranker: Option<&dyn RerankScorer>, ) -> Result<ProjectFirst>
rank_project_first in one pass, for a caller that cannot afford a
second rerank: ranks request’s scope once and moves project’s
results that reach blend::ABSTAIN_RERANK_BAR ahead of the rest, the
bar that decides rank_project_first’s project pass, so a weak local
match never displaces a strong one from elsewhere. A project memory
outside the blended shortlist of the wide scope (the top
3 * request.limit by primary score) is not looked for. On
an answer the scorer could not rerank, relevance is cosine, which the
bar does not calibrate, so the order then means little.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Retriever
impl RefUnwindSafe for Retriever
impl Send for Retriever
impl Sync for Retriever
impl Unpin for Retriever
impl UnsafeUnpin for Retriever
impl UnwindSafe for Retriever
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
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> Pointable for T
impl<T> Pointable for T
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().