Wire the guarded conversational RAG answer layer end-to-end

This commit is contained in:
2026-08-05 14:33:13 +07:00
parent 834d9e51b0
commit ef08b4929e
127 changed files with 37921 additions and 169 deletions
@@ -0,0 +1,14 @@
CREATE TABLE IF NOT EXISTS rag_retrieval_trace (
trace_id uuid PRIMARY KEY,
query_text text NOT NULL,
subject_scope text NOT NULL,
query_intent text NOT NULL,
decision text NOT NULL,
reason text NOT NULL,
resolved_drug_id text,
citations jsonb NOT NULL DEFAULT '[]'::jsonb,
created_at timestamptz NOT NULL DEFAULT now()
);
CREATE INDEX IF NOT EXISTS rag_retrieval_trace_created_at_idx
ON rag_retrieval_trace (created_at DESC);