| 36 | } |
| 37 | |
| 38 | bool VectorIndex::add(uint32_t chunk_id, const float* embedding) { |
| 39 | if (!impl_->loaded || !impl_->index) return false; |
| 40 | |
| 41 | auto result = impl_->index->add(chunk_id, embedding); |
| 42 | if (!result) { |
| 43 | fprintf(stderr, "[VIDX] Failed to add chunk %u\n", chunk_id); |
| 44 | return false; |
| 45 | } |
| 46 | return true; |
| 47 | } |
| 48 | |
| 49 | bool VectorIndex::save(const std::string& path) { |
| 50 | if (!impl_->loaded || !impl_->index) return false; |