Skip to main content

Interface: DocumentChunk

Defined in: packages/agentos/src/cognition/memory/io/facade/types.ts:856

A single chunk produced by splitting a document. Used internally and returned in LoadedDocument.chunks.

Properties​

content​

content: string

Defined in: packages/agentos/src/cognition/memory/io/facade/types.ts:860

Text content of this chunk after extraction and cleaning.


edges?​

optional edges: object

Defined in: packages/agentos/src/cognition/memory/io/facade/types.ts:897

Whether the chunk begins (first) and ends (last) where a sentence or a block begins and ends. False on a side where a sentence or a word longer than the chunk size was cut. Set by the 'anchored' strategy.

first​

first: boolean

last​

last: boolean


end?​

optional end: number

Defined in: packages/agentos/src/cognition/memory/io/facade/types.ts:891

Offset just past the chunk's last UTF-16 code unit in the text that was chunked. Set by the 'anchored' strategy.


heading?​

optional heading: string

Defined in: packages/agentos/src/cognition/memory/io/facade/types.ts:875

Heading or section title that precedes this chunk, if detected.


index​

index: number

Defined in: packages/agentos/src/cognition/memory/io/facade/types.ts:865

Zero-based chunk index within the parent document.


metadata?​

optional metadata: Record<string, unknown>

Defined in: packages/agentos/src/cognition/memory/io/facade/types.ts:880

Chunk-level metadata (e.g. bounding box, column number for layout mode).


pageNumber?​

optional pageNumber: number

Defined in: packages/agentos/src/cognition/memory/io/facade/types.ts:870

Page number this chunk originates from (1-based, PDF/DOCX).


start?​

optional start: number

Defined in: packages/agentos/src/cognition/memory/io/facade/types.ts:886

Offset of the chunk's first UTF-16 code unit in the text that was chunked. Set by the 'anchored' strategy, with text.slice(start, end) === content.