RAG Knowledge Base Tutorial
Build a powerful knowledge base using Retrieval-Augmented Generation (RAG) to enhance your AI interactions with contextual information.Overview
The RAG (Retrieval-Augmented Generation) system in Plugged.in allows you to create project-specific knowledge bases that can be queried by AI models through MCP servers. This enables AI assistants to access your documentation, notes, and other text content to provide more accurate and contextual responses.Key Features
Document Management
Upload and organize documents in multiple formats (PDF, DOCX, TXT, Markdown)
Semantic Search
Advanced vector-based search for finding relevant information quickly
Project Isolation
Complete data isolation between projects for security and privacy
AI Integration
Seamless integration with MCP servers for AI-powered queries
Prerequisites
Before setting up your RAG knowledge base, ensure you have:1
Plugged.in Account
An active account with at least one project created
2
API Key
A valid API key for authentication (available in Settings → API Keys)
3
Documents
Text-based documents you want to include in your knowledge base
Step 1: Enable RAG Features
First, ensure RAG features are enabled for your project:- Navigate to Settings → Project Settings
- Enable the “RAG Features” toggle
- Save your settings
RAG features may require additional permissions or a specific subscription tier. Contact support if you don’t see this option.
Step 2: Upload Documents
Using the Web Interface
- Go to Library in the sidebar
- Click Upload Documents
- Select your files (supported formats: PDF, DOCX, TXT, MD)
- Add optional metadata:
- Title
- Description
- Tags
- Category
Using the API
Supported File Types
Format | Extensions | Max Size |
---|---|---|
10 MB | ||
Microsoft Word | .docx, .doc | 10 MB |
Text | .txt | 5 MB |
Markdown | .md, .mdx | 5 MB |
HTML | .html, .htm | 5 MB |
Step 3: Configure MCP Server
Add the Plugged.in RAG MCP server to your configuration:Step 4: Query Your Knowledge Base
Once configured, the RAG system provides several tools for querying:Available Tools
pluggedin_rag_query
Search and retrieve relevant information from your knowledge base.
Parameters:
query
(required): Your search querymax_results
(optional): Maximum number of results (default: 5)threshold
(optional): Relevance threshold 0-1 (default: 0.7)
Step 5: Managing Your Knowledge Base
Update Documents
Documents can be updated through the web interface or API:Delete Documents
Remove documents when they’re no longer needed:Search Documents
Search your knowledge base programmatically:Best Practices
Document Organization
Document Organization
- Use clear, descriptive titles
- Apply consistent tagging taxonomy
- Group related documents by category
- Keep documents focused on single topics
Content Quality
Content Quality
- Use plain text when possible for better indexing
- Break large documents into smaller, focused pieces
- Include relevant keywords naturally
- Update outdated information regularly
Query Optimization
Query Optimization
- Use specific, descriptive queries
- Include context in your questions
- Experiment with different phrasings
- Adjust relevance thresholds as needed
Security
Security
- Never upload sensitive credentials
- Use project isolation for different clients
- Regularly audit document access logs
- Remove obsolete documents promptly
Advanced Features
AI-Generated Documents
Plugged.in supports AI-generated documents with full attribution tracking:Vector Search Configuration
Customize vector search behavior:Bulk Operations
Import multiple documents at once:Troubleshooting
Common issues and their solutions:
Documents Not Appearing in Search
- Check indexing status: Documents may take 1-2 minutes to index
- Verify file format: Ensure documents are in supported formats
- Check file size: Files over 10MB are rejected
- Review content: Very short documents may not index well
Low Relevance Scores
- Improve document quality with more descriptive content
- Use specific keywords that match likely queries
- Break complex topics into focused documents
- Consider adjusting the similarity threshold
API Rate Limits
RAG operations have the following limits:- Document uploads: 100 per hour
- Search queries: 1000 per hour
- AI document creation: 10 per hour
Example Use Cases
Customer Support Knowledge Base
Build a comprehensive support knowledge base:- Upload product documentation
- Add FAQ documents
- Include troubleshooting guides
- Configure MCP server for support agents
- Query for instant answers during customer interactions
Development Documentation
Create a technical knowledge base for your team:- Upload API documentation
- Add architecture diagrams (as text descriptions)
- Include coding standards and best practices
- Enable for development MCP servers
- Query during code reviews and planning
Research Repository
Organize research materials:- Upload research papers and notes
- Tag by topic and date
- Add summaries and key findings
- Configure for research assistants
- Query for literature reviews and citations
Next Steps
API Integration
Learn how to integrate RAG with your applications
Team Collaboration
Share knowledge bases with your team