← Back to FAQ

What Is RAG (Retrieval-Augmented Generation)?

Verified answer

What does RAG mean?

RAG stands for Retrieval-Augmented Generation. It is an AI architecture that combines two steps:

  1. Retrieval: Before generating any text, the system searches your knowledge base for the passages most relevant to the user's question.
  2. Generation: The language model reads those retrieved passages and composes an answer based on them.

The key constraint is that the model is only given your content as context. It is not drawing on general internet knowledge when answering. This is what makes 0xDoktor's answers traceable to specific documents you own.

Why does RAG matter for accuracy?

Without retrieval, a language model answers from its training data — which may be outdated, incorrect for your domain, or simply not contain your specific information.

With RAG, every answer is composed from chunks of text that your team uploaded and approved. If the answer is not in those documents, 0xDoktor acknowledges it cannot answer rather than inventing a plausible-sounding response.

How does 0xDoktor implement RAG?

When a user submits a question:

  1. The question is converted to a vector embedding (a numeric representation of its meaning).
  2. 0xDoktor searches your Qdrant vector database for the chunks with the highest semantic similarity to the question embedding.
  3. The top-k chunks are assembled into a context block.
  4. The language model receives the context block + the user's question and generates a grounded answer.
  5. The confidence score reflects how semantically close the retrieved chunks were to the question.

What is a confidence score?

The confidence score (0.0–1.0) indicates how well the retrieved passages match the question. A score above 0.7 generally means the knowledge base contains a clear answer. A score below 0.4 suggests the topic is not well covered in your documentation — a signal to add more content.

Can I see which sources were used?

Yes. The API response includes a sources array listing the document slugs and chunk indices used to compose the answer. The admin dashboard surfaces this in the conversation log.

Is RAG the same as fine-tuning?

No. Fine-tuning trains a new model version on your data — expensive, slow, and static until the next training run.

RAG reads your documents at query time, so your knowledge base is always current. Adding a document to 0xDoktor makes it immediately available for answers without any retraining.

See 0xDoktor in action — ask anything about this page: