# loci [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/IvenKooLab/loci  
**GitHub Stars:** 101  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/loci-2

## Description
Cross-session memory and hybrid RAG over your notes and docs. Local-first, with cited answers.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "loci": {
    "command": "uvx",
    "args": ["loci-rag"]
  }
}
```

## Documentation

## What loci MCP server does

loci MCP server gives MCP hosts access to a local knowledge base built from notes, documentation, and durable agent memories. It supports Markdown, plain text, HTML, org-mode, and chat exports by default; optional extras add PDF, Word, and OCR support. The same index can be used through MCP, the command line, or the local web console.

Search combines vector retrieval with BM25 keyword matching. This lets semantic queries find related passages while literal identifiers such as `user_id`, `api/v2`, or `SHT45` can still match directly. Answers include citations in `file > section` form, so an agent or developer can inspect the source passage.

loci separates free-text knowledge from structured state. Notes are intended for information that may be phrased differently in future questions. State records are plain JSON addressed by an exact type and key, making them suitable for task snapshots, entity records, and other values where retrieving a similar but incorrect record would be unsafe.

## How it works

Run ingestion against configured source directories to chunk and index files. Hybrid search can then retrieve relevant passages, while the ask workflow sends selected context to a configured chat provider. Embedding and chat services may be separate providers, and local endpoints can keep the workflow offline.

MCP tools expose the shared knowledge base to compatible hosts. Durable memories are stored as Markdown files, while structured records live under `state/<type>/<key>.json` and are intentionally excluded from vector indexing. Decision notes can use `supersedes` and `effective` frontmatter fields; `loci history` follows those links to show which decision replaced another.

Searches and answers that use memory notes are recorded in `citations.jsonl`. Explicit negative feedback can reduce the later ranking of affected chunks. The `loci memory-health` command combines citation history, feedback, and note age to identify corrected, unused, or heavily referenced notes.

## Setup and configuration

loci requires Python 3.11 or newer. Install the package with `python -m pip install loci-rag`, or install from a source checkout when you need the example configuration. Set `LOCI_HOME` when using an existing instance directory. Optional document support is available through the `pdf` and `docx` extras.

Create `config.toml` from the example, configure `[llm]` and `[embed]`, and point `[[sources]].path` at the directories to index. The embedding endpoint must provide `/embeddings`. API keys can be supplied with `BRAIN_LLM_API_KEY` and `BRAIN_EMBED_API_KEY`; a key is not needed for the included offline demo.

Run `loci ingest`, then use `loci search` or `loci ask`. `loci serve-http` starts the local console at `127.0.0.1:8765/ui`, where users can search, ask questions, edit shared notes, inspect indexing activity, and review evidence. After changing the embedding model, rebuild the index with `loci ingest --force`.

## Tools and capabilities

- Expose the knowledge base to MCP hosts through `loci-mcp`.
- Store and retrieve prose memories with `brain_remember` and `brain_forget`.
- Save and fetch exact-key structured state with `brain_state_save` and `brain_state_get`.
- Search across configured directories with semantic, keyword, tag, path, and date filtering.
- Ask cited questions and optionally verify claims against retrieved evidence.
- Inspect decision supersession chains with `loci history`.
- Review memory usage and correction signals with `loci memory-health`.
- Discover harnesses, browse files, inspect per-tool statistics, and view digest notes.

## Limitations and notes

The knowledge base, index, and source files stay on the local machine, but configured embedding and chat requests may be sent to external providers. Local provider endpoints can avoid that network dependency. The server records tool calls and explicit feedback, not the host agent’s full conversation, so corrections must be submitted through the feedback workflow.

Live dialogue slots belong to the host session and are not durable memory. Values that must survive a session should be saved as exact-key state, while prose intended for later retrieval belongs in memory notes. Anonymous loopback clients have admin access to the web console by default; deployments behind a reverse proxy or SSH tunnel should disable local admin access and configure role-based tokens.

_Full upstream README: https://allmcps.com/mcp/loci-2/readme_

