Large source’s chunks are overrides small source’s chunks A retrieval-ranking problem, not an embedding-generation problem, explains why chunks from a large source override chunks from a small source in a RAG pipeline, according to a technical response to the issue. Because the large sources contribute significantly more chunks, they can dominate the candidate pool during similarity search, since vector search does not automatically prioritize smaller or newer documents. The response recommends metadata filtering with a source_id per chunk, hybrid retrieval combining dense vector search with BM25, cross-encoder reranking, source-aware ranking, and verifying that the PDF's five chunks were embedded, stored and returned, plus running the query directly against the vector database to inspect the top 10 retrieved chunks with their source metadata and similarity scores. This sounds like a retrieval-ranking issue rather than an embedding-generation issue. Since your large sources contribute significantly more chunks, they may dominate the candidate pool during similarity search. Vector search doesn’t automatically prioritize smaller or newer documents. A few things you could try: Metadata filtering: Attach a source id or document identifier to each chunk and filter retrieval to the relevant PDF when the user specifies it. Hybrid retrieval: Combine dense vector search with BM25 so exact heading and keyword matches aren’t missed. Reranking: Retrieve a broader set of candidates and use a cross-encoder reranker to improve relevance. Source-aware ranking: Apply a controlled source-priority score when you know which document the user wants. Check chunking and indexing: Verify that the PDF’s five chunks were successfully embedded, stored and included in the retrieval results. One important debugging step: run the query directly against your vector database and inspect the top 10 retrieved chunks, including their source metadata and similarity scores. That will help establish whether the PDF chunks are missing from retrieval or whether the assistant is losing them later in the RAG pipeline. Which vector database and retrieval framework are you using?