Skip to main content

IndexableMemory

Trait IndexableMemory 

Source
pub trait IndexableMemory {
    // Required methods
    fn build_hierarchical_index(
        &self,
    ) -> impl Future<Output = HierarchicalIndex> + Send;
    fn build_spatiotemporal_index(
        &self,
    ) -> impl Future<Output = SpatiotemporalIndex> + Send;
    fn query_by_time_range(
        &self,
        start: DateTime<Utc>,
        end: DateTime<Utc>,
        limit: usize,
    ) -> impl Future<Output = Vec<Uuid>> + Send;
}
Expand description

Extension trait for integrating indexing with SelfLearningMemory.

Provides methods to build and query hierarchical indexes from memory.

Required Methods§

Source

fn build_hierarchical_index( &self, ) -> impl Future<Output = HierarchicalIndex> + Send

Build a hierarchical index from all episodes in memory.

§Returns

A hierarchical index containing all episodes.

Source

fn build_spatiotemporal_index( &self, ) -> impl Future<Output = SpatiotemporalIndex> + Send

Build a spatiotemporal index from all episodes in memory.

§Returns

A spatiotemporal index containing all episodes.

Source

fn query_by_time_range( &self, start: DateTime<Utc>, end: DateTime<Utc>, limit: usize, ) -> impl Future<Output = Vec<Uuid>> + Send

Query episodes by time range using the index.

§Arguments
  • start - Start of the time range
  • end - End of the time range
  • limit - Maximum number of results
§Returns

Vector of episode IDs within the time range.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§