Skip to main content

loci — shared memory for your AI tools

English · 简体中文 · 繁體中文 · 日本語 · 한국어

CI PyPI Python 3.11+ MIT license

Turn scattered notes, project docs and agent memories into a knowledge base you can search and ask questions about — from your terminal, browser or MCP client.

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.

Quick start · Web console · MCP setup · 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

Need How loci helps
Find a decision buried in your notes Hybrid search across directories, with tag, path and date filters
Ask a question and check the evidence Answers cite source sections; optional claim-by-claim verification
Carry context between AI tools MCP tools share one instance; durable memories are Markdown files
See what each coding agent remembers Harness discovery, file browsing, per-tool stats and digest notes
Manage the knowledge base visually Built-in Web console for search, Q&A, memories, indexing and audit

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

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.

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. 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 tools Purpose
brain_search · brain_ask Retrieve excerpts or get cited answers
brain_remember · brain_forget Store or retract durable memories
brain_links · brain_graph Explore note links and extracted relations
brain_wiki · brain_harness Consolidate knowledge and inspect agent memories
brain_stats · brain_ingest Inspect and refresh the index

The server also exposes note resources and briefing, study-plan and contradiction-check prompts. See the MCP guide for details.

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

Guide Covers
Usage guide / 中文指南 Commands, filters, harness setup, access control and local models
Configuration example Provider settings, source directories and runtime options
Architecture Modules and the retrieval pipeline
Changelog · Roadmap Released changes and planned work
Contributing Development 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 · Gitee. Licensed under MIT.

Metadata

Release files for loci-rag 0.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for loci-rag 0.8.1
File Size Uploaded Provenance Actions
loci_rag-0.8.1.tar.gz 111.1 kB Without provenance Details for loci_rag-0.8.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for loci-rag 0.8.1
File Interpreter ABI Platform Actions
loci_rag-0.8.1-py3-none-any.whl Python 3 none any Details for loci_rag-0.8.1-py3-none-any.whl

Total release size: 186.3 kB

Release files / loci_rag-0.8.1.tar.gz

Download URL loci_rag-0.8.1.tar.gz
Size 111.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8c31104e16719d92477bf51f3f29413d12d6035c459d98d8b43fb6b672cb5655
BLAKE2b-256 checksum
How to use checksums
fe51e8b93ef3f9d1dfde55046e0e58f37783d88f3feab84d5600387a082aef8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.11

Release files / loci_rag-0.8.1-py3-none-any.whl

Download URL loci_rag-0.8.1-py3-none-any.whl
Size 75.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
592acc91df231116682ab2cb4bb178a0b9b32ff2ffdfceeffe090ce4acdd15ea
BLAKE2b-256 checksum
How to use checksums
59b625a019ee32c33c58c64bbc7dfc5811af8506e57698811402e7ceb0785735
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.11

Security for loci-rag 0.8.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page