defenseunicorns / leapfrogai

Production-ready Generative AI for local, cloud native, airgap, and edge deployments.
https://leapfrog.ai
Apache License 2.0
245 stars 25 forks source link

feat(api): Scheduled Vector Store Expiration #593

Open gphorvath opened 4 weeks ago

gphorvath commented 4 weeks ago

User Story

As a API User I want automated expiration of Vector Stores
So that I can save space and gracefully relay the expiration status of a vector store to the end user.

Acceptance Criteria

Given a Vector Store entry in the database When the Vector Store is expired Then the entry is automatically deleted by a scheduled Postgres function

Given a user querying an expired Vector Store When the query is executed Then the system gracefully informs the user of the expiration and handles the query appropriately

Additional context

Currently Vector Store expiration is checked on querying some endpoints and if expired the vector store is deleted. To save space, we should automate this in some sort of Postgres function that runs on an interval and we should also check to make sure we gracefully fail whenever a user tries to query an expired vector store.