SIAA maintains a comprehensive quality log in JSONL (JSON Lines) format, recording every query with detailed metrics. This enables administrators to track system performance, identify issues, and analyze usage patterns.
{ "ts": "2026-03-08T14:23:45", "tipo": "DOC", "alerta": "OK", "pregunta": "¿Cuál es la periodicidad del reporte SIERJU?", "respuesta": "El reporte SIERJU debe presentarse el quinto día hábil de cada mes, según lo establecido en el artículo 8 del Acuerdo PSAA16-10476...", "docs": ["acuerdo_no._psaa16-10476.md"], "ctx_chars": 2847, "tiempo_s": 8.42}
Detection criteria: Model responded “no encontré esa información” but the system HAD found relevant documents (>100 chars of context).
{ "tipo": "DOC", "alerta": "POSIBLE_ALUCINACION", "docs": ["acuerdo_psaa16-10476.md"], "ctx_chars": 2100, "respuesta": "No encontré esa información en los documentos disponibles."}
Possible causes:
Extractor selected wrong chunks
Context was irrelevant despite keyword matches
Model failed to interpret context correctly
Action: Review the query with /siaa/fragmento endpoint to verify context quality.
# Only cache hitscurl http://localhost:5000/siaa/log?tipo=CACHE_HIT# Only document queriescurl http://localhost:5000/siaa/log?tipo=DOC# Only conversational queriescurl http://localhost:5000/siaa/log?tipo=CONV# Only errorscurl http://localhost:5000/siaa/log?tipo=ERROR
# Possible hallucinationscurl http://localhost:5000/siaa/log?alerta=POSIBLE_ALUCINACION# Queries with no contextcurl http://localhost:5000/siaa/log?alerta=SIN_CONTEXTO# System errorscurl http://localhost:5000/siaa/log?alerta=ERROR
Get human-readable text output for terminal viewing:
curl http://localhost:5000/siaa/log?formato=txt
Output:
=== Log SIAA — últimas 50 de 1247 consultas ===Errores: 3 | Posibles alucinaciones: 12 | Cache hits: 456 | T.prom: 9.2s[2026-03-08T14:23:45] DOC 8.4s P: ¿Cuál es la periodicidad del reporte SIERJU? R: El reporte SIERJU debe presentarse el quinto día hábil de cada mes, según lo esta... Docs: ['acuerdo_no._psaa16-10476.md'][2026-03-08T14:22:10] ⚠ [POSIBLE_ALUCINACION] DOC 12.1s P: ¿Qué sanciones hay por no reportar a tiempo? R: No encontré esa información en los documentos disponibles. Docs: ['acuerdo_no._psaa16-10476.md']
# Last 20 possible hallucinationscurl "http://localhost:5000/siaa/log?n=20&alerta=POSIBLE_ALUCINACION"# Last 100 document queries in text formatcurl "http://localhost:5000/siaa/log?n=100&tipo=DOC&formato=txt"
SIAA automatically rotates logs when they exceed LOG_MAX_LINEAS (default: 5,000 entries):
LOG_MAX_LINEAS = 5000# When rotation triggers:# 1. Read existing log# 2. Keep only the most recent 4,000 entries# 3. Overwrite file with trimmed log# 4. Append new entry
Log file size typically stays under 2 MB with default settings.