Is there a way to delete a namespace through RAG component
Hi, I have been looking at the docs, asking the convex AI, I cannot find a way to manually delete the namespace via RAG component through the API.
When I run "await rag.add(ctx, { namespace: ..., etc... };"
* This should create the RAG data
* It runs "await this.getOrCreateNamespace(ctx, { ... });" under the hood
In my applicaiton, once I delete all the RAG entries, I need to also delete it's associated namespace.
I couldn't find any API for this.
The RAG component only has the following methods when I do "await components.rag.namespaces.{METHODS LISTED BELOW}"
* get
* getOrCreate
* list
* lookup
* promoteToReady
I would love a "delete" 😍 where I can pass in the namespace id and it will delete that namespace. Also, if it could automagically find all it's rag entries associated with it to delete, that would be very helpful too instead of writing the logic.
2 Replies
Hey! I just added a components.rag.namespaces.deleteNamespace where you pass in a namespaceId, if there are no entries
Also a .deleteSync that will also delete all entries syncrhonously (it's an action that may fail but can be safely retried)
Also a function to list namespace IDs by a string name.
They're all in the latest alpha - can you take it for a spin and let me know if you see any issues / gaps?
npm i @convex-dev/rag@alpha
Amazing Ian!
Will give it a try soon and let you know!
deleteNamespace works as intended!
Thank you!