Context Aware Chunking

How is context aware chunking used in the RAG application? In the vector database we will have the chunk and its context. I am confused how is this consumed while retrieving.

I’m not a mentor for this course.

Similarity between embedding created using chunk data + context should help with retrieving the correct chunks during query time.

Here are the steps involved:

  1. For each chunk of a document, create a chunk specific context with respect to the entire document.
  2. Combine context and chunk data to create the final embedding and store in a vector db.
  3. At query time, retrieve chunks based on similarity between the raw query embedding and the vector store created earlier.

Here are links you’ll find helpful:

  1. Contextual Retrieval in AI Systems \ Anthropic
  2. claude-cookbooks/capabilities/contextual-embeddings/guide.ipynb at main · anthropics/claude-cookbooks · GitHub