# local-rag **Repository Path**: xdgame/local-rag ## Basic Information - **Project Name**: local-rag - **Description**: openclaw 本地 RAG 插件 - **Primary Language**: Unknown - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2026-03-19 - **Last Updated**: 2026-03-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Local RAG Plugin (Chroma) OpenClaw 自定义 RAG 插件,使用 Chroma 向量数据库。 ## 安装依赖 ```bash cd extensions/local-rag npm install ``` ## 启动 Chroma 服务器 ```bash # Docker 方式(推荐) docker run -p 8000:8000 chromadb/chroma # 或使用 pip 安装 pip install chromadb chroma run --host 0.0.0.0 --port 8000 ``` ## 在 openclaw 配置中启用 ```yaml # openclaw.config.yaml plugins: enabled: true allow: - local-rag slots: memory: local-rag tools: allow: - rag_index - rag_status ``` ## 环境变量 ```bash export CHROMA_URL=http://localhost:8000 ``` ## 工具说明 | 工具 | 类型 | 说明 | |------|------|------| | `rag_search` | 必选 | 语义搜索知识库,LLM 自动调用 | | `rag_index` | 可选 | 索引文件或文本到知识库 | | `rag_status` | 可选 | 查看/管理已索引文档 | ## 嵌入模型 默认使用 `Xenova/all-MiniLM-L6-v2`(384维,~23MB),首次运行自动下载。 **镜像配置**:插件已内置 HuggingFace 镜像站(hf-mirror.com),国内用户无需额外配置即可快速下载模型。 模型缓存位置:`~/.cache/huggingface/` ## 数据存储 数据存储在 Chroma 服务器中,collection 名称:`openclaw_rag`