M
Mastraโ€ข3w ago
yantakus

How to clean up embeddings?

Hi there. I'm building a RAG app with Mastra. I create vector embeddings for uploaded documents. I use a separate index per user and add docId to metadata to use when filtering by document. But I can't understand, how do I clean up stale vectors when a user deletes a document? Should I remove each of them in a loop, previously storing all vector ids somewhere? Or maybe I'm missing something? My use case seems to be a pretty standard one for RAG, so I'm a bit confused, why this is not covered in the docs. Just to be clear, I like the docs (for example comparing to Convex Agent/RAG components docs).
2 Replies
Mastra Triager
Mastra Triagerโ€ข3w ago
๐Ÿ“ Created GitHub issue: https://github.com/mastra-ai/mastra/issues/9503
GitHub
[DISCORD:1433193170182738144] How to clean up embeddings? ยท Issue ...
This issue was created from Discord post: https://discord.com/channels/1309558646228779139/1433193170182738144 Hi there. I'm building a RAG app with Mastra. I create vector embeddings for uploa...
_roamin_
_roamin_โ€ข3w ago
Hi @yantakus ! I don't think we have the utils to do that available at the moment, you can follow the GH issue for updates, but not sure when this will be worked on. Open for PRs ๐Ÿ˜‰

Did you find this page helpful?