How to give a very long document to an AI assistant
Every AI model has a context window: the maximum amount of text it can consider at once, counting your messages, its replies and every attached document. Current models have large windows, but a long document can still fill a big share of it, use up your usage limit quickly, or simply get less careful attention than a short one.
Here's how to work with long documents effectively.
Step 1: Convert to text and check the size
Convert the document to Markdown first. Docuflat shows an approximate token count for each file and for all files together, so you know what you're dealing with before you paste anything.
As a rough guide, one token is about four characters of English. A page of dense English text is often in the region of 500–800 tokens. Text in Indian languages and many other non-Latin scripts usually takes several times more tokens for the same content.
Step 2: Decide whether you need the whole thing
Most questions are about part of a document. Before sending everything, ask yourself:
- Is my question about a specific section, clause, chapter or date range?
- Do I need the appendices, annexures and tables of contents?
- Are there repeated headers, disclaimers or boilerplate I can remove?
Deleting what you don't need is the single most effective step. It saves tokens and improves answers.
Step 3: Split by meaning, not by size
If you do need everything, split the document into sections that make sense on their own: chapters, parts of a judgment, sections of a report. Avoid cutting at an arbitrary character count, which can split a sentence or a table in half.
Because Docuflat marks each page with a ## Page N heading, it's easy to cut a converted PDF at page boundaries.
Step 4: Work in passes
Two approaches work well:
Summarise, then ask. Send each section with the instruction "Summarise this section in 10 bullet points, keeping all numbers, names and dates." Collect the summaries into one short document, then ask your real questions against the summaries. Go back to the full section only when you need detail.
Ask the same question of each section. For example, "List every obligation on the supplier in this section." Then combine the lists. This works well for contracts and compliance reviews.
Step 5: Keep a fresh chat per task
Long chats re-read everything on every turn. When a task is done, start a new chat and paste in only the summary or section you need next.
Use project or workspace features
Many assistants let you store reference documents in a project, so they're available without attaching them to every chat. Uploading a converted Markdown version, rather than the original PDF, keeps those projects smaller and faster.