loci

loci

loci•byivenkoolab

A document knowledge base with hybrid search and cited answers that is exposed to AI tools as an MCP server; files and index stay local.

License: MIT•Runtime: Awaiting documentation review•Category: file systems-docs

WHAT IT DOES

  • •Provides MCP tools for retrieval, cited answers, memory storage and exact-key state.
  • •Combines vector search with BM25 and returns answers with file and section citations.
  • •Also exposes note resources plus briefing, study-plan and contradiction-check prompts.
  • •Supports Markdown, text, HTML, org-mode and chat exports, with optional PDF, Word and OCR.

BEST FOR

  • •Giving MCP hosts like Claude Desktop or Cursor shared access to one local knowledge base.
  • •Searching personal notes and project docs for decisions and exact identifiers.
  • •Carrying durable agent memories and resumable task state across AI tools.

ABOUT LOCI

loci is cataloged as an MCP server attributed to ivenkoolab. A document knowledge base with hybrid search and cited answers that is exposed to AI tools as an MCP server; files and index stay local. It is categorized under file systems-docs. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for loci are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Do my files leave my machine?

Files and index stay local; embedding and chat requests go to configured providers, and local endpoints can keep the workflow offline.

How do I avoid retrieving a similar but wrong record?

Use exact-key structured state for records where fuzzy retrieval would be a bug, and memory notes for prose knowledge.

Upstream README

View this exact version on GitHub

README.md · b891c4da9b6a · Fetched 2026-11-13 09:29:44 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

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

loci console — dark theme, fictional demo data

What you can do

NeedHow loci helps
Find a decision buried in your notesHybrid search across directories, with tag, path and date filters
Search for an exact identifierLiteral matching for user_id, api/v2, SHT45 — a symbol does not have to win a semantic ranking
Know whether a decision still appliesloci history walks the supersession chain: what replaced it, and when
Ask a question and check the evidenceAnswers cite source sections; optional claim-by-claim verification
Carry context between AI toolsMCP tools share one instance; durable memories are Markdown files
See what each coding agent remembersHarness discovery, file browsing, per-tool stats and digest notes
Manage the knowledge base visuallyBuilt-in Web console for search, Q&A, memories, indexing and audit
Resume a task exactly where it left offStructured state by exact key (brain_state_save / brain_state_get) — no ranking in the way
Prune memory with evidence instead of vibesMemory health: citations, corrections and age per note (loci memory-health)

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.

What belongs where

Three kinds of "memory" fail differently, and mixing them is the classic misuse:

KindLives inRetrieved byRight forWrong for
Free-text knowledgememory notes (brain_remember)hybrid retrieval"what do we know about X"exact resume of a task
Structured statestate/<type>/<key>.json (brain_state_save)exact key, no rankingtask snapshots, entity records, slot state worth persistingprose you might want to fuzzy-find
Live dialogue slotsthe host agent's sessionthe host's own contextthis turn's variablesanything you expect to survive the session

Rules of thumb:

  • If retrieval returning a similar but wrong record would be a bug, it is state — key it and fetch exactly (brain_state_get type=task key=8f3c).
  • Real-time slot values change every turn; do not put them in the vector store. Persist the ones worth keeping across sessions as state records.
  • Prose that a future question might phrase differently is knowledge — brain_remember it, and let ranking do the work.

State records are plain JSON, hand-editable, and deliberately not indexed into vectors: that is the boundary, not an omission.

Decision history

A decision note edited in place loses the fact that something replaced it. Two frontmatter keys keep that visible, and loci history walks the chain:

---
supersedes: use-staging      # the note this one replaces
effective: 2026-03-01        # when this one took effect
---
loci history use-staging
# decision history, oldest first:
#   1. use-staging (effective 2026-01-05)  → superseded by
#   2. staging-exception (effective 2026-03-01)
# current decision: staging-exception (effective 2026-03-01)

loci ask marks excerpts from superseded notes in the context it sends to the model, so an answer does not quote last quarter's decision as current policy — and it tells you how many excerpts were affected.

Memory health

Every search or answer that uses a memory note is ledgered (citations.jsonl in the instance directory). loci memory-health joins that with feedback (loci feedback bad — which also sinks the rated chunks in later retrieval) and age, and flags notes worth looking at:

$ loci memory-health
12 memory note(s), most-cited first
cited  corr  age(d)  last-cited  flags  file
   17     0     41.2        0.3  -      20260920-103000-deploy-policy.md
    0     2     63.8         -     corrected  20260830-090000-old-strategy.md
    0     0     51.4         -     never-cited  20260901-120000-random-idea.md

corrected = rated bad after being used; never-cited = old and unused. Both are candidates for brain_forget — with evidence, not vibes. loci sees tool calls, not your conversation, so corrections reach it only through explicit feedback; the report never silently rewrites retrieval.

Quick start

Try it first, with nothing configured

pip install loci-rag
loci demo

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:

git clone https://github.com/IvenKooLab/loci.git
cd loci
python -m pip install -e .
cp config.example.toml config.toml

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.

loci ingest
loci search "deployment decisions"
loci ask "What did we decide about deployment, and why?"

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_KEY and BRAIN_EMBED_API_KEY. After changing the embedding model, rebuild with loci ingest --force.

Using Obsidian? See the vault setup, privacy and compatibility guide.

Web console

loci serve-http

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:

{
  "mcpServers": {
    "loci": {
      "command": "loci-mcp",
      "env": { "LOCI_HOME": "/absolute/path/to/your/loci-instance" }
    }
  }
}

Use an absolute executable path if your client cannot find loci-mcp. The instance directory must contain your config.toml.

MCP toolsPurpose
brain_search · brain_askRetrieve excerpts or get cited answers
brain_remember · brain_forgetStore or retract durable memories
brain_state_save · brain_state_get · brain_state_list · brain_state_deleteExact-key structured state (task snapshots, entity records)
brain_memory_healthWhich memory notes are cited, corrected, or dead weight
brain_links · brain_graphExplore note links and extracted relations
brain_wiki · brain_harnessConsolidate knowledge and inspect agent memories
brain_stats · brain_ingestInspect and refresh the index

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:

cargo build --release -p loci-cli     # in native/
./target/release/loci-mcp --config ~/.loci/config.toml
./target/release/loci gui             # the same console, served natively

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

loci watch                            # keep changed documents indexed
loci remember "Use staging for demos" --title "Demo environment"
loci search "demo environment" --tag memory
loci ask "How should I prepare a demo?" --verify
loci harness                          # inspect detected agent memories

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

loci terminal demo

The usage guide includes the original bilingual retrieval example and a small evaluation you can rerun against your own corpus.

Documentation

GuideCovers
Usage guide / 中文指南Commands, filters, harness setup, access control and local models
Configuration exampleProvider settings, source directories and runtime options
ArchitectureModules and the retrieval pipeline
Changelog · RoadmapReleased changes and planned work
ContributingDevelopment conventions and offline testing

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.

python -m pip install -e '.[dev,pdf]'
pytest  # offline tests; no API keys required

Find loci on Glama, ModelScope and awesome-mcp-servers. Source: GitHub. Licensed under MIT.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for loci from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/loci)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related file systems-docs MCP Servers

Alternative and complementary servers in the same category

View all in file systems-docs →

A Model Context Protocol server for global law with read-only tools to find and read provisions by date, trace the law behind each word, search text and changes, and check cases or briefs against law in force.

Repository stats unavailable
Files & Documentation
LoreKeeper MCP server
lorekeeper-rpg-lorekeeper-com•lore-keeper

Hosted MCP server for tabletop RPG worlds that organizes messy notes and documents into a private store and lets MCP apps search lore, read documents, find characters, and optionally generate character or world pictures.

Repository stats unavailable
Files & Documentation

An MCP server that gives AI assistants scoped file system operations inside a project directory, with read-only reference projects plus git and GitHub tools.

Repository stats unavailable
Files & Documentation