内容
# Darwin RAG
本地优先的RAG引擎。摄入文档,使用BM25和嵌入进行索引,通过混合/语义/关键词检索进行搜索。作为MCP服务器运行,用于AI代理集成或通过CLI运行。所有本地运行,具备离线能力。
由 [BrightDotDev](https://github.com/brightdotdev) 构建。
[](LICENSE)
---
## 设置
首次设置需要互联网连接,以便下载和验证模型。之后,所有操作均可在离线状态下进行。
### 交互式(引导式)
检测您的硬件,显示可用模型,让您选择。大约需要2分钟。
```bash
pip install darwin-rag
darwin-admin setup interactive
```
### 一键安装:必需(仅嵌入)
仅下载和配置嵌入模型。无需提示或选择。快速安装到可用状态。
```bash
darwin-admin setup --preset required
```
### 一键安装:推荐(嵌入 + 重新排序 + OCR)
还下载重新排序和OCR模型。出色的搜索质量。
```bash
darwin-admin setup --preset recommended
```
设置完成后,启动MCP服务器:
```bash
darwin mcp --http --port 8765
```
有关完整的设置指南,包括Docker、从源代码构建和API密钥配置,请参阅 [docs/setup.md](https://github.com/BrightDotDev/DARWIN/blob/main/docs/setup.md)。
---
## 连接您的代理
```bash
# 为Claude Desktop、Cursor等生成配置
darwin config claude
# 为所有客户端生成配置
darwin config all --copy
```
或直接指向任何MCP客户端:
- **SSE:** `http://localhost:8765/sse`
- **HTTP:** `http://localhost:8765/mcp`
---
## 命令
**`darwin`** — 用户CLI(mcp,config)
**`darwin-admin`** — 高级用户CLI(setup,models,store,pipeline,search,logs,system,uninstall,status)
有关完整的命令参考,请参阅 [docs/admin.md](https://github.com/BrightDotDev/DARWIN/blob/main/docs/admin.md)。
---
## 文档
| 文档 | 内容 |
|---|---|
| [setup.md](https://github.com/BrightDotDev/DARWIN/blob/main/docs/setup.md) | 完整的设置指南 |
| [architecture.md](https://github.com/BrightDotDev/DARWIN/blob/main/docs/architecture.md) | 开发者和贡献者 |
| [mcp.md](https://github.com/BrightDotDev/DARWIN/blob/main/docs/mcp.md) | MCP服务器、工具、资源 |
| [admin.md](https://github.com/BrightDotDev/DARWIN/blob/main/docs/admin.md) | 管理员CLI参考 |
| [storage.md](https://github.com/BrightDotDev/DARWIN/blob/main/docs/storage.md) | DarwinStore |
| [pipeline.md](https://github.com/BrightDotDev/DARWIN/blob/main/docs/pipeline.md) | 摄入和索引 |
| [retrieval.md](https://github.com/BrightDotDev/DARWIN/blob/main/docs/retrieval.md) | 搜索引擎 |
| [models.md](https://github.com/BrightDotDev/DARWIN/blob/main/docs/models.md) | 模型注册和推理 |
| [logger.md](https://github.com/BrightDotDev/DARWIN/blob/main/docs/logger.md) | 结构化日志记录 |
| [orchestrators.md](https://github.com/BrightDotDev/DARWIN/blob/main/docs/orchestrators.md) | 高级业务逻辑 |
---
## 贡献
发现了错误?想要添加新功能?欢迎您加入。
- **问题** — 在 [github.com/BrightDotDev/DARWIN/issues](https://github.com/BrightDotDev/DARWIN/issues) 上提交
- **代码** — 分叉,分支,拉取请求。保持简单。
- **AI生成的代码可以接受** — 但您需要对提交的代码负责。提交前请测试。
阅读 [CONTRIBUTING.md](https://github.com/BrightDotDev/DARWIN/blob/main/CONTRIBUTING.md) 以获取完整的指南。
---
## 许可证
MIT with Attribution — 参见 [LICENSE](LICENSE)。
核心架构和实现由 [BrightDotDev](https://github.com/brightdotdev) 提供。