Skip to content

Latest commit

 

History

History
137 lines (103 loc) · 3.36 KB

File metadata and controls

137 lines (103 loc) · 3.36 KB

Getting Started with Vector Knowledge Base

Welcome! You've just forked a powerful RAG (Retrieval-Augmented Generation) system. Here's how to get started in under 5 minutes.

🚀 Quick Setup

1. Set Your Secrets

Go to Tools → Secrets and add:

OPENAI_API_KEY = sk-your-openai-key-here
VKB_API_KEY = your-custom-api-key-123  
SESSION_SECRET = random-string-for-sessions
BASIC_AUTH_USERNAME = admin
BASIC_AUTH_PASSWORD = your-secure-password

2. Run the Application

Click the Run button and wait for:

Flask application configured successfully

3. Access Your App

  • Web Interface: Click the browser icon or visit your Repl URL
  • Login: Use the username/password you set in secrets

🎯 First Steps

Upload Your First Document

  1. Visit the web interface
  2. Click "Choose File" and select a PDF
  3. Click "Upload Document"
  4. Wait for "Upload successful!"

Try Semantic Search

  1. Enter a question about your document
  2. Click "Search"
  3. See relevant excerpts with similarity scores

Test the API

# Set your API key
export VKB_API_KEY=your-custom-api-key-123

# Upload a PDF
python utils/upload_tool.py your_document.pdf

# Or use the example script
python example_usage.py

🛠️ Customization Ideas

For Personal Knowledge Base

  • Upload research papers, documentation, books
  • Query using natural language
  • Great for study notes and reference

For Business Applications

  • Company documentation search
  • Customer support knowledge base
  • Internal wiki with semantic search

For Developers

  • Code documentation search
  • API reference system
  • Technical specification lookup

For Integration with Custom GPTs

  • Use /api/upload to add documents
  • Use /api/query in GPT Actions
  • Build conversational interfaces over your documents

🔧 Common Configurations

Change Upload Limits

Edit config.py:

MAX_FILE_SIZE = 50 * 1024 * 1024  # 50MB

Adjust Search Sensitivity

Edit api/routes.py:

results, error_msg = vector_store.search(
    query=query,
    k=5,  # Return more results
    similarity_threshold=0.05  # Lower = more lenient
)

Add File Type Support

Currently supports PDF. To add more formats, modify services/pdf_processor.py.

📊 Monitoring Your System

  • Health Check: Visit /monitoring/health
  • Database Stats: Visit /monitoring/database-diagnostic
  • OpenAI Test: Visit /monitoring/test-openai

🆘 Troubleshooting

"Missing OpenAI API Key"

  • Check that OPENAI_API_KEY is set in Replit Secrets
  • Verify your OpenAI API key is valid and has credits

"Authentication Failed"

  • Ensure BASIC_AUTH_USERNAME and BASIC_AUTH_PASSWORD are set
  • Try logging out and back in

"Upload Fails"

  • Check file size is under the limit
  • Ensure the file is a valid PDF
  • Check console logs for detailed errors

"No Search Results"

  • Upload documents first
  • Try broader search terms
  • Check similarity threshold settings

🎓 Learning More

  • Full Documentation: See the docs/ folder
  • API Reference: docs/api_specification.md
  • Privacy Guide: docs/privacy_and_pii_protection.md
  • Backup System: docs/BackupSystem.md

💡 Need Help?

  1. Check the console logs
  2. Visit /monitoring/health for diagnostics
  3. Review the documentation in docs/
  4. Look at example_usage.py for API examples

Happy building! 🚀