Chat With Your Documents: TokForge RAG Guide

Learn how to use Document RAG (Retrieval-Augmented Generation) to have conversations with your PDFs, Word documents, and other files—all processed locally on your device.

What is Document RAG?

RAG stands for Retrieval-Augmented Generation. It's a technique that allows you to attach documents to your conversation and ask questions about them. The AI reads your document, understands its content, and provides answers grounded in what's actually written.

How RAG Works for You

Instead of relying on general knowledge, the AI retrieves relevant sections from your document and uses them to answer your questions. For example, you can ask "What does section 3 say about pricing?" and get an accurate answer based on your actual document content.

Key benefit: TokForge indexes your documents locally—nothing is uploaded to any server. Your documents stay private on your device.

Supported Document Formats

TokForge can handle a wide variety of document types, all processed directly on your device:

Format Extension Notes
Portable Document Format .pdf Text-based PDFs work best; scanned image PDFs not yet supported
Microsoft Word .docx Modern Word format with full formatting support
EPUB .epub E-book format, great for novels and articles
Plain Text .txt Simple text files, perfect for notes and transcripts

How It Works Under the Hood

Understanding the technology helps you get better results. Here's the simplified process:

1. Document Chunking

Your document is split into semantic chunks—logical sections that make sense together, not arbitrary page breaks.

2. Embedding

Each chunk is converted into a mathematical representation (an embedding) using BGE-small, a compact embedding model that runs entirely on your device. This allows TokForge to understand meaning without sending data to servers.

3. Hierarchical Summarization

TokForge uses RAPTOR tree summarization to create hierarchical summaries of your document. This helps the system understand both fine details and the big picture, improving context retrieval.

4. Semantic Search

When you ask a question, TokForge converts it to an embedding and finds the most relevant chunks using semantic search. It's not keyword matching—it understands meaning.

5. Contextual Response

The relevant chunks are included as context in your conversation. The AI reads them and generates an answer grounded in your actual document.

Step-by-Step Walkthrough

Getting started with Document RAG is simple:

1
Open a Conversation

Create a new conversation or open an existing one. You can attach documents to any conversation at any time.

2
Tap the Attachment Icon

Look for the document or paperclip icon in the message input area. Tap it to open your device's file browser.

3
Select Your Document

Browse your device and select a supported file (PDF, DOCX, EPUB, or TXT). You can attach multiple documents to the same conversation.

4
Wait for Indexing

TokForge will index your document. Small documents typically complete in a few seconds; larger documents may take up to a minute. A progress indicator shows you what's happening.

Document RAG Indexing

TokForge indexes your document locally — exact and broad search phases

5
Start Asking Questions

Once indexing is complete, you can ask questions about your document. The AI will cite the relevant sections it used to answer you.

Best Practices

Follow these tips to get the most out of Document RAG:

Document RAG Grounded Response

Grounded response citing 6 chunks from your document

Use Cases

Document RAG opens up many possibilities for productivity:

📚 Study Helper: Upload textbook chapters or lecture notes. Quiz yourself by asking the AI to explain concepts or answer practice questions.
📋 Contract Review: Ask specific questions about contract clauses, payment terms, or obligations. Get quick answers without reading the entire document.
🔬 Research: Attach multiple research papers to a single conversation. Cross-reference findings, compare methodologies, and explore related work.
💼 Work Projects: Quickly find information buried in long reports, whitepapers, or documentation. No more endless scrolling.
📖 Reading & Analysis: Ask questions about novels, articles, or essays. Explore themes, character motivations, or specific passages.

Limitations

While Document RAG is powerful, be aware of these current limitations:

Ready to Chat With Your Documents?

Download TokForge on Google Play and start using Document RAG today. All processing happens locally on your device—your documents stay private.