Series: Deeptutor (6/7)

DeepTutor Knowledge Base + RAG: Teaching AI Your Private Data
Most people's use of AI has one significant limitation: it only knows what's in its training data.
Your company's internal documents, your course notes, the academic papers you've collected—ChatGPT doesn't know any of that. Every time you need to work with this material, you either find it yourself, paste large blocks of text for the AI to read, or hope it can guess the right content.
DeepTutor's Knowledge Base solves this problem: teaching AI your own data, then calling on it directly during conversations, research, and quizzes.
How the Knowledge Base Works
DeepTutor's knowledge base backend uses LightRAG—a RAG (Retrieval-Augmented Generation) framework built on knowledge graphs.
What makes it different from traditional RAG?
Traditional RAG is pure vector search: slice documents into segments, convert to vectors, find the most similar segments at query time. The problem is it handles surface textual similarity, not relationships between concepts.
LightRAG adds a knowledge graph layer on top of vector search—it constructs a semantic network from entities (names, concepts, terminology) and the relationships between them found in your documents. At query time, it doesn't just find similar passages; it follows conceptual links to reason across them.
The practical effect: when you ask "What's the difference between LightRAG and traditional RAG," it doesn't just return segments containing those two terms—it brings along the context of all related concepts in your knowledge base.
Building Your First Knowledge Base
Step 1: Access knowledge base management
Click "Knowledge Base" in DeepTutor's left navigation panel, then create a new knowledge base.
Organize by topic—don't throw everything into one base:
Knowledge Base A: Machine Learning Fundamentals (textbooks, course notes)
Knowledge Base B: System Design (book summaries, LeetCode solution notes)
Knowledge Base C: Work Documents (internal specs, technical RFCs)
Separate bases mean more precise queries, more focused retrieval, and no cross-topic interference.
Step 2: Upload documents
Currently supported formats:
- PDF (most common; scanned versions work, but text-based PDFs perform better)
- Markdown (.md files—best results for knowledge graph construction)
- Plain text (.txt)
Just drag and drop or click to upload. DeepTutor handles indexing in the background—you don't need to wait. Indexing typically completes within a few minutes to tens of minutes depending on file size and quantity.
Step 3: Confirm indexing status
On the knowledge base management page, each document shows its indexing status:
- Processing: Building the index
- Ready: Index complete, available for use
- Error: Indexing failed (usually a PDF format issue—try converting and re-uploading)
Using the Knowledge Base in Conversations
Once indexing is complete, you can specify which knowledge base to use in any mode:
"(Using knowledge base: Machine Learning Fundamentals)
Based on my notes, explain the difference between Gradient Descent and Adam Optimizer—
specifically focus on the learning rate adjustment strategies I mentioned."
Without specifying a knowledge base, DeepTutor draws on its baseline training knowledge. When you specify one, it prioritizes your private data and supplements with its own knowledge as needed.
Five Strategies for Better Retrieval Quality
This is why many people find "sometimes it doesn't match what's in my documents" after setting up a knowledge base. RAG retrieval quality depends heavily on how you prepare your data.
1. Clear Document Structure
LightRAG's knowledge graph construction relies heavily on structural signals in documents. Markdown files with clear heading hierarchies (H1, H2, H3) perform significantly better than unstructured plain text.
If your material is in PDF, consider converting it to Markdown before uploading.
2. One Document, One Topic
Cramming "everything about Python" into a single 1,000-page PDF is far less effective than splitting it into separate documents: "Python Basic Syntax," "Python Data Structures," "Python Async Programming."
The more focused the topic, the less interference during retrieval.
3. Add Descriptive Titles and Summaries
Add a brief description at the top of each document to tell DeepTutor what it contains:
# Python Pandas Advanced Operations Notes
This document covers advanced usage of Pandas groupby, pivot_table, merge,
and time series processing, intended for readers with Pandas fundamentals.
Covers: Pandas 2.xThis metadata influences how knowledge graph nodes are labeled, making relevant queries more accurately targeted to this document.
4. Keep Your Knowledge Base Updated
Your notes evolve, your understanding deepens—your knowledge base should too.
Recommended habit: do a weekly review of your learning notes and add valuable new content to the appropriate knowledge base. You don't need to rebuild from scratch each time—DeepTutor supports incremental uploads, and new documents are automatically integrated into the existing knowledge graph.
5. Test Retrieval Quality
After uploading, try asking a few questions where you know where the answers are in your documents—confirm DeepTutor can find the right passages. If retrieval quality isn't satisfactory, start by checking document format, then consider splitting the document further.
Knowledge Base + Quiz: The Most Powerful Combination
One of the most powerful uses of a knowledge base is pairing it with Quiz mode for active recall testing:
"(Using knowledge base: System Design Notes)
Based on the CAP theorem chapter in my notes,
give me three scenario-based questions—present a system design scenario
and ask whether I should choose a CP or AP system, with justification."
DeepTutor generates questions based on your actual notes, not generic CAP theorem questions from the internet. This distinction matters—you're testing whether you remember what you organized, not whether you know the standard textbook answer.
Privacy Considerations
If you're uploading sensitive documents (company internal materials, personal data), make sure you're running a self-hosted DeepTutor instance, not any third-party hosted service.
In the self-hosted version, all knowledge base data is stored on your local machine or your server. LightRAG's semantic indexing is also processed locally—API calls only go to LLM providers (OpenAI, Anthropic) during conversational inference, and your raw knowledge base data is never sent.
If you want to avoid even API calls, use Ollama with a local model as your backend for a completely air-gapped private knowledge base Q&A setup.
Further reading: DeepTutor in the Real World: How Students, Engineers, and Researchers Actually Use It