Scan your whole stack
From OX Research Newsroom
Latest version: v1.3.1
Locus was last scanned on 1 Dec 2026 at version 1.3.1. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 1.3.1 LATEST | 1 Dec 2026 | No rules fired |
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.
The publisher’s own README, as collected from the registry.
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.
Quick start · Benchmarks · When to use Locus vs OMPA · Architecture · MCP tools · CLI
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).
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.
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/.
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.
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:
LocusEngine(analyzer=...), LOCUS_ANALYZER=... or locus reindex --analyzer ....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).
mode="hybrid")forget removes them; add_fact facts are never touchedtrack=True# heading boundaries; long sections fall back to word windows (400 words, 50 overlap).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.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.retrieve(..., expansion="rm3")) — LLM-free pseudo-relevance feedback. Opt-in.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.follow_symlinks="inside" or True (equivalently --follow-symlinks inside|all, or LOCUS_FOLLOW_SYMLINKS).as_of="2024-01-01" returns only facts valid on that datekg_first / bm25_first / balanced and shifts re-rank weightsindex on every startuptype, 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.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.leads, works_at, is_a, part_of, replaced, depends_on...) auto-run during indexing — no annotation requiredkg.traverse("Alice", max_depth=2) returns the full entity subgraphkg.match("*", "works_at", "Acme") finds everyone at Acme; * is a wildcardengine.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."
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.
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).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.