Reference

dataSources.chunks

Returns every chunk of one document exactly as it was indexed, optionally with the vectors.
DataSource.chunks(documentId, { vectors? }) → DataSourceChunk[]

Returns every chunk of one document exactly as it was indexed. It is the direct answer to why a document is not coming back: search only shows the chunks that surface, which is no help when none do, and reading how the document was actually split usually is. Pass { vectors: true } to include each chunk's embedding, which is large, so leave it off unless you need it.

Parameters
documentId
string
RequiredThe document to inspect, from documents().
vectors
boolean
Include each chunk's embedding. Large: roughly 8KB per chunk.
Why isn't this document matching?
const chunks = await Policies.chunks(documentId);
chunks.forEach((c) => console.log(c.index, c.headingPath, c.text.slice(0, 80)));