RAG & Sources

Add documents to your conversations for context-aware AI responses.

What is RAG?

Retrieval-Augmented Generation (RAG) allows the AI to reference your documents when answering questions. Instead of relying only on its training data, the model can find and cite relevant information from your files.

PDF files
Text files

Setting Up RAG

Configure a RAG Provider

RAG requires an embedding model to understand your documents. Configure this first:

  1. Go to Settings → Manage RAG Providers
  2. Add a new RAG provider
  3. Select an embedding model (local or remote)
  4. Save the configuration

Tip: For best privacy, use a local embedding model. It processes documents entirely on your device.

Adding Sources

Add Documents to a Conversation

  1. Open or create a conversation
  2. Tap the "+" button next to the message input
  3. Select "Add Sources"
  4. Choose files from your device
  5. Wait for processing to complete

Managing Sources

You can manage sources for each conversation:

  • View Sources: See all documents attached to the conversation
  • Remove Sources: Detach documents you no longer need
  • Reprocess: Re-index documents if the embedding model changes

How It Works

1

Document Processing

Your documents are split into chunks and converted into embeddings (numerical representations).

2

Query Matching

When you send a message, ModelFlux finds the most relevant document chunks based on semantic similarity.

3

Context Injection

Relevant chunks are included in the AI's context, allowing it to reference your documents in its response.

Best Practices

  • Use clear, well-formatted documents for best results
  • Ask specific questions that relate to your documents
  • Smaller, focused documents often work better than large files
  • Keep related documents in the same conversation for coherent context