╔════════════════════════════════════════════════════════════════════════════╗
║                     NEXVOR RAG TEMPLATES - README                          ║
║                         (MAX Tier Feature)                                 ║
╚════════════════════════════════════════════════════════════════════════════╝

Welcome to the Nexvor RAG (Retrieval Augmented Generation) system!

═══════════════════════════════════════════════════════════════════════════════

WHAT IS THIS?

The RAG system allows your AI chatbot to answer questions using your server's
custom documentation. Instead of making up answers, the AI will search your
knowledge bases and provide accurate, server-specific information!

These template files are EXAMPLES to help you get started. You should replace
them with your actual server information.

═══════════════════════════════════════════════════════════════════════════════

WHAT'S INCLUDED?

This folder contains 3 example documents:

  1. server_rules.md      - Example server rules and punishment guidelines
  2. faq.md               - Example frequently asked questions
  3. commands_guide.md    - Example commands reference

═══════════════════════════════════════════════════════════════════════════════

HOW TO USE THESE TEMPLATES

STEP 1: Customize the templates
  - Edit the .md files with YOUR server's actual information
  - Replace all "example.com" URLs with your real URLs
  - Update command prefixes if you use different ones
  - Add/remove sections as needed

STEP 2: Upload to knowledge base
  In-game, run:
    /nexvor kb upload rag_templates/server_rules.md "Server Rules"
    /nexvor kb upload rag_templates/faq.md "FAQ"
    /nexvor kb upload rag_templates/commands_guide.md "Commands"

STEP 3: Test the AI
  Ask questions like:
    /ai chat What are the server rules about griefing?
    /ai chat How do I claim land?
    /ai chat What commands can I use?

  The AI will now search your knowledge bases and provide accurate answers!

═══════════════════════════════════════════════════════════════════════════════

SUPPORTED FILE FORMATS

Currently supported:
  ✓ Markdown (.md) - Best for documentation
  ✓ Plain text (.txt) - Simple documents

Coming soon:
  • PDF (.pdf)
  • HTML (.html)
  • JSON (.json)

═══════════════════════════════════════════════════════════════════════════════

BEST PRACTICES FOR RAG DOCUMENTS

1. BE SPECIFIC
   ✓ Good: "Use /claim to create a land claim. Right-click opposite corners."
   ✗ Bad: "There's a claiming system."

2. USE CLEAR HEADINGS
   Use markdown headers (# ## ###) to organize content.
   The AI uses these to understand document structure.

3. KEEP INFORMATION UP TO DATE
   Re-upload documents when rules/commands change:
     /nexvor kb delete <kb_id>
     /nexvor kb upload <new_file> <name>

4. AVOID DUPLICATES
   Don't put the same information in multiple documents.
   This confuses the AI and wastes storage.

5. USE EXAMPLES
   When explaining commands, show examples:
     Command: /sethome <name>
     Example: /sethome base

6. ORGANIZE BY TOPIC
   Create separate documents for different topics:
     - rules.md (server rules)
     - commands.md (command reference)
     - faq.md (common questions)
     - economy.md (economy system)
     - events.md (server events)

═══════════════════════════════════════════════════════════════════════════════

TROUBLESHOOTING

Q: The AI isn't using my knowledge base!
A: Check that:
   - RAG is enabled in config.yml (rag.enabled: true)
   - Vector database is running (check console logs)
   - You've uploaded documents: /nexvor kb list
   - Documents contain relevant information for the question

Q: Upload fails with "unsupported file type"
A: Only .md and .txt files are currently supported.
   Convert your document to markdown or plain text.

Q: Upload fails with "file too large"
A: Max file size is 5MB by default. Check config.yml:
   rag.max_file_size_mb: 5

Q: How do I delete a knowledge base?
A: /nexvor kb list (find the ID)
   /nexvor kb delete <id>

Q: Can I upload multiple files at once?
A: Not yet, but you can run multiple upload commands:
   /nexvor kb upload file1.md "KB Name 1"
   /nexvor kb upload file2.md "KB Name 2"

═══════════════════════════════════════════════════════════════════════════════

ADVANCED USAGE

SEARCH CONFIGURATION (config.yml)

rag:
  search:
    max_results: 3           # How many chunks to retrieve
    min_similarity: 0.7      # Minimum relevance score (0.0-1.0)
    max_context_length: 2000 # Max characters injected into AI prompt

CHUNKING CONFIGURATION

rag:
  chunking:
    chunk_size: 800     # Characters per chunk
    overlap_size: 100   # Overlap between chunks (prevents splitting mid-sentence)

TESTING RAG SEARCH

You can test RAG search without talking to the AI:
  /nexvor kb search How do I claim land?

This shows what context would be retrieved for that query.

═══════════════════════════════════════════════════════════════════════════════

NEED MORE HELP?

Documentation: https://docs.nexvor.dev/rag
Support Discord: https://discord.gg/nexvor
Report Issues: https://github.com/nexvor/nexvor/issues

═══════════════════════════════════════════════════════════════════════════════

Thank you for using Nexvor RAG!

This feature helps your AI chatbot provide accurate, server-specific answers
to player questions. Happy documenting!

- The Nexvor Team
