Skip to main content
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.
SettingDefaultDescription
Chunk size8,000 charactersMaximum characters per chunk
Chunk overlap200 charactersCharacters 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:
  1. All chunks are stored in MIRA’s local database after upload.
  2. Chunks are injected sequentially from the start of the document.
  3. Injection continues until the engine’s context budget is reached.
  4. 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

ScenarioRecommendation
Short technical documents (< 20 pages)Default chunk size works fine — document usually fits in context
Reports spanning hundreds of pagesSplit into sections and upload only the relevant section
CSV data filesWorks well with default settings; headers are preserved in the raw text
Code filesWorks 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.