Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

Locus

Latest version: v1.3.1

Overview

Last scanned
1 Dec 2026
Published
1 Dec 2026
MCP server Transport: stdio Publisher: jmiaie
1 Stars
0 Forks
1 Versions
Python Repo language

Scan summary

Locus was last scanned on 1 Dec 2026 at version 1.3.1. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: First and only release on 1 Dec 2026.
  • Findings: No rules fired in version 1.3.1.
  • MCP server: Runs over stdio.

Versions

1 version published
Versions and the rules that fired in each
VersionPublishedStatus
1.3.1 LATEST 1 Dec 2026 No rules fired

No rules fired in 1.3.1

Findings

Findings for v1.3.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 1.3.1; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

Locus

Retrieval your agent can explain: BM25 and a temporal knowledge graph over your own files, served over MCP. No LLM, GPU, vector database, or runtime dependencies.

PyPI Python versions License: MIT CI Version Zero Dependencies 47 MCP Tools

Quick start  · Benchmarks  · When to use Locus vs OMPA  · Architecture  · MCP tools  · CLI


Quick start

Thirty seconds, Python 3.11+, nothing else to install. The corpus is three notes on purpose: with one note, BM25 IDF collapses and the CLI prints score=0.0000 even though the note is the hit.

pip install locus-rag     # macOS / Linux: python3 -m pip install locus-rag · Windows: py -3 -m pip install locus-rag

mkdir notes
printf '# Auth\n\nJWT tokens are validated on every request by the gateway.\n' > notes/auth.md
printf '# Billing\n\nInvoices are sent on the first of the month.\n' > notes/billing.md
printf '# Deploy\n\nProduction deploys require a green CI run.\n' > notes/deploy.md
locus index ./notes
locus retrieve "how are JWT tokens validated?"

Those two commands print:

{
  "files": 3,
  "chunks": 3,
  "triples": 0
}

[1] auth.md  score=1.4692  via=bm25
------------------------------------------------------------
Auth

JWT tokens are validated on every request by the gateway.

The check is auth.md and via=bm25. 1.4692 is FTS5's score for this three-note corpus (SQLite 3.45).

Python:

from locus import LocusEngine

engine = LocusEngine(store_path=".locus")
engine.index("./notes")
chunks = engine.retrieve("JWT authentication flow", limit=5)
for chunk in chunks:
    print(f"{chunk.doc_path}  via={chunk.provenance}")
print(engine.explain(chunks[0].chunk_id, query="JWT")["narrative"])

MCP (Claude Desktop, Claude Code, Cursor, Windsurf):

claude mcp add locus -- locus mcp --store /path/to/.locus

Same server: python3 -m locus.mcp.server --store /path/to/.locus (Windows: py -3 -m locus.mcp.server --store C:\path\to\.locus). Tool calls use the --store you configured; a call can still pass store_path.

All 47 MCP tools and the four prompts: docs/tools.md. CLI: CLI reference. A no-dependency walkthrough in a checkout of this repo: pip install -e . then python examples/mcp_sales_demo.py (--keep leaves the temp store).

Why Locus

Most agent-memory libraries call an LLM to extract facts before anything can be searched. Locus indexes the text itself. Results say why they came back (via=bm25, matched terms, linked entities). The default path is local and deterministic.

Sibling library: OMPA is the vault an agent writes memory into. Use Locus for document retrieval; use OMPA for persistent session memory. When to use which.

Benchmarks

On the full LongMemEval-S set (470 questions) Locus reaches R@5 0.977 and MRR@10 0.911 at 2.3 ms per query, with 0 LLM calls. An opt-in dense re-rank plus date-aware ranking lifts MRR to 0.937. Method and caveats: Benchmark Results and benchmarks/README.md.

On a 30-question stratified subset, run in one harness against default open-source libraries (not hosted vendor services; low power):

System MRR@10
OMPA 0.967
Letta archival API 0.957
Locus 0.917
Letta agent 0.800
mem0 0.722
LangMem 0.606
Graphiti, cosine floor removed / default search 0.547 / 0.428

In that run Locus made 0 LLM calls. mem0 made 49 calls per question, LangMem 53 and Graphiti 218 (gpt-4o-mini, upper bounds from gateway logs, including pilot runs). Per-question rows: benchmarks/published/2026-10-24-headtohead/.


Architecture

Locus is three layers — memory, retrieval, and interface — with no layer depending upward:

┌─────────────────────────────────────────────────────────────────┐
│  Interface Layer                                                  │
│  ┌────────────────┐  ┌──────────────────┐  ┌─────────────────┐  │
│  │  CLI (locus)   │  │  MCP stdio server│  │  HTTP JSON-RPC  │  │
│  │  42 commands   │  │  47 tools        │  │  POST /rpc      │  │
│  │                │  │  4 prompts       │  │  Bearer token   │  │
│  │                │  │  resources       │  │  CORS opt-in    │  │
│  └────────────────┘  └──────────────────┘  └─────────────────┘  │
├─────────────────────────────────────────────────────────────────┤
│  Retrieval Layer                                                  │
│  BM25Retriever  ·  KGRetriever  ·  LinkWalker                    │
│  StructuralRetriever  ·  RecencyRetriever  ·  LinkPopularity     │
│  ──────────────────────────────────────────────────────────────  │
│  RRF Fusion  ·  QueryClassifier  ·  ContextBulletin              │
│  TokenBudget  ·  LocusCluster (multi-node)                       │
├─────────────────────────────────────────────────────────────────┤
│  Memory Layer                                                     │
│  Corpus         SQLite FTS5 BM25 index, checksum dedup, SQLite   │
│  TemporalKG     Triples + validity windows, traversal, match     │
│  EntityResolver Alias table → canonical entity names            │
│  Chunker        Section-aware (heading boundaries) + word-count  │
└─────────────────────────────────────────────────────────────────┘

All storage is SQLite — no external databases, no servers, no configuration.


Retrieval Pipeline

Locus retrieves in two stages. Stage 1 is always BM25 over a SQLite FTS5 inverted index (stdlib sqlite3, no extra packages). Stage 2 is an optional re-rank of the BM25 candidates with five graph/metadata signals, fused with weighted Reciprocal Rank Fusion.

  Query ──► Stage 1: BM25 (SQLite FTS5)  ──► top-k chunks          mode="bm25"  (default)
                     │
                     └─► candidate pool (rerank_depth=100)
                           ├─ KG            entity expansion + one hop (honours as_of)
                           ├─ Link Walk     wikilinks from the top BM25 hits
                           ├─ Structural    frontmatter date / tag / type
                           ├─ Recency       frontmatter date, newest first
                           └─ Link Popularity  inbound wikilinks
                         weighted RRF (intent-aware, rerank_alpha=0.1) ─► top-k   mode="hybrid"

Why BM25 is the default: on the public BEIR SciFact and NFCorpus test sets the hybrid re-rank did not beat plain BM25 (paired bootstrap, see Benchmark Results), and every larger re-rank weight we tried on the dev splits made nDCG@10 worse. The re-rank stays available for link- and frontmatter-rich vaults: engine.retrieve(q, mode="hybrid"), LocusEngine(retrieval_mode="hybrid"), LOCUS_RETRIEVAL_MODE=hybrid, locus retrieve --mode hybrid, or mode on the locus_retrieve MCP tool. Passing as_of selects hybrid, since the temporal filter acts on KG facts.

Analyzer (how text becomes index terms). The default is porter+english. It lower-cases text, drops the Locus stop-words plus a larger English function-word list, and applies Porter stemming with a pure-stdlib stemmer (locus/memory/stemmer.py). On every Porter-stemmable word in the BEIR corpora it gives the same output as SQLite FTS5's porter tokenizer, apart from one degenerate word. The other analyzers are porter (stemming only) and plain (the pre-2026-10-21 behaviour: no stemming, small stop-word list).

How the analyzer is chosen:

  • Set it with LocusEngine(analyzer=...), LOCUS_ANALYZER=... or locus reindex --analyzer ....
  • A store remembers its analyzer.
  • Asking for a different one re-indexes from the stored chunks; source files are not re-read.
  • Stores created before analyzers existed are re-indexed with the default on first open.

Index-term APIs follow the analyzer:

  • top_terms() and inspect_doc() report stems.
  • get_posting_list("running") is the same as get_posting_list("run").

Use analyzer="plain" to keep exact-token behaviour.

Stage-2 signal Weight (× rerank_alpha) What it captures
KG Entity intent-weighted Entities from the query linked to documents
Link Walk intent-weighted Candidates reachable via wikilinks from the top hits
Structural 1.0 Frontmatter date ranges, tags, doc types
Recency 0.3 Newer frontmatter date first
Link Popularity 0.2 Hub documents cited by many others

Retrieval is read-only: it never writes to the store unless you pass track=True, which records hits in the hot-context bulletin and token budget (the locus_retrieve MCP tool does this by default so locus_hot_context keeps working; pass track: false for a pure read).


Features

Retrieval
  • BM25 on SQLite FTS5 — inverted index, so query cost tracks the matching postings, not the corpus size (100k docs: ~93 ms p50 vs ~19 s before); pure-Python fallback when FTS5 is not compiled in
  • Optional hybrid re-rank — KG, link walk, structural, recency and link popularity over the BM25 candidates, fused via weighted RRF (mode="hybrid")
  • Incremental indexing — changed files replace their chunks, postings and auto-extracted KG triples in place; forget removes them; add_fact facts are never touched
  • Deterministic, read-only retrieval — ties broken by index order; nothing is written unless track=True
  • Section-aware chunking
    • Splits at # heading boundaries; long sections fall back to word windows (400 words, 50 overlap).
    • Opt-in options (stored with the index):
      • chunk_words / overlap_words set the window size and overlap.
      • heading_context prefixes every window with its heading path (Spec > 3.1 > Slabs).
      • boundaries="lines" ends windows at line or paragraph breaks.
    • See Chunking, parent-child and RM3.
  • Parent-child retrieval (retrieve(..., parent="section"|"doc")) — matches small chunks, then returns the enclosing section or document. Each result's spans cite the matched passages by character offset. Opt-in.
  • RM3 query expansion (retrieve(..., expansion="rm3")) — LLM-free pseudo-relevance feedback. Opt-in.
    • NFCorpus: +0.014 nDCG@10 (significant).
    • Neutral elsewhere.
    • About 5–10× BM25 latency.
  • Cross-encoder reranking (optional locus[rerank] extra) — reranks the BM25 top-k with a local MiniLM cross-encoder. NFCorpus +0.018 (significant); about 400 ms/query on CPU. Opt-in.
  • Symlink-safe indexing — directory indexing skips symlinks by default, so it never reads outside the indexed tree. Opt in with follow_symlinks="inside" or True (equivalently --follow-symlinks inside|all, or LOCUS_FOLLOW_SYMLINKS).
  • Temporal retrieval — as_of="2024-01-01" returns only facts valid on that date
  • Query intent routing (hybrid) — auto-classifies kg_first / bm25_first / balanced and shifts re-rank weights
  • Checksum dedup — unchanged files never re-indexed; safe to run index on every startup
  • Metadata filters — restrict results by path glob, frontmatter type, tags (all/any), date range, point-in-time as_of (honours supersedes) and any frontmatter field (eq ne in nin gt gte lt lte contains exists). Available in the API (retrieve(..., filters={...})), the CLI (--path --type --tag --date-from --in-force --meta) and the locus_retrieve MCP tool (filters). Filters never change scores, and the candidate pool deepens until limit matches are found. See Metadata filters.
  • Optional LLM query rewriting — rewrite, multi (RRF merge) and HyDE through any OpenAI-compatible endpoint (locus.llm, locus retrieve --llm multi). Off by default and never imported by the core. With gpt-4o-mini, HyDE reaches NFCorpus nDCG@10 0.359 (+0.030, significant); none of the three is significant on SciFact. Costs about 0.8–2 s and $0.02–0.08 per 1,000 queries. See LLM query transformations.
Knowledge Graph
  • Prose triple extraction — 14 relation patterns (leads, works_at, is_a, part_of, replaced, depends_on...) auto-run during indexing — no annotation required
  • Entity resolution — alias table maps name variants to canonical entities transparently
  • Contradiction detection — surfaces same-predicate triples with different objects and overlapping validity windows
  • BFS traversal — kg.traverse("Alice", max_depth=2) returns the full entity subgraph
  • Pattern matching — kg.match("*", "works_at", "Acme") finds everyone at Acme; * is a wildcard
  • KG export — GraphML (Gephi/Cytoscape), JSONL (scripting), DOT (Graphviz)
Explainability
engine.explain(chunk_id, query="authentication")
# {
#   "bm25_matched_terms": ["jwt", "authentication"],
#   "kg_matched_entities": ["Alice"],
#   "structural_matches": ["date 2025-02-10 in range Q1 2025"],
#   "kg_context": [{"entity": "Alice", "fact_count": 3, "sample_fact": "Alice --leads--> Auth team"}],
#   "narrative": "Chunk from 'auth.md'. Retrieved because: BM25: terms [jwt,
#                 authentication]; KG: Alice links to document..."
# }

This is structurally impossible with vector search. No cosine score has a "why."

MCP Integration

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • MCP Registry io.github.jmiaie/locus

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Vulnerability Insights

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?

CVE

Java4Shell (CVE-2026-114938): Easy to Crash, Hard to Exploit — Less Than 0.12% of JVMs Estimated at Risk of RCE

Plug and Pray: Your AI Agents Are Taking Orders From Strangers
Research

Plug and Pray: Your AI Agents Are Taking Orders From Strangers

Frame 2085668439 (1)
Group 1261154229