Insert an embedding for the given memory.
(&self, memory_id: MemoryId, embedding: Vec<f32>)
| 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`. |
no outgoing calls