# Metadata

Store the source file, section and date with each chunk.

AI developers · Part 05: Embeddings + RAG · Card 11 of 14 · Last updated 2026-10-13

## Analogy

Foreign keys for your chunks, so you can filter them and link back to where they came from.

## In an agent

Metadata lets the agent filter by source and cite where an answer came from.

## Questions people ask

### What metadata should I store with each RAG chunk?

At least the source document, the section heading and a date. With these you can filter searches, for example only the current policy or one product's docs, and the agent can cite where its answer came from so users can check it. Store the metadata in normal columns next to the vector.

### How does metadata help an agent cite sources?

Each retrieved chunk carries its file name and section, so the model can name them in the answer and your UI can link back to the original page. Users can then verify the answer, and when something is wrong you can see at once which document caused it.

## Related concepts

- [Vector database](https://studyvisually.com/learn/tech/ai-developers/embeddings-rag/vector-database)
- [RAG](https://studyvisually.com/learn/tech/ai-developers/embeddings-rag/rag)
- [Indexing (run once)](https://studyvisually.com/learn/tech/ai-developers/embeddings-rag/rag-indexing)
- [Querying (every question)](https://studyvisually.com/learn/tech/ai-developers/embeddings-rag/rag-query)

Web page: https://studyvisually.com/learn/tech/ai-developers/embeddings-rag/chunk-metadata
Study this card in the app: https://studyvisually.com/app/learn?category=ai-developers&card=chunk-metadata
