The minimum useful metadata schema
For every chunk you embed, store:
- source — file path, URL, or document id
- chunk_index — position in the source
- updated_at — ISO timestamp of the source revision
- doc_type — markdown, pdf, code, html, conversation, etc.
- Anything that lets you filter at query time (tenant_id, language, project, classification level)
Filter before you rank
The single biggest performance win in production retrieval is metadata pre-filtering. Computing cosine against 10 million vectors is slow. Computing cosine against the 50,000 vectors that match {tenant: 'acme', lang: 'en'} is fast. Every serious vector store supports a where filter — use it.
Metadata becomes provenance
When the LLM answers, you want to show "source: handbook.md (updated 2026-04-12)". That citation comes straight from your metadata. Skip metadata at ingestion time and you cannot fake it later.