← Retrieval-augmented generation (RAG)
Lesson 2 of 4
Chunking and indexing
Watch, read the card, then practise. Chunking · Vector databases
The video for this lesson is being recorded.
Meanwhile, the notes below and the 60-second cards cover the same ideas.
Practise this topicChunking
Chunking splits documents into pieces small enough to match a question precisely and fit in the prompt.
Remember: Chunk size is a setting to test, not a fixed rule.
Vector databases
A vector database stores each chunk's embedding with its text and metadata, and searches them by similarity.
Remember: Store the source with every chunk, so answers can cite it.
Try the example in Code Lab
doc, size, overlap = 10_000, 500, 100 step = size - overlap print(-(-(doc - size) // step) + 1)