# 01-rag
**Repository Path**: itluma2008/01-rag
## Basic Information
- **Project Name**: 01-rag
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2026-11-13
- **Last Updated**: 2026-11-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
RAG技术点总结:构建了一个完整RAG系统,文档处理(MinerU转出Markdown,用VLM模型进行图片理解并完成图片存储)-》混合向量-》混合检索-》模型生成
- 生成索引阶段:PDF ->MinerU->Markdown+图片 -》VLM图片理解-》Minio图片存储-》分块-》BGE-M3->Milvus
02-mineru_subprocess.py: subprocess启动一个子进程 调用 mineru CLI
| output/sample/auto/sample.md + images/*.jpg (表格图片=html
、图片=![]())
05-md_image_handler.py:抽取图片+上下文[章节标题 +上文 + 下文]
| 03-image_description.py :调用VLM(qwen3-vl-plus)生成图片简介
| 04-image_upload.py: 上传图片到MinIO, 将markdown中的图片替换  ->
06-text_splitters.ipynb:语义切块(宏观切块:按照标题、章节 + 微观切块:递归字符)+ 表格隔离 + 小块合并
08-chunks_to_vector.py:smart_split() 四层切分 + BGE-M3编码
| sample_new_vector.json[{content, title, parent_title, file_title, dense[1024], sparse{token_id:weight}}]
09-vector_to_milvus:将向量写入milvus数据库
| Milvus Collection: knowledge_base
- 检索索引阶段:提问 -》问题重写 -》混合检索 -》 Prompt拼接 -》LLM流式 -》SSE-》前端渲染
10-search_embedding.py: 双路ANN(top10) + WeightedRanker融合 -》top5
11-rewritten_query.py: 历史感知的问题重写(JSON输出)
12-response.py: Prompt拼接(上下文的限制)+ LLM流式
- 封装的工具
sse_utils.py: 队列 -》SSE -> 推送前端
bge_m3_utils.py: BGE-M3单例 + 混合向量
history_utils.py: 基于内存历史会话管理
llm_utils.py: LLM客户端模型(缓存+JSON格式化输出)
milvus_utils.py: Milvus客户端/请求、检索的封装
minio_utils.py:minio单例对象