-- F-08 durable conversation history: replaces RagAgent's in-process dict -- (lost on restart, not shared across workers). Append-only; `id`'s -- insertion order is the "oldest -> newest" ordering the understanding LLM -- prompt already expects, no separate turn-index column needed. CREATE TABLE IF NOT EXISTS rag_conversation_turn ( id bigserial PRIMARY KEY, conversation_id text NOT NULL, line text NOT NULL, created_at timestamptz NOT NULL DEFAULT now() ); CREATE INDEX IF NOT EXISTS rag_conversation_turn_conv_idx ON rag_conversation_turn (conversation_id, id);