NLQ — How It Works
The LLM receives the database schema and generates SQL from a plain question.
User: "What topics came up most in cost-mgmt-dev last month?"
LLM: [SYNTHESISE]
SELECT substr(text, 1, 120) as snippet, timestamp
FROM messages
WHERE channel_id = (SELECT id FROM channels WHERE name = 'cost-mgmt-dev')
AND timestamp >= unixepoch('now', '-1 month')
ORDER BY timestamp DESC
LIMIT 100
What the archive captures: messages, thread replies (full depth), file metadata, user profiles.
Not captured: message edits/deletions, reactions, presence status.
Error handling: invalid SQL from the LLM is caught gracefully — the error is shown to the user with no crash.