Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete and delete_collection on CrateDBVectorSearch don't delete the actual embeddings #11

Closed
1 of 14 tasks
andnig opened this issue Nov 20, 2023 · 5 comments · Fixed by #14
Closed
1 of 14 tasks
Labels
bug Something isn't working

Comments

@andnig
Copy link

andnig commented Nov 20, 2023

System Info

Langchain 0.0.315

Who can help?

@amotl

Information

  • The official example notebooks/scripts
  • My own modified scripts

Related Components

  • LLMs/Chat Models
  • Embedding Models
  • Prompts / Prompt Templates / Prompt Selectors
  • Output Parsers
  • Document Loaders
  • Vector Stores / Retrievers
  • Memory
  • Agents / Agent Executors
  • Tools / Toolkits
  • Chains
  • Callbacks/Tracing
  • Async

Reproduction

from langchain.schema import Document

doc = Document(page_content="this is such a nice text")
vector_store = CrateDBVectorSearch.from_documents([doc], OpenAIEmbeddings(), collection_name="wow_such_nice", connection_string="crate://localhost:4200?schema=langchain")
vector_store.delete_collection()

Expected behavior

The collection should be deleted as well as all embeddings which are part of this collection.
While the collection gets deleted from the collection table, the embeddings of this collection in the embedding table are still there.

@amotl

This comment was marked as off-topic.

@amotl
Copy link

amotl commented Nov 20, 2023

Hi @andnig,

thanks for your report.

While the collection gets deleted from the collection table, the embeddings of this collection in the embedding table are still there.

The cascading delete does not work because CrateDB doesn't know anything about foreign key relationships. The corresponding operation will probably need to be emulated. I will look into how this could be implemented.

With kind regards,
Andreas.

@hlcianfagna
Copy link

Relates with crate/crate#1376

@ckurze
Copy link

ckurze commented Nov 20, 2023

Thanks for reporting - as soon as we slightly change the logic how we handle tables and embeddings (#12), this operation will translate into a DELETE FROM <collection_name> or DROP TABLE <collection_name>, respectively. We should prioritize #12 over this issue.

@amotl amotl closed this as completed in #14 Nov 21, 2023
@amotl amotl added the bug Something isn't working label Nov 21, 2023
@amotl
Copy link

amotl commented Nov 21, 2023

Dear @andnig,

GH-14 fixed this problem. Thanks again for the report.

With kind regards,
Andreas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants