MiniRAG

io.github.KiMelody由 GitHub 帳號 KiMelody 發布v0.1.0更新於 Oct 30, 2026

Lightweight self-hosted RAG knowledge base with hybrid retrieval and cited answers.

已驗證SSE可網頁執行資料庫知識與記憶

概覽

AI 產生的概覽

MiniRAG 是自架的 RAG 知識庫,其 MCP 伺服器讓助理依據自有文件回答問題並附上引用,也可新增文字。

可以做什麼
  • 針對知識庫提問並取得附編號引用的回答,可選向量、混合或重排檢索模式
  • 以文字形式將文件加入知識庫,需要管理員金鑰
  • 檢索採混合方式:記憶體內餘弦相似度加上 SQLite FTS5 的 BM25,以 RRF 融合,可選 LLM 重排
  • 除 MCP 外,同一行程還提供 REST API、串流網頁介面與企業微信回呼
適用情境
適合希望助理依據自己掌控的私有文件集作答、並能回溯引用來源,同時可隨時補充新資料的情境。較適合小規模自架部署,而非大規模檢索基礎設施。
執行需求
託管端點是遠端 SSE 網址,需在 Authorization 標頭使用 HTTP Basic 驗證,憑證須向擁有者索取。自架需要 Docker 或 Java 21,以及聊天模型 API 金鑰與嵌入 API 金鑰(相容 OpenAI 的端點,基礎網址與嵌入模型可設定)。
安裝前請注意
託管示範由擁有者提供的共用存取碼保護,應視為公開示範而非私有儲存。寫入文件需要管理員金鑰,會將資料寫入知識庫。提問內容與寫入的文字會傳送給所設定的外部聊天與嵌入服務商,除非自架並信任所選服務商,否則不要放入機密資料。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 MiniRAG,將其新增到工作區。
  2. 連接 Authorization token 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
  3. 為需要使用其工具的對話啟用該服務。

Web executable,透過 SSE。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.KiMelody%2Fminirag/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "minirag": {
      "type": "sse",
      "url": "https://minirag.kimelody.de5.net/sse",
      "headers": {
        "Authorization": "Bearer <YOUR_TOKEN>"
      }
    }
  }
}

README

MiniRAG

[Build] [License: MIT] [Java] [RSS]

A self-hosted RAG knowledge base in a single Spring Boot process: SQLite storage, hybrid retrieval, cited answers, and a built-in MCP server. No vector database, no message queue.

Live demo (ask the owner for the access code) · Evaluation report

Features

  • Hybrid retrieval — in-memory cosine + SQLite FTS5 (BM25), fused with RRF; optional LLM rerank
  • Cited answers — clickable [n] citations; only sources actually cited are displayed
  • Streaming web UI — SSE, typewriter rendering, markdown, retrieval-mode switcher (vector / hybrid / rerank)
  • Small footprint — single process, ~250MB RSS, runs on a 1GB VPS
  • Multiple interfaces — MCP server (SSE transport), REST API, web UI, WeChat Work callback integration

Quick start

bash
docker run -d --name minirag -p 18090:18090 --memory 512m \  -v $(pwd)/data:/app/data \  -e DEEPSEEK_API_KEY=sk-... \  -e EMBEDDING_API_KEY=sk-... \  ghcr.io/kimelody/minirag:latest

Open http://localhost:18090 and start asking. Data lives in ./data (SQLite, created automatically).

Configuration

EnvRequiredDefaultDescription
DEEPSEEK_BASE_URLnohttps://api.deepseek.comAny OpenAI-compatible chat endpoint
DEEPSEEK_API_KEYyes—Chat model API key
EMBEDDING_BASE_URLnohttps://api.siliconflow.cn/v1OpenAI-compatible embeddings endpoint
EMBEDDING_API_KEYyes—Embeddings API key
EMBEDDING_MODELnoBAAI/bge-m3Embedding model
DEMO_KEYno—Visitor access code for read APIs; unset = open (local dev)
ADMIN_KEYno—Admin key required for ingest APIs

MCP

Listed on the official MCP Registry as io.github.KiMelody/minirag. Two tools: query(question, mode?) — ask and get a cited answer; ingest_text(docId, text, adminKey) — add a document.

bash
claude mcp add --transport sse minirag http://localhost:18090/sse
json
{  "mcpServers": {    "minirag": {      "url": "http://localhost:18090/sse"    }  }}

The hosted demo endpoint requires basic auth: https://minirag.kimelody.de5.net/sse (ask the owner for credentials).

REST API

MethodPathDescription
POST/api/chatAsk; returns answer + cited sources (JSON)
POST/api/chat/streamSame, streamed as SSE (meta / token / sources / done)
GET/api/search?q=&mode=Retrieval debug: vector | hybrid | rerank
POST/api/documents/textIngest {docId, text} (requires X-Admin-Key)
POST/api/documentsIngest an uploaded file, multipart (requires X-Admin-Key)

Evaluation

An eval harness ships in eval/: labeled question sets, Top-1 / Recall / MRR scoring over three retrieval modes — hybrid+rerank reaches Top-1 100% / MRR 1.0 on the demo set (report); a 20-question labor-law evaluation with corpus-cleaning scripts lives in eval/law/. Bring your own corpus; raw source texts are not redistributed.

Build from source

bash
mvn packagejava -jar target/minirag-0.1.0-SNAPSHOT.jar

Requires Java 21. API keys can be put in a .env file in the working directory (git-ignored).

中文说明

单进程私有化 RAG 知识库:SQLite 存储 + 混合检索(向量 + BM25,RRF 融合,可选 LLM 重排),回答带可点击引用角标,自带网页演示、REST API 与 MCP server(SSE),内存占用约 250MB,1GB 小服务器可跑。在线演示(访问码联系作者)。

License

MIT

來源:README.md,提交 94af130

工具

0
該伺服器需要 API 金鑰等憑證,因此 SourceWeft 無法在沒有憑證的情況下讀取其工具,也未收錄。

版本歷史

1
  1. v0.1.0最新Oct 15, 2026

評分

已滿足適用檢查項的 85%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分