최소 useful 메타데이터 스키마
임베딩하는 모든 청크에 저장해:
- source — 파일 경로, URL, 또는 문서 id
- chunk_index — source 안에서의 위치
- updated_at — source revision 의 ISO 타임스탬프
- doc_type — markdown, pdf, code, html, conversation 등
- query 시점에 필터 가능한 무엇이든 (tenant_id, language, project, classification level)
ranking 전에 filter
프로덕션 retrieval 에서 단일 가장 큰 성능 win 이 메타데이터 pre-filtering. 1000만 벡터에 cosine 은 느려. {tenant: 'acme', lang: 'en'} 매칭하는 5만 벡터에 cosine 은 빨라. 진지한 vector store 는 다 where 필터 지원 — 써.
메타데이터가 곧 provenance
LLM 이 답할 때 "source: handbook.md (updated 2026-04-12)" 보여주고 싶잖아. 그 인용은 메타데이터에서 직접 옴. ingest 시점에 메타데이터 빼면 나중에 만들 수 없어.