RAGFlow

RAGFlow

Build knowledge-base Q&A with TokenMix LLM and embedding models.

Prepare TokenMix values

RAGFlow usually needs two models:

Option 1: Configure in the UI

  1. Start RAGFlow and log in.
  2. Open Model providers.
  3. Choose OpenAI-API-Compatible.
  4. Set Base URL to https://api.tokenmix.ai/v1.
  5. Set API Key to your TokenMix key.
  6. Set Model to a TokenMix chat model ID.
  7. Add an embedding model with a TokenMix embedding model ID.

Option 2: Configure before startup

In service_conf.yaml.template, find user_default_llm:

user_default_llm:
  factory: "OpenAI-API-Compatible"
  api_key: "<your-tokenmix-key>"
  base_url: "https://api.tokenmix.ai/v1"

Restart RAGFlow after changing it.

Test a knowledge base

  1. Create a dataset.
  2. Select the TokenMix embedding model and a chunk template.
  3. Upload one small PDF or Markdown file.
  4. Wait for parsing to finish.
  5. Create a Chat Assistant and ask:
Summarize the uploaded document in five bullet points.

RAGFlow's quickstart notes that once a dataset has parsed files, its embedding model should not be changed casually because all chunks must stay in the same vector space.

Troubleshooting

Practical notes

RAGFlow needs more detail than a normal chat tool because it has chat models, embedding models, datasets, chunk templates, and parsing states. Beginners often think “chat works, so RAG works”, but RAG also requires a working embedding model.

Beginner flow

  1. Configure only the chat model first and send a normal question.
  2. Configure the embedding model next; do not put a chat model into the embedding field.
  3. Create one test dataset and upload one small file.
  4. Wait until parsing is complete before creating a Chat Assistant.
  5. Ask a question that can only be answered from the uploaded document.

Model choice

Changing embeddings

RAGFlow's quickstart warns that once files are parsed in a dataset, switching embedding models is not recommended. For beginners, create a new dataset and re-upload files when changing embeddings.