Skip to main content

KuzuStore

Struct KuzuStore 

Source
pub struct KuzuStore { /* private fields */ }

Implementations§

Source§

impl KuzuStore

Source

pub fn open(path: &Path, machine_id: String) -> Result<Self>

Source

pub fn in_memory(machine_id: String) -> Result<Self>

Source

pub fn machine_id(&self) -> &str

Source

pub fn diagnostic(&self) -> Result<String>

Source

pub fn tombstone_exists(&self, id: Uuid) -> Result<bool>

Source§

impl KuzuStore

Source

pub fn find_or_create_entity( &self, name: &str, entity_type: &str, ) -> Result<Entity>

Source

pub fn memory_content_exists(&self, content_prefix: &str) -> Result<bool>

Source

pub fn unconsolidated_memories(&self, limit: usize) -> Result<Vec<Memory>>

Source

pub fn memories_created_between( &self, start: &DateTime<Utc>, end: &DateTime<Utc>, ) -> Result<Vec<Memory>>

Source

pub fn mark_consolidated( &self, raw_id: Uuid, distilled_id: Uuid, model: &str, ) -> Result<()>

Source

pub fn consolidation_count(&self) -> Result<usize>

Source

pub fn delete_consolidated_raw(&self) -> Result<usize>

Source

pub fn rebuild_vector_index(&self) -> Result<()>

Source

pub fn clear_ingest_log(&self) -> Result<usize>

Source

pub fn delete_memories_by_source(&self, source: &str) -> Result<usize>

Source

pub fn is_file_ingested(&self, file_path: &str) -> Result<bool>

Source

pub fn is_file_changed(&self, file_path: &str, file_hash: &str) -> Result<bool>

Source

pub fn mark_ingested( &self, file_path: &str, file_hash: &str, memory_count: usize, source: &str, ) -> Result<()>

Source

pub fn ingested_file_count(&self) -> Result<usize>

Source§

impl KuzuStore

Source

pub fn get_conversation(&self, id: Uuid) -> Result<Option<Conversation>>

Source

pub fn get_memory_with_embedding(&self, id: Uuid) -> Result<Option<Memory>>

Source

pub fn sync_log_since(&self, after_seq: u64) -> Result<Vec<SyncEntry>>

Source

pub fn apply_create_memory( &self, mem: &Memory, origin_machine_id: &str, origin_seq: i64, ) -> Result<ApplyOutcome>

Source

pub fn with_write_transaction<T>( &self, f: impl FnOnce(&Connection<'_>) -> Result<T>, ) -> Result<T>

Source

pub fn apply_create_memory_on_tx( &self, conn: &Connection<'_>, mem: &Memory, origin_machine_id: &str, origin_seq: i64, ) -> Result<ApplyOutcome>

Source

pub fn apply_create_conversation_on_tx( &self, conn: &Connection<'_>, conv: &Conversation, origin_machine_id: &str, origin_seq: i64, ) -> Result<ApplyOutcome>

Source

pub fn apply_create_entity_on_tx( &self, conn: &Connection<'_>, entity: &Entity, origin_machine_id: &str, origin_seq: i64, ) -> Result<ApplyOutcome>

Source

pub fn apply_create_relation_on_tx( &self, conn: &Connection<'_>, relation: &Relation, origin_machine_id: &str, origin_seq: i64, ) -> Result<ApplyOutcome>

Source

pub fn note_relation_created(&self, from_id: Uuid)

Source

pub fn apply_update_memory( &self, incoming: &Memory, origin_machine_id: &str, origin_seq: i64, ) -> Result<(ApplyOutcome, Option<Memory>)>

Source

pub fn apply_delete_memory( &self, node_id: &str, origin_machine_id: &str, origin_seq: i64, ) -> Result<ApplyOutcome>

Source

pub fn apply_create_conversation( &self, conv: &Conversation, origin_machine_id: &str, origin_seq: i64, ) -> Result<ApplyOutcome>

Source

pub fn apply_upsert_conversation( &self, conv: &Conversation, origin_machine_id: &str, origin_seq: i64, ) -> Result<ApplyOutcome>

Source

pub fn apply_delete_conversation( &self, node_id: &str, origin_machine_id: &str, origin_seq: i64, ) -> Result<ApplyOutcome>

Source

pub fn apply_create_entity( &self, entity: &Entity, origin_machine_id: &str, origin_seq: i64, ) -> Result<ApplyOutcome>

Source

pub fn apply_upsert_entity( &self, entity: &Entity, origin_machine_id: &str, origin_seq: i64, ) -> Result<ApplyOutcome>

Source

pub fn apply_delete_entity( &self, node_id: &str, origin_machine_id: &str, origin_seq: i64, ) -> Result<ApplyOutcome>

Source

pub fn apply_create_relation( &self, relation: &Relation, origin_machine_id: &str, origin_seq: i64, ) -> Result<ApplyOutcome>

Source

pub fn apply_delete_relation( &self, node_id: &str, relation: Option<&Relation>, origin_machine_id: &str, origin_seq: i64, ) -> Result<ApplyOutcome>

Source

pub fn sync_log_page( &self, after_seq: u64, limit: Option<usize>, ) -> Result<Vec<SyncEntry>>

Source

pub fn get_sync_state(&self, peer_id: &str) -> Result<Option<SyncState>>

Source

pub fn set_sync_state(&self, state: &SyncState) -> Result<()>

Source

pub fn get_all_sync_states(&self) -> Result<Vec<SyncState>>

Source

pub fn all_entities(&self) -> Result<Vec<Entity>>

Source

pub fn memories_for_entity(&self, entity_id: Uuid) -> Result<Vec<Memory>>

Source

pub fn unassociated_memories(&self) -> Result<Vec<Memory>>

Source

pub fn related_entity_names(&self, entity_id: Uuid) -> Result<Vec<String>>

Source

pub fn max_sync_seq(&self) -> Result<u64>

Source

pub fn backfill_project_paths(&self) -> Result<u64>

Source

pub fn memories_by_project_path( &self, project_path: &str, ) -> Result<Vec<Memory>>

Source

pub fn all_memories_with_embeddings(&self) -> Result<Vec<Memory>>

Source

pub fn backfill_sync_log(&self) -> Result<u64>

Source§

impl KuzuStore

Source

pub fn upsert_machine(&self, id: &str, name: &str) -> Result<()>

Source

pub fn get_machine_name(&self, id: &str) -> Result<Option<String>>

Source

pub fn get_all_machines(&self) -> Result<HashMap<String, String>>

Source

pub fn backfill_machine_id(&self, machine_id: &str) -> Result<u64>

Source

pub fn register_machine(&self, identity: &MachineIdentity) -> Result<()>

Trait Implementations§

Source§

impl Store for KuzuStore

Source§

fn store_memory(&self, memory: &Memory) -> Result<()>

Source§

fn get_memory(&self, id: Uuid) -> Result<Option<Memory>>

Source§

fn delete_memory(&self, id: Uuid) -> Result<()>

Source§

fn store_entity(&self, entity: &Entity) -> Result<()>

Source§

fn get_entity(&self, id: Uuid) -> Result<Option<Entity>>

Source§

fn find_entity_by_name(&self, name: &str) -> Result<Option<Entity>>

Source§

fn store_conversation(&self, conversation: &Conversation) -> Result<()>

Source§

fn store_relation(&self, relation: &Relation) -> Result<()>

Source§

fn get_relations( &self, node_id: Uuid, relation_type: Option<RelationType>, ) -> Result<Vec<Relation>>

Source§

fn traverse( &self, start_id: Uuid, depth: u32, ) -> Result<Vec<(Memory, Vec<Relation>)>>

Source§

fn memories_by_source(&self, source: &str) -> Result<Vec<Memory>>

Source§

fn memories_by_type(&self, memory_type: MemoryType) -> Result<Vec<Memory>>

Source§

fn memories_needing_decay(&self, threshold_days: u32) -> Result<Vec<Memory>>

Source§

fn update_memory(&self, memory: &Memory) -> Result<()>

Source§

fn record_access(&self, memory: &Memory) -> Result<()>

Source§

fn memory_count(&self) -> Result<usize>

Source§

fn all_memory_ids(&self) -> Result<Vec<Uuid>>

Source§

fn all_relations(&self) -> Result<Vec<Relation>>

Source§

impl Send for KuzuStore

Source§

impl Sync for KuzuStore

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more