pub struct RetrievalEngine { /* private fields */ }Expand description
The retrieval engine drives subconscious memory injection.
Implementations§
Source§impl RetrievalEngine
impl RetrievalEngine
Sourcepub fn new(project_root: &Path, _config: Config) -> Self
pub fn new(project_root: &Path, _config: Config) -> Self
Create a new retrieval engine for a project.
Sourcepub async fn retrieve_for_prompt(
&self,
prompt: &str,
sync_state: &SyncState,
) -> RetrievalResult
pub async fn retrieve_for_prompt( &self, prompt: &str, sync_state: &SyncState, ) -> RetrievalResult
Retrieve memories relevant to a prompt for UserPromptSubmit injection.
Sourcepub fn check_for_updates(&self, sync_state: &mut SyncState) -> Option<String>
pub fn check_for_updates(&self, sync_state: &mut SyncState) -> Option<String>
Lightweight check for updates since last sync (PreToolUse hook).
Sourcepub fn format_for_stdout(&self, result: &RetrievalResult) -> String
pub fn format_for_stdout(&self, result: &RetrievalResult) -> String
Format a retrieval result as XML for stdout injection.
Sourcepub fn format_session_start(
&self,
hot_cache: &CognitiveCache,
soul_content: Option<&str>,
) -> String
pub fn format_session_start( &self, hot_cache: &CognitiveCache, soul_content: Option<&str>, ) -> String
Format the initial session-start injection.
pub fn load_soul_content(&self) -> Option<String>
Auto Trait Implementations§
impl Freeze for RetrievalEngine
impl RefUnwindSafe for RetrievalEngine
impl Send for RetrievalEngine
impl Sync for RetrievalEngine
impl Unpin for RetrievalEngine
impl UnsafeUnpin for RetrievalEngine
impl UnwindSafe for RetrievalEngine
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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