ProjectTech4DevAI / ProjectTech4DevAI/kaapi-backend

Database Cleanup: Implement cron job for retention

Offen
#1,176 0 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@Prajna1999 arbeitet bereits daran.

Seit 01.9.2026.

Vorherrschende Sprache
Python
Sterne
18
Forks
10
Ø Merge
2 T. 20 Std.
Gemergte PRs (30 T.)
14

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.