Documentation
¶
Overview ¶
Recipe 11: Retrieval-Augmented Generation (RAG)
Combine embedding-based retrieval with text generation. The pipeline:
- Embed a corpus of documents
- Embed the user's query
- Find the most relevant documents by cosine similarity
- Pass them as context to the model for grounded generation
This is the standard RAG pattern used in knowledge-base chatbots, documentation assistants, and question-answering systems.
Usage:
go run ./docs/cookbook/11-rag/ --model path/to/model.gguf go run ./docs/cookbook/11-rag/ --model path/to/model.gguf --query "How do I use channels?"
Click to show internal directories.
Click to hide internal directories.