Skip to main content

MemoryRecallApi

Trait MemoryRecallApi 

Source
pub trait MemoryRecallApi: Send + Sync {
    // Required methods
    fn capabilities(&self) -> ApiCapabilities;
    fn wake(
        &self,
        request: MemoryWakeRequest,
    ) -> impl Future<Output = Result<MemoryRecallView, ApiError>> + Send;
    fn ask(
        &self,
        request: MemoryAskRequest,
    ) -> impl Future<Output = Result<MemoryRecallView, ApiError>> + Send;
}
Expand description

What an embedding product may ask of the kernel.

Reads only. Ingestion, projection and export have their own commands, idempotency and provenance inside the kernel; a consumer reaches them through the kernel’s own surfaces. What this trait promises is the part a consumer needs to recall — and to keep working, with a stub, when the kernel is absent.

Methods return named Send futures rather than using async fn, so the trait can be consumed generically from multi-threaded runtimes. It is not object-safe; consumers hold an implementation by generic parameter, which is also what lets a stub replace the kernel in their tests.

Required Methods§

Source

fn capabilities(&self) -> ApiCapabilities

What this implementation is and what it can do. Checked by consumers at startup, before anything is at stake.

Source

fn wake( &self, request: MemoryWakeRequest, ) -> impl Future<Output = Result<MemoryRecallView, ApiError>> + Send

Recall the bounded context of one about.

Source

fn ask( &self, request: MemoryAskRequest, ) -> impl Future<Output = Result<MemoryRecallView, ApiError>> + Send

Ask one question of the memory, under an explicit answer policy.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§