MCPcopy Index your code
hub / github.com/InfinitiBit/graphbit / insert

Method insert

core/src/memory/vector.rs:34–40  ·  view source on GitHub ↗

Insert an embedding for the given memory.

(&self, memory_id: MemoryId, embedding: Vec<f32>)

Source from the content-addressed store, hash-verified

32
33 /// Insert an embedding for the given memory.
34 pub async fn insert(&self, memory_id: MemoryId, embedding: Vec<f32>) {
35 let mut entries = self.entries.write().await;
36 entries.push(VectorEntry {
37 memory_id,
38 embedding,
39 });
40 }
41
42 /// Search for the `top_k` most similar entries to `query_embedding`,
43 /// returning `(MemoryId, similarity_score)` pairs above `threshold`.

Callers 15

py_object_to_serde_jsonFunction · 0.80
set_variableMethod · 0.80
python_to_json_valueMethod · 0.80
register_toolMethod · 0.80
python_dict_to_jsonFunction · 0.80
add_metadataMethod · 0.80
azureMethod · 0.80
create_documentsMethod · 0.80
execute_streamingMethod · 0.80

Calls

no outgoing calls