
loci
io.github.IvenKooLab由 GitHub 帳號 IvenKooLab 發布v0.4.0更新於 Nov 3, 2026
Cross-session memory and hybrid RAG over your notes and docs. Local-first, with cited answers.
概覽
本地優先的知識庫 MCP 伺服器,讓助理在筆記與文件中檢索、提問並保存記憶,答案附上引用。
- 可以做什麼
- 在已索引的筆記與文件中檢索與提問,結合向量與 BM25 檢索,並給出 file > section 形式的引用
- 儲存或撤回長期記憶,並把知識整理成 wiki 式筆記
- 檢視筆記之間的連結與擷取出的關聯
- 檢視各編碼代理的記憶、依工具統計與摘要筆記
- 檢視索引統計並觸發來源目錄重新索引
- 提供筆記資源,以及簡報、學習計畫與矛盾檢查等提示詞
- 適用情境
- 適合你手邊有筆記、專案文件或 Obsidian 儲存庫,希望助理能找回其中的決策並給出可核查引用的情況。也適合讓多個 AI 工具指向同一個實例,共用上下文與長期記憶。
- 執行需求
- 以 stdio 方式在本機執行 loci-mcp 指令,來自 PyPI 套件 loci-rag;Python 版需 Python 3.11 以上,也可使用 Rust 二進位檔。需要一個以 LOCI_HOME 指定的實例目錄,內含帶 [llm] 與 [embed] 設定的 config.toml,嵌入端點須支援 /embeddings。API 金鑰可透過 BRAIN_LLM_API_KEY 與 BRAIN_EMBED_API_KEY 提供。PDF、Word 與 OCR 支援需額外安裝。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 loci,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
[loci — shared memory for your AI tools]
English · 简体中文 · 繁體中文 · 日本語 · 한국어
[CI] [PyPI] [MCP server] [Python 3.11+] [Rust native build] [MIT license]
Turn scattered notes, project docs and agent memories into a knowledge base you can search and ask questions about — as an MCP server, from your terminal, or in the browser.
loci combines vector search with BM25 and returns answers with file > section citations. Your files and index stay on your machine. Embedding and chat requests go to the providers you configure; local endpoints can keep the entire workflow offline.
MCP is the point. Mount loci-mcp in Claude Desktop, Cursor, Cline or any other MCP host and your assistant gets the whole knowledge base as tools. The console and a desktop shell are alternate front-ends to the same index — you never need them.
Quick start · MCP setup · Web console · Usage guide · 中文说明
[loci console — synthetic-data demo]
Actual console UI with fictional demo data. No personal knowledge base, account or API key is connected; counts are illustrative.
Dark theme preview
What you can do
Markdown, text, HTML, org-mode and chat exports work out of the box. Optional extras add PDF, Word and OCR support. Keep using your existing note editor or Obsidian vault.
Quick start
Try it first, with nothing configured
loci demo copies six fictional notes into ./loci-demo-notes, chunks them and
answers three example questions — cited down to file > section — with no
config.toml, no API key and no network. It is keyword-only (BM25, the same
ranking hybrid search fuses with vector hits), which is exactly the point:
something runs before you commit a key. Add [embed] later and the same index
goes hybrid.
[loci demo — real output, bundled fictional notes]
Actual loci demo output on the bundled sample notes; paths shortened, timings vary.
Index your own notes
Requires Python 3.11+. Start from source so the example configuration is available:
Edit config.toml: fill in [llm] and [embed], and change [[sources]].path to your notes directory. The embedding endpoint must support /embeddings; chat and embeddings may use different providers.
Already have a configuration? Install the package with python -m pip install loci-rag and set LOCI_HOME to your instance directory. For optional document support, use python -m pip install 'loci-rag[pdf,docx]'.
API keys can be supplied through
BRAIN_LLM_API_KEYandBRAIN_EMBED_API_KEY. After changing the embedding model, rebuild withloci ingest --force.
Using Obsidian? See the vault setup, privacy and compatibility guide.
Web console
Open 127.0.0.1:8765/ui to browse harness memories, search, ask questions, edit shared notes and inspect indexing activity. Clicking a search result opens an evidence pane with the passage it was cut from — the file > section citation, checkable without leaving the console. The console includes Chinese/English and light/dark switches; no frontend build is required.
By default, anonymous loopback clients have admin access. Behind a reverse proxy or SSH tunnel, set [http] local_admin = false and configure role-based tokens. See access control.
For DeepSeek Harness, loci-dsh brings search, Q&A and memory capture into the Harness workbench through the same HTTP backend.
Connect your AI tools
Point each MCP client at the same LOCI_HOME so they share the same config, index and memory files:
Use an absolute executable path if your client cannot find loci-mcp. The instance directory must contain your config.toml.
The server also exposes note resources and briefing, study-plan and contradiction-check prompts. See the MCP guide for details.
[loci-mcp — real JSON-RPC session]
Actual loci-mcp output: initialize, tools/list and prompts/list on the real binary.
Native build (Rust)
The same retrieval pipeline and MCP surface, with no Python runtime to install — one binary, and the index is a single SQLite file instead of a database directory:
Status: retrieval, a subset of MCP tools, harness discovery, migration and the
console are ported. Harness file browsing and digest generation remain
Python-only. See
native/ for what is ported and the fidelity tests that pin it
(chunking, the frozen default tokenizer, the CJK bigram decoy case, RRF, and
incremental ingest).
The two builds keep separate store formats (SQLite vs ChromaDB directory),
but they exchange data: export from Python with loci export, import in the
native build with loci import, which refuses to mix embedding spaces unless
you pass --force.
A small daily workflow
Indexing is incremental. Notes stay readable as Markdown. For multiple machines, sync source files and memory notes, then rebuild each local index; keep credentials out of the repository.
See a retrieval session
The usage guide includes the original bilingual retrieval example and a small evaluation you can rerun against your own corpus.
Documentation
loci uses the OpenAI-compatible SDK and ChromaDB, with no LangChain or LlamaIndex dependency. BM25, loaders and the MCP transport are implemented in the project.
Find loci on Glama, ModelScope and awesome-mcp-servers. Source: GitHub · Gitee. Licensed under MIT.
來源:README.md,提交 190121d
工具
0版本歷史
1- v0.4.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分