What is RAG?
RAG (Retrieval-Augmented Generation) enhances AI responses by:- Analyzing your selected text and linked documents
- Retrieving relevant content from connected notes and PDFs
- Augmenting the AI prompt with this contextual information
- Generating more informed and accurate responses
RAG automatically processes links (
[[like this]]), backlinks, and even PDF file references in your notes.How It Works
Automatic Context Detection
When you run an action, Local GPT automatically:1
Scans for Links
Detects wiki-style links
[[note]] and markdown links [text](note.md) in your selected text2
Follows Backlinks
Finds notes that link back to the current document
3
Processes PDFs
Extracts text from linked PDF files
4
Retrieves Relevant Chunks
Uses embedding models to find the most relevant content
5
Enhances Prompt
Includes this context in the AI request
Setup
1. Install an Embedding Model
You need an embedding model to enable RAG. For Ollama users:- English Only
- Multilingual
2. Configure Embedding Provider
- Open Local GPT settings
- Find Embedding Provider
- Select your embedding model provider
- Choose a model with a large context window for best results
Supported File Types
Markdown Files
.md files are processed for text content and linksPDF Files
.pdf files are processed to extract text contentContext Limits
You can configure how much context to include based on your model’s capabilities:Link Processing
Wiki-Style Links
Markdown Links
PDF References
Backlinks
Local GPT also processes backlinks — notes that reference the current document:Performance
Local GPT includes several optimizations:PDF Caching
PDF Caching
PDF content is cached to avoid re-processing. The cache is invalidated when the PDF file is modified.
Depth Limiting
Depth Limiting
Link traversal is limited to a maximum depth of 10 levels to prevent infinite loops and excessive processing.
Progress Tracking
Progress Tracking
A status bar shows processing progress when RAG is active, so you know the system is working.
Status Bar Indicator
When RAG is processing context, you’ll see a status bar indicator:Example
Given this note:- Read the content of “Project Goals”
- Extract text from “research.pdf”
- Find relevant sections using embeddings
- Include this context when generating the summary
Next Steps
Vision Support
Learn how to analyze images with vision models
Community Actions
Explore and install community-contributed actions