Skip to main content

A personal memory server: aspect-tagged raw sources, concept-graph retrieval, and an MCP surface for Claude Code.

Project description

loci

A personal memory server. You save what you read; loci tags each source with aspects (methodology, knowledge-graph, …), wires up concept edges (citations, wikilinks, co-aspect), and serves the result to Claude Code over MCP so the model can recall the parts of your library that actually matter for what you're writing.

No interpretation graph, no draft pipeline, no PageRank. Just:

save → tag → recall

If you want a deeper read, start at docs/getting-started.md and then docs/architecture.md.

Status

Single-user, local-first. SQLite is the source of truth; raw blobs are content-addressed on disk. Python 3.12+.

Install

# with uv (recommended — isolated environment)
uv tool install loci-wiki

# with pipx
pipx install loci-wiki

# or just curl-pipe the installer
curl -fsSL https://raw.githubusercontent.com/loci-knowledge/loci/main/install.sh | sh

The first scan downloads the embedding model (BAAI/bge-small-en-v1.5, ~130 MB) into ~/.loci/models/.

Quick start

# 1. First-run setup: writes ~/.loci/.env (provider keys) and ~/.loci/config.toml
loci config init

# 2. Create a project
loci project create my-research

# 3. Register loci with Claude Code (one-time, user-scope)
claude mcp add loci --transport stdio --scope user -- loci mcp

# 4. Bind a directory to your project (so MCP knows which slug to use)
cd ~/Documents/my-research
loci project bind my-research

# 5. Save sources directly from Claude Code
#    (or via CLI: `loci save https://arxiv.org/abs/1612.03975`)

# 6. Recall in Claude Code
#    `@loci:source://...` for a single resource
#    `loci_recall("how does PPR work")` for ranked chunks with reasons

All user data lives under ~/.loci/. Run loci doctor to see resolved paths.

CLI commands

loci config init                              # write ~/.loci/.env + config.toml
loci doctor                                   # show storage paths + active project
loci server                                   # HTTP API + worker on 127.0.0.1:7077
loci mcp                                      # MCP stdio server (for Claude Code)
loci worker                                   # background worker only

loci project create <slug>                    # interactive wizard
loci project list / info / bind / manage
loci current set <slug>                       # pin project for MCP sessions

loci workspace create / list / add-source / scan / link / unlink
loci scan <project>                           # scan all linked workspaces
loci use [workspace_slugs...]                 # bind workspaces for this session

loci save <url_or_path> [--folder] [--aspects]
loci recall "query" [--aspects ...] [-n 10]
loci aspects [resource_id] [--add ... --remove ... --list-vocab]

loci status [project]
loci export [project]
loci reset                                    # wipe everything

MCP surface (Claude Code)

tool what it does
loci_save ingest URL/file/text, propose folder + aspects via elicitation, write to DB
loci_recall concept-expand + BM25/ANN over chunks with concept-graph rerank
loci_aspects list/edit aspects on a resource (elicitation form for editing)
loci_browse list resources with folder + top aspects, filterable
loci_context project profile + counts + top aspects for the current session
loci_research paper-search sub-agent (deferred to v1.1)

@-mentionable resources:

@loci:source://{resource_id}
@loci:folder://{folder_path}
@loci:aspect://{label}

Source layout

src/loci/
  ui/cli.py              entry point: loci.ui.cli:main
  api/                   FastAPI REST + WebSocket
    routes/              projects, workspaces, sources, aspects, jobs
  mcp/                   MCP server + project resolution
  graph/                 sources, aspects, concept_edges, projects, workspaces
  retrieve/              lex + vec + hyde + concept_expand + pipeline
  capture/               ingest, folder_suggest, aspect_suggest, link_parser
  ingest/                walk → hash → extract → chunk → embed
  jobs/                  queue + worker + handlers (classify_aspects, parse_links, …)
  embed/                 sentence-transformers wrapper
  llm/                   pydantic-ai wrapper
  db/                    schema.sql + connection.py
  config.py              Settings + ~/.loci/ paths

License

MIT.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

loci_wiki-0.1.0.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

loci_wiki-0.1.0-py3-none-any.whl (133.0 kB view details)

Uploaded Python 3

File details

Details for the file loci_wiki-0.1.0.tar.gz.

File metadata

  • Download URL: loci_wiki-0.1.0.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for loci_wiki-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c3fc0f996c0830dffc38d25320c225f9dc468bdcd5f7debc7f8027ae724f871b
MD5 9d95bc41b41603cc008900f4cbd01957
BLAKE2b-256 5ef201608454d9d66464721d9696c8cc55f54f4d28b32e0770e53043d3f124bd

See more details on using hashes here.

File details

Details for the file loci_wiki-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: loci_wiki-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 133.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for loci_wiki-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5239929757784d0e6a355e6709c2fa690c0f12f97255e391b3eb88039f58bc9f
MD5 946349a2b614da07f79bef0530e61164
BLAKE2b-256 8d410da769f4f7fffa6b0e06b674c31f0a147088201c5a2cd2feb4b907f81dbb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page