Skip to main content
Browse docs

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

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:

  1. Copy the document text from your source.
  2. Paste it directly into the chat input field.
  3. Add your question after the pasted content.

Upload a Document File

For larger documents:

  1. Click the Attach icon (paperclip) in the chat input toolbar.
  2. Select a file from your local system. Supported formats include .txt, .md, .pdf, and .csv.
  3. The file content is extracted and included as context for your next message.
File uploads are processed client-side for text extraction. PDF extraction handles text-based PDFs; scanned images within PDFs require OCR and are not currently supported.

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:

  1. The document text is included in the model context window.
  2. Governance policies can enforce grounding rules — requiring the model to cite sources.
  3. Responses that reference the document include citation markers.

Grounding vs. General Knowledge

Response TypeBehavior
GroundedAnswer derived directly from the provided document with citations
AugmentedAnswer combines document content with model's general knowledge
UngroundedAnswer 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:

  1. Locate the citation marker in the response (e.g., [Section 4.1]).
  2. Cross-reference against the original document section.
  3. If the citation is inaccurate, ask for clarification: "Can you verify the source for point 2?"
For long documents, break your analysis into sections. Upload or paste one section at a time and ask focused questions. This improves citation accuracy and reduces the chance of hallucinated references.

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.

  1. Click the Knowledge icon in the chat toolbar.
  2. Browse available knowledge base assets for your team or organization.
  3. 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:

  1. Upload or paste the first document and label it:
    Document A (Q1 Financial Report):
    [paste content]
  2. Upload or paste the second document with a distinct label:
    Document B (Q2 Financial Report):
    [paste content]
  3. Ask comparative questions:
    Compare the revenue projections between Document A and Document B.
    What changed between Q1 and Q2?
Multiple large documents can consume a significant portion of the model's context window. Monitor the token count indicator in the chat toolbar to avoid hitting limits. If the combined content is too large, summarize each document first, then compare summaries.

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:

  1. Click the Export button in the conversation toolbar.
  2. Select your preferred format (Markdown or JSON).
  3. The export includes your document input, all questions, model responses, and citation markers.

Troubleshooting

IssueCauseFix
File upload failsUnsupported format or file too largeUse .txt or .md format; split large files into smaller sections
Model ignores document contentDocument placed too far back in conversationRe-paste or re-upload the document in a fresh conversation
Citations reference wrong sectionsLong document with ambiguous section numberingAdd explicit section headers before pasting content
Response says "I don't have access to the document"Content was not included in the contextPaste 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 .txt file → 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