Locus
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| store | No | Path to the Locus store/index, passed as `--store PATH` to the MCP server (e.g. `locus mcp --store /path/to/.locus`). Tool calls use this configured store; a call can still pass `store_path`. | |
| HF_HUB_OFFLINE | No | Set to `1` to keep the optional cross-encoder reranker model (`locus[rerank]`) offline after its first download from the Hugging Face Hub. Hub telemetry is disabled by default. | |
| LOCUS_ANALYZER | No | Text analyzer used to build the index. Default `porter+english` (lower-casing, stop-words, Porter stemming); other values are `porter` (stemming only) and `plain` (no stemming, small stop-word list, exact-token behaviour). A store remembers its analyzer; asking for a different one re-indexes from the stored chunks. | |
| OPENAI_API_KEY | No | Alternative API key used by `OpenAICompatibleClient.from_env()` for the optional LLM query transformations. | |
| LOCUS_HTTP_HOST | No | HTTP binding host for `locus serve` (used for the HTTP JSON-RPC transport). Binds 127.0.0.1 by default; a non-loopback address such as 0.0.0.0 requires a token. | |
| LOCUS_LLM_MODEL | No | Model used by the optional LLM query transformations (`rewrite`, `multi`, `hyde`) via any OpenAI-compatible endpoint. Off by default; the core never imports `locus.llm` or makes network calls. | |
| OPENAI_BASE_URL | No | Base URL for an OpenAI-compatible server (including local ones such as vLLM, llama.cpp or Ollama) used with OPENAI_API_KEY for the optional LLM query transformations. | |
| OPENROUTER_API_KEY | No | API key used by `OpenAICompatibleClient.from_env()` (via OPENROUTER) for the optional LLM query transformations. | |
| LOCUS_RETRIEVAL_MODE | No | Retrieval mode for the engine. Default `bm25`; set to `hybrid` to enable the optional KG/link/structural/recency/link-popularity re-rank fused with weighted RRF. | |
| LOCUS_FOLLOW_SYMLINKS | No | Symlink handling during directory indexing: `no` (default, skips symlinks), `inside` (only symlinks within the indexed tree), or `all`. Equivalently `--follow-symlinks inside|all`. | |
| LOCUS_HTTP_TOKEN_FILE | No | Path to a file containing the bearer token for the HTTP transport (`locus serve`). Locus refuses to bind a non-loopback address without a token. | |
| LOCUS_LLM_MAX_TOKENS_TOTAL | No | Caps the total tokens used per LLM client when using the optional LLM query transformations. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {} |
| prompts | {} |
| resources | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| locus_indexB | Index a file or directory into Locus. Builds BM25 inverted index, extracts KG triples from wikilinks, tags, and prose sentences. Skips unchanged files (checksum dedup). Run this first. |
| locus_retrieveA | BM25 retrieval (SQLite FTS5) with an optional re-rank of the BM25 candidates by KG entity expansion, link walking, frontmatter structural matching, recency and link popularity (mode='hybrid', weighted RRF). Default mode is 'bm25'; passing as_of selects 'hybrid'. Deterministic. Each result carries a provenance tag (bm25 / kg / link:hopN / structural / recency / link_pop). |
| locus_explainA | Explain WHY a chunk was (or would be) retrieved for a query. Reports which BM25 terms matched, which KG entities link to the document, and which structural signals fired. Returns a plain-English narrative. Unique to graph-based RAG — impossible with vector search. |
| locus_add_factC | Add a temporal fact (subject–predicate–object) to the KG. |
| locus_query_entityC | Query all KG facts about an entity. Supports as_of temporal filter. |
| locus_kg_statsD | Knowledge graph statistics. |
| locus_contradictionsA | Find contradicting KG triples: same subject+predicate, different objects, overlapping validity windows. |
| locus_add_aliasB | Register an entity alias so variant names resolve to the same canonical entity. |
| locus_suggest_aliasesC | Suggest entity name pairs that may refer to the same entity (similarity-based). |
| locus_hot_contextC | Return the hot-tier bulletin board — frequently retrieved and pinned context. |
| locus_promoteC | Manually pin a chunk to Tier 0 (never auto-archived). |
| locus_session_startC | Warm context open: corpus + KG + bulletin + resolver stats, hot-tier content. |
| locus_wrap_upB | Session close: tick bulletin decay, return summary stats. |
| locus_statusC | Full status: corpus, KG, bulletin, budget, resolver. |
| locus_forgetC | Remove a document from the corpus. |
| locus_syncB | Full reindex: wipe and rebuild corpus + KG from a directory. |
| locus_prepare_contextA | All-in-one context preparation for LLM agents. Retrieves → re-ranks → packs into token budget → assesses confidence → adds KG facts for query entities. Single call returns everything needed to answer the query. Recommended primary tool for agent workflows. |
| locus_cache_statsB | Query cache statistics: size, hit rate, hits, misses. |
| locus_clear_cacheC | Manually invalidate the query result cache. |
| locus_kg_traverseB | BFS traversal from a starting entity. Walks the KG graph up to max_depth hops, optionally filtered by predicate or direction. Returns all reachable entities and their facts. |
| locus_kg_matchB | Pattern match over the KG with wildcard support. '' matches any value. Examples: match('Alice','','') — all Alice facts; match('','leads','') — all leadership; match('','works_at','Acme') — everyone at Acme. |
| locus_doctorC | Run a health check on the Locus store. Checks corpus integrity, KG population, bulletin fill levels, entity resolver, store size, and version. |
| locus_export_kgB | Export the knowledge graph to a file. Formats: graphml (Gephi/Cytoscape), jsonl (scripting), dot (Graphviz). Format is auto-detected from the file extension if not specified. |
| locus_ingest_ompaA | Import an OMPA vault into the Locus store. Indexes all markdown files and copies KG triples directly from OMPA's .palace/knowledge_graph.sqlite3 (same schema — zero transformation). Safe to re-run; unchanged files are skipped via checksum dedup. |
| locus_benchmarkA | Measure retrieval quality against a JSON QA file. Returns Recall@K and MRR. QA format: [{"query": "...", "expected_docs": ["path/to/doc.md"]}] |
| locus_cluster_retrieveB | Query multiple Locus nodes simultaneously and fuse results via RRF. Provenance tags include the node name (e.g. 'jarv:bm25', 'kai:kg'). Designed for Jarv/Kai/Tai multi-node setups. |
| locus_add_nodeC | Register a named node (Locus store) in the cluster registry. |
| locus_remove_nodeB | Unregister a node from the cluster (does not delete its store). |
| locus_list_nodesB | List all cluster nodes with their corpus and KG stats. |
| locus_reasonB | Multi-hop KG reasoning. Extracts entities from the question, explores their KG neighbourhood, and surfaces connecting paths between them. Returns reasoning_chains, entity_neighborhood, and detected entities. Ideal for questions like 'How is Alice connected to the auth system?' |
| locus_find_pathsA | Find all shortest KG paths between two entities using BFS. Returns each path as a list of hops with a human-readable narrative. Useful for tracing how two people, systems, or concepts are connected. |
| locus_inspectB | Inspect a document's corpus representation: chunk count, word count, top BM25 terms, entities, and internal wikilinks. Useful for debugging indexing quality. |
| locus_top_termsA | Return the corpus-wide top terms by document frequency. Each entry includes the term, how many chunks contain it, and total TF. Useful for understanding what vocabulary dominates the knowledge base. |
| locus_ingest_githubA | Fetch markdown files from a GitHub repository and index them. Fetches the file tree, downloads matching files, and calls locus_index. Requires a GITHUB_TOKEN env var or token param for private repos. |
| locus_expand_queryB | Expand a query using KG alias resolution and first-hop neighbours. If query terms match known entity aliases, their canonical names and related entities are appended to produce a richer query string. Returns original, expanded, added_terms, and entity_matches. |
| locus_multi_retrieveB | Run multiple query variants and fuse results via Reciprocal Rank Fusion. Ideal for query reformulation, typo tolerance, or multi-intent queries. Each query runs through the full six-signal pipeline independently. |
| locus_timelineB | Show a chronological timeline of all KG facts for an entity. Facts are sorted by valid_from date; undated facts appear last. Useful for tracking how knowledge about an entity evolved over time. |
| locus_snapshotA | Archive the entire Locus store to a portable .tar.gz file. The snapshot captures the corpus index, KG, bulletin, entity resolver, and all SQLite databases. Can be restored with locus_restore. |
| locus_restoreB | Restore a Locus store from a snapshot archive. Extracts to store_path (default: .locus-restored). Use overwrite=true to replace an existing store. |
| locus_snapshot_infoA | Inspect a snapshot archive: file list, archive size, uncompressed size. |
| locus_related_docsB | Find documents most similar to a given document using TF-IDF cosine similarity. No embeddings — built entirely on the existing term index. Useful for 'find more like this' workflows and knowledge base navigation. |
| locus_diffA | Preview what would change if a directory were re-indexed now. Returns lists of new, changed, and deleted files without modifying the corpus. Run before locus_sync to understand the impact. |
| locus_annotateC | Attach a label and optional note to a chunk. Labels are arbitrary strings: 'important', 'outdated', 'reviewed', etc. Multiple labels per chunk are supported. |
| locus_get_annotationsC | Return all labels and notes attached to a chunk. |
| locus_chunks_with_labelC | Return all chunk IDs that carry a given annotation label. |
| locus_mark_relevantA | Mark a chunk as relevant for a query. Persists a +0.25 boost that the reranker applies on future retrieve calls for the same query. Use after a successful retrieval to reinforce good results. |
| locus_mark_irrelevantA | Mark a chunk as irrelevant for a query. Persists a -0.40 penalty that the reranker applies on future retrieve calls for the same query. Use to suppress consistently bad results. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| locus_research | Research a topic using the Locus knowledge base. Retrieves relevant context and formats it for analysis. |
| locus_entity_summary | Summarize all KG facts and relevant documents for a specific entity. |
| locus_timeline | Show how knowledge about an entity changed between two dates using the temporal KG. |
| locus_contradiction_analysis | Identify and frame KG contradictions for human resolution. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 47 tools
The descriptions do differentiate most tools, but there are several near-parallel retrieval entry points (locus_retrieve, locus_multi_retrieve, locus_cluster_retrieve, locus_prepare_context, locus_expand_query) and overlapping KG navigation tools (locus_reason, locus_find_paths, locus_kg_traverse, locus_kg_match, locus_query_entity, locus_timeline) whose boundaries require careful reading rather than being obvious. An agent can usually pick correctly from the descriptions, but misselection risk is real at this scale.
Every tool uses the locus_ prefix followed by a snake_case verb or noun phrase, forming a highly predictable pattern across indexing, retrieval, KG, session, and admin families. No camelCase or naming outliers.
47 tools is heavy for a local RAG/knowledge-store server and pushes well past the 25+ threshold. While each tool has a stated role, the surface invites choice paralysis and could be consolidated (e.g. collapsing the retrieve variants and KG query variants into a smaller set with mode flags).
Coverage is broad: indexing, hybrid retrieval, KG construction/query, sessions, snapshots, cluster registry, annotations, cache, and health checks are all present. Minor gaps exist — facts and annotations can be added but there is no explicit tool to retract/update a fact or remove an annotation label — but these are small, workaround-able omissions.