When a document exceeds the engine’s context budget, MIRA cannot inject it all at once. Chunking splits the document into overlapping pieces so that each piece is small enough to fit within the context window.
How chunking works
MIRA uses a single fixed-size chunking strategy: the document text is split into windows of a fixed character count, with adjacent windows overlapping by a configurable number of characters.
| Setting | Default | Description |
|---|
| Chunk size | 8,000 characters | Maximum characters per chunk |
| Chunk overlap | 200 characters | Characters repeated between adjacent chunks to preserve context at boundaries |
The overlap prevents important context from being lost when it falls at a chunk boundary — the tail of one chunk repeats as the head of the next.
How chunks are injected into context
When a document is active in a session:
- All chunks are stored in MIRA’s local database after upload.
- Chunks are injected sequentially from the start of the document.
- Injection continues until the engine’s context budget is reached.
- For large documents where not all chunks fit, chunks at the end of the document may be omitted.
MIRA does not perform vector similarity search or semantic retrieval. All chunks are injected in
document order, subject to the context budget. For very large documents (hundreds of pages),
consider splitting them into topically focused files before uploading.
Tips for large documents
| Scenario | Recommendation |
|---|
| Short technical documents (< 20 pages) | Default chunk size works fine — document usually fits in context |
| Reports spanning hundreds of pages | Split into sections and upload only the relevant section |
| CSV data files | Works well with default settings; headers are preserved in the raw text |
| Code files | Works well with default settings at function-level granularity |
Context injection format
When a document is active, its content is injected into the prompt as:
=== Document: filename.pdf ===
[document content]
Multiple active documents are concatenated with this separator pattern, in the order they appear in the Document Panel.