ProjectTech4DevAI / ProjectTech4DevAI/kaapi-backend

Database Cleanup: Implement cron job for retention

Aperta
#1,176 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@Prajna1999 ci sta già lavorando.

Dal 1/9/2026.

Lingua principale
Python
Stelle
18
Fork
10
Merge medio
2g 20h
PR unite (30g)
14

Descrizione

Is your feature request related to a problem?
The database currently retains llm call rows, which can lead to unnecessary data accumulation.

Describe the solution you'd like

  • Implement a cron job in Kaapi to clean up user queries and llm responses older than a configurable value (1 hr, 1 day, 1 week, etc.).
  • Retain llm call metadata for debugging purposes but limit the retention of complete user queries and llm responses to a maximum of 2-3 days.
  • Ensure voicenotes remain in S3 for at least the TTL (1 hour) when using pre-signed URLs for TTS responses.
Original issue
  1. Kaapi will keep only the llm call metadata and run a cron job to clean up the user query and llm response which are older than a configurable value (1 hr, 1 day, 1 week etc)

  2. Reasons why we cannot immediately drop the messages:
    - for tts response, if we send back a pre-signed url of the voicenote, we'll need to keep the voicenote in s3 for atleast the time period of the TTL (1 hour currently)
    - debugging: on rare occassions, the complete user query and llm response has helped us debug certain issues with glific; but we only need that data for 2-3 days at max beyond which we can clean up the user query and llm response

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.