RAG 示例
定义
本页收集了具体的 RAG 示例: simple Q&A, document QA, and hybrid search with code you can adapt.
Each example follows the same RAG flow (index documents, embed query, retrieve, generate) but with different frameworks or options. Use them as starting points and adjust chunking, embeddings, and vector store to your data.
应用场景
These examples show how to get from zero to a working RAG pipeline with common frameworks and options.
- Implementing a minimal Q&A pipeline (例如 LangChain, LlamaIndex)
- Document QA with custom chunking and embeddings
- Hybrid search (dense + keyword) for better recall
Example: minimal RAG with LangChain
See the RAG index for a Python snippet. More examples will be added for LlamaIndex, custom embeddings, and reranking.