MCPcopy Create free account
hub / github.com/InfinitiBit/graphbit / load_existing_memories

Method load_existing_memories

core/src/memory/service.rs:194–203  ·  view source on GitHub ↗

Load all existing memories from the store into the vector index.

(&self)

Source from the content-addressed store, hash-verified

192
193 /// Load all existing memories from the store into the vector index.
194 async fn load_existing_memories(&self) -> GraphBitResult<()> {
195 let all_memories = self.store.get_all_memories(&MemoryScope::default()).await?;
196 for memory in &all_memories {
197 let embedding = self.embedding_service.embed_text(&memory.content).await?;
198 self.vector_index
199 .insert(memory.id.clone(), embedding)
200 .await;
201 }
202 Ok(())
203 }
204
205 /// Create a brand-new memory: hash, embed, store, index, record history.
206 async fn create_memory(

Callers 1

newMethod · 0.80

Calls 4

get_all_memoriesMethod · 0.80
embed_textMethod · 0.80
insertMethod · 0.80
cloneMethod · 0.80

Tested by

no test coverage detected