# document.ChunkedMarkdownDocument


A Markdown document with an attached sequence of chunks.


Usage

``` python
document.ChunkedMarkdownDocument(
    content, origin=None, attributes=None, *, chunks
)
```


This is the chunked form of [MarkdownDocument](document.MarkdownDocument.md#raghilda.document.MarkdownDocument), combining its Markdown source tracking with the `chunks` of a [ChunkedDocument](document.ChunkedDocument.md#raghilda.document.ChunkedDocument). It is what `MarkdownChunker.chunk()` returns, and what you pass to a store's [upsert()](store.BaseStore.md#raghilda.store.BaseStore.upsert). Like [ChunkedDocument](document.ChunkedDocument.md#raghilda.document.ChunkedDocument), it can be iterated, sized with `len()`, and indexed to reach its chunks.


## Parameters


`content: str`  
The Markdown text of the document.

`origin: str | None = None`  
Where the content came from (a URL or file path), used for citation and provenance. Stores require a populated origin at upsert time.

`attributes: dict[str, Any] | None = None`  
Optional user-defined attributes applied at insertion time. Chunks can inherit them, and they are returned during retrieval for filtering and downstream prompt/context use.

`chunks: list[Chunk]`  
The chunks produced from this document's content, in document order.


## Methods

| Name | Description |
|----|----|
| [from_any()](#from_any) | Convert any chunked document-like object to a ChunkedMarkdownDocument. |

------------------------------------------------------------------------


### from_any()


Convert any chunked document-like object to a ChunkedMarkdownDocument.


Usage

``` python
from_any(doc, origin=None)
```


Use [MarkdownDocument.from_any()](document.MarkdownDocument.md#raghilda.document.MarkdownDocument.from_any) for unchunked inputs.
