ProjectTech4DevAI / ProjectTech4DevAI/kaapi-backend

Cleanup: Automated data retention system

Abierto
#1,183 0 comentarios 0 reacciones 1 asignado Ver en GitHub

@Prajna1999 ya está trabajando en esto.

Desde el 4/9/2026.

Lenguaje dominante
Python
Estrellas
18
Forks
10
Merge medio
2 d 20 h
PR fusionados (30 d)
14

Descripción

Is your feature request related to a problem?
We need a system to automatically clean up query and response data in the LLM calls table after a specified retention period. Without this, the database may become cluttered and inefficient.

Describe the solution you'd like

  • Implement a cron job to purge query/response data after a configurable retention window (default 1 week).
  • Handle one-time backlog separately from regular cron operations.
  • Write a cleanup strategy document detailing cron design, batching, and backlog handling.
  • Conduct a staging load test by duplicating ~20k LLM call rows ~5x in the copy_dev database to measure cleanup time. Do not use production data.
  • Ensure S3 cleanup is managed separately and not included in the DB cron/migration code.
Original issue

Context

query + response data in the LLM calls table will be cleaned up via a cron job after a configurable retention window (starting with 1 week).

A step-by-step cleanup strategy doc is to be written (cron design, batching, one-time backlog handling).

Scope / Acceptance criteria

  • Cron job to purge query/response data in the LLM calls table after a configurable retention window (default 1 week).
  • Handle one-time backlog separately from steady-state cron.
  • Write cleanup strategy doc (cron design, batching, backlog).
  • Staging load test: reuse the empty copy_dev database, duplicate staging's ~20k LLM call rows ~5x to reach ~1 lakh, and measure cleanup time. Do NOT pull prod data.
  • Keep S3 cleanup separate — do not bundle S3 deletion into the DB cron/migration code.

Notes

  • Guardrails input/output data is retained separately (anonymized, tagged as product enhancement) and is NOT part of this cleanup.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.