Prompt
What should I use to track citations in AI search?
Latest observation
Oct 21, 2026
OpenAI APIWeb search: off
Use a structured citation store rather than plain text logs.
Best choice
Store each citation as a record with:
- query_id / session_id
- source_id
- document title
- URL
- snippet used
- timestamp
- relevance score
- model answer span it supports
A good format is:
- Relational DB if you need reliable auditing and filtering
- JSON / document store if you want flexibility
- Vector DB + metadata store if you’re doing retrieval, but still keep citations in a normal DB
Practical recommendation
For most AI search systems:
- PostgreSQL for citation tracking
- Optional: pgvector for embeddings
- Store source metadata in a separate
sourcestable - Store per-answer citations in an
answer_citationstable
Why this is better
It lets you:
- verify where each answer came from
- audit hallucinations
- regenerate answers with the same evidence
- show inline citations to users
- measure source quality over time
Minimal schema
sources(id, url, title, publisher, published_at, content_hash)
answers(id, query, response, created_at)
answer_citations(id, answer_id, source_id, quote, start_offset, end_offset, confidence)
If you mean “what format?”
Use:
- JSONL for prototyping
- PostgreSQL for production
- LangSmith / Weights & Biases / OpenTelemetry if you want observability too
If you want, I can suggest a citation-tracking setup for your specific stack, like RAG with Pinecone, Postgres-only, or Elastic + LLMs.