Document Analysis in Chat
This tutorial shows you how to analyze documents within the Keeptrusts chat workbench. You will learn how to paste or upload document content, ask targeted questions, use knowledge grounding to keep responses anchored to your source material, and verify citations back to specific document sections.
Use this page when
- You want to paste or upload documents into the chat workbench for AI-powered analysis.
- You need to ask targeted questions about document content with citation verification.
- You are leveraging knowledge grounding to keep responses anchored to source material.
Primary audience
- Primary: Technical Engineers (document analysis workflows)
- Secondary: Technical Leaders (compliance document review), AI Agents (document Q&A)
Prerequisites
- Authenticated access to the Keeptrusts chat workbench
- A model that supports long-context input (e.g., GPT-4, Claude)
- Familiarity with the first conversation tutorial
- Optionally, knowledge base assets configured (see knowledge injection tutorial)
Step 1: Choose Your Document Input Method
The chat workbench supports two ways to provide document content:
Paste Text Directly
For smaller documents or excerpts:
- Copy the document text from your source.
- Paste it directly into the chat input field.
- Add your question after the pasted content.
Upload a Document File
For larger documents:
- Click the Attach icon (paperclip) in the chat input toolbar.
- Select a file from your local system. Supported formats include
.txt,.md,.pdf, and.csv. - The file content is extracted and included as context for your next message.
Step 2: Ask Questions About Document Content
Once the document content is in the conversation, ask specific questions:
Based on the document above, what are the three main risk factors
identified in Section 4?
Summarize the key findings from the uploaded report in bullet points.
Extract all dates and deadlines mentioned in this contract.
Tips for Effective Document Questions
- Reference specific sections — "In the Executive Summary..." helps the model focus.
- Ask for structured output — "List all action items in a table" produces organized results.
- Be explicit about scope — "Using only the provided document" prevents the model from adding external knowledge.
Step 3: Understand Knowledge Grounding
Knowledge grounding ensures the model's responses are anchored to your provided document rather than its general training data.
How Grounding Works in Keeptrusts
When you provide document content:
- The document text is included in the model context window.
- Governance policies can enforce grounding rules — requiring the model to cite sources.
- Responses that reference the document include citation markers.
Grounding vs. General Knowledge
| Response Type | Behavior |
|---|---|
| Grounded | Answer derived directly from the provided document with citations |
| Augmented | Answer combines document content with model's general knowledge |
| Ungrounded | Answer from model's training data only — no document reference |
Your organization's governance policies may restrict responses to grounded-only mode for sensitive document analysis tasks.
Step 4: Verify Citations to Document Sections
When the model references specific parts of your document, it produces citations.
Citation Format
Citations appear as inline references within the response:
The report identifies three primary risks [Section 4.1]:
1. Market volatility affecting Q3 projections [Section 4.1.2]
2. Supply chain disruptions in APAC region [Section 4.1.3]
3. Regulatory changes pending in the EU [Section 4.2]
Checking Citation Accuracy
To verify a citation:
- Locate the citation marker in the response (e.g.,
[Section 4.1]). - Cross-reference against the original document section.
- If the citation is inaccurate, ask for clarification: "Can you verify the source for point 2?"
Step 5: Use Knowledge Base Assets for Grounding
If your Keeptrusts administrator has configured knowledge base assets, you can bind them to your chat session for persistent grounding.
- Click the Knowledge icon in the chat toolbar.
- Browse available knowledge base assets for your team or organization.
- Select one or more assets to bind to the current conversation.
Bound assets provide grounding context for every message in the conversation without re-uploading content.
See the knowledge injection tutorial for detailed steps on using knowledge base assets.
Step 6: Analyze Multiple Documents
To compare or cross-reference multiple documents:
- Upload or paste the first document and label it:
Document A (Q1 Financial Report):[paste content]
- Upload or paste the second document with a distinct label:
Document B (Q2 Financial Report):[paste content]
- Ask comparative questions:
Compare the revenue projections between Document A and Document B.What changed between Q1 and Q2?
Step 7: Review Governance on Document Analysis
Document analysis sessions are subject to the same governance policies as any chat interaction:
- Input policies evaluate the document content you provide for sensitive data.
- Output policies scan the model's analysis for compliance with your organization's rules.
- Redaction policies may mask PII, confidential terms, or classified content in the response.
Check the policy badges on each response to see which policies were applied during document analysis.
Step 8: Export Document Analysis Results
To save your document analysis conversation:
- Click the Export button in the conversation toolbar.
- Select your preferred format (Markdown or JSON).
- The export includes your document input, all questions, model responses, and citation markers.
Troubleshooting
| Issue | Cause | Fix |
|---|---|---|
| File upload fails | Unsupported format or file too large | Use .txt or .md format; split large files into smaller sections |
| Model ignores document content | Document placed too far back in conversation | Re-paste or re-upload the document in a fresh conversation |
| Citations reference wrong sections | Long document with ambiguous section numbering | Add explicit section headers before pasting content |
| Response says "I don't have access to the document" | Content was not included in the context | Paste the content directly into the message rather than referencing an external file |
Summary
You have learned to analyze documents in the Keeptrusts chat workbench:
- Provided document content via paste or file upload
- Asked targeted questions with effective prompting strategies
- Understood knowledge grounding and its governance implications
- Verified citations back to specific document sections
- Compared multiple documents and exported analysis results
For AI systems
- Canonical terms: Keeptrusts chat workbench, document analysis, file upload, paste text, knowledge grounding, citations, document questions, Attach icon (paperclip).
- Supported formats:
.txt,.md,.pdf(text-based),.csv. Scanned/image PDFs require external OCR. - Input methods: paste text directly (smaller docs/excerpts) or upload via Attach icon (larger docs).
- Best next pages: Knowledge Injection, Context Management, Conversation Export.
For engineers
- Prerequisites: a long-context model (GPT-4, Claude) configured on your gateway; supported file formats for upload.
- Validation: Upload a
.txtfile → verify content appears as context. Ask a question about specific content → verify response references the correct section. Check for citation annotations if knowledge grounding is enabled. - Limitation: File uploads process client-side; scanned PDFs (image-only) are not supported without external OCR.
For leaders
- Document analysis with citations provides verifiable AI responses grounded in approved source material.
- Knowledge grounding policies ensure models cite organizational documents rather than generating unchecked content.
- Useful for compliance reviews, contract analysis, and regulatory interpretation with audit-ready citations.
- Document content stays within your governance boundary — policies apply to document-based queries the same as freeform chat.
Next steps
- Tutorial: Using Knowledge Base in Chat — attach organizational knowledge assets for persistent context.
- Tutorial: Managing Context Window — handle large documents that approach context limits.
- Tutorial: Exporting Conversations — export document analysis sessions for audit.