You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add removeDocument() method to EmbeddingsStoreInterface #132
The EmbeddingsStoreInterface currently supports adding documents and similarity search, but lacks a method to remove/delete documents from the vector store. This is needed for complete CRUD operations.
Proposed API
interface EmbeddingsStoreInterface
{
publicfunctionaddDocument(EmbeddingInterface$embedding): void;
/** * @param EmbeddingInterface[] $embeddings */publicfunctionaddDocuments(array$embeddings): void;
/** * Remove a document and all its chunks from the vector store. * * @param string $identifier The document identifier (e.g., "doc-123" will remove "doc-123-chunk-0", "doc-123-chunk-1", etc.) */publicfunctionremoveDocument(string$identifier): void;
/** * @param float[] $vector * @param array<string, mixed> $additionalArguments * * @return EmbeddingInterface[] */publicfunctionsimilaritySearch(array$vector, int$k = 4, array$additionalArguments = []): array;
}
Implementation Notes
For Qdrant (QdrantEmbeddingsStore):
Use Qdrant's deleteByFilter() method with a filter matching all points where the identifier starts with the document ID
Alternative: Use scroll() to find all point IDs matching the pattern, then delete() them
Use Case
When documents are updated or removed from a system, their embeddings should also be removed from the vector store to keep the data synchronized and avoid outdated search results.
Activity