Search vault embeddings for similar content.
(
&self,
query_vector: &[f32],
top_k: usize,
)
| 171 | |
| 172 | /// Search vault embeddings for similar content. |
| 173 | pub fn vault_search( |
| 174 | &self, |
| 175 | query_vector: &[f32], |
| 176 | top_k: usize, |
| 177 | ) -> Result<Vec<SearchResult>, RepositoryError> { |
| 178 | let txn = self |
| 179 | .pristine |
| 180 | .read_txn() |
| 181 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 182 | txn.search_embeddings(query_vector, top_k) |
| 183 | .map_err(|e| RepositoryError::Database(e.to_string())) |
| 184 | } |
| 185 | |
| 186 | /// Count total embeddings stored. |
| 187 | pub fn vault_embedding_count(&self) -> Result<usize, RepositoryError> { |