Memoria — Deterministic AI Memory & Code Intelligence MCP
v1.0.2Official Node.js MCP connector for Memoria Cloud (https://memoria.kolivri.com).
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
encode_memory Encode Memory
Store a single memory record in Memoria Cloud (requires MEMORIA_API_KEY; consumes 1 Write API call; non-idempotent: encoding identical text twice creates separate IDs until consolidate is run) and return { id, namespace, salience }. Defaults type to "episodic", salience to 0.5 (items >=0.7 or semantic/core surface in memory://rules), and namespace to MEMORIA_NAMESPACE or "default" while rejecting reserved "org:" prefixes. Use when persisting one architectural decision, bug root cause, or user rule; use batch_encode instead for 2+ memories at once, or handoff_to_agent for cross-wing task handof…
| Parameter | Type | Description |
|---|---|---|
content * | string | Non-empty memory text to persist. |
context | array | Optional [key, value] string pairs (for example [["file", "src/auth.js"]]) targetable by delete_by_context. |
namespace | string | Logical project or workspace namespace (defaults to MEMORIA_NAMESPACE or "default"; never prefix with "org:"). |
salience | number | Importance weight from 0.0 to 1.0 (use >=0.7 for durable team rules). |
type | string | Memory tier classification (core and semantic receive 1.5x/1.25x recall boosts). |
batch_encode Batch Encode Memories
Store multiple memories atomically in one request (requires MEMORIA_API_KEY; consumes max(1, memories.length) Write API calls; non-idempotent) and return { ids, encoded }. Validates every item namespace before writing so any reserved "org:" prefix aborts the entire batch cleanly; items inherit top-level namespace (or MEMORIA_NAMESPACE) and default to type="episodic" and salience=0.5. Use when checkpointing or importing 2+ memories together; use encode_memory instead for a single memory write.
| Parameter | Type | Description |
|---|---|---|
memories * | array | Non-empty array of memory objects to persist atomically. |
namespace | string | Fallback logical namespace applied to batch items that omit namespace. |
recall_memories Recall Memories
Retrieve up to limit (default 20) deterministically ranked memory records for a query (read-only, idempotent; consumes 1 Read API call) and return { results, total_candidates } with per-item { memory, score }. Ranks up to 500 candidates in namespace by lexical/BM25 match, salience, tier boost (core=1.5x, semantic=1.25x), and 30-day freshness; mode biases domain relevance (organizational, research, operational, sales, support, personal) while limit caps item count independently of token_budget. Use when you need individual memory IDs, metadata, or scores (for inspection, feedback, or forget_mem…
| Parameter | Type | Description |
|---|---|---|
query * | string | Keywords or natural-language question to match against stored memories. |
limit | integer | Hard cap on returned { memory, score } items (default 20). |
mode | string | Optional domain retrieval profile override (organizational, research, operational, sales, support, or personal). |
namespace | string | Logical workspace namespace filter (defaults to MEMORIA_NAMESPACE or "default"; never prefix with "org:"). |
token_budget | integer | Advisory token budget hint (~4 chars/token) for sizing downstream context. |
build_context Build Session Context
Assemble a token-budgeted <memory_context> XML/Markdown block from a namespace (read-only, idempotent; consumes 1 Read API call) and return { context, memories_used }. Ranks up to 500 namespace memories deterministically and packs lines greedily up to max(256, token_budget * 4) characters under "## Established Facts" (core/semantic) and "## Recent Context" (episodic/buffer). Use at session start or before planning a task to ground the model in one call; use recall_memories instead when you need raw memory objects and IDs.
| Parameter | Type | Description |
|---|---|---|
query * | string | Active task, feature, or session topic used to rank relevant facts and history. |
mode | string | Optional domain retrieval profile override (organizational, research, operational, sales, support, or personal). |
namespace | string | Logical workspace namespace (defaults to MEMORIA_NAMESPACE or "default"; never prefix with "org:"). |
token_budget | integer | Maximum token budget (~4 characters per token, default 4096) before truncating lower-ranked items. |
forget_memory Forget Memory
Permanently delete one memory and its incident graph edges by ID (destructive, idempotent; consumes 1 Write API call) and return { deleted }. Enforces organization ownership (rejects foreign IDs) and returns { deleted: false } when the ID is already absent. Use when removing a single known memory UUID; use delete_by_context instead to bulk-delete memories by [key, value] metadata tag, or feedback (useful=false) to lower salience without deleting.
| Parameter | Type | Description |
|---|---|---|
id * | string | Exact memory UUID returned by encode_memory or recall_memories. |
delete_by_context Delete Memories by Context
Permanently bulk-delete all memories whose context array contains an exact [key, value] pair (destructive, idempotent; consumes 1 Write API call) and return { deleted_count }. Scopes deletion to namespace (defaulting to MEMORIA_NAMESPACE when omitted locally) and rejects reserved "org:" prefixes. Use to purge memories tied to a deleted file, PR, or feature tag; use forget_memory instead when deleting a single memory by UUID.
| Parameter | Type | Description |
|---|---|---|
key * | string | Exact context tuple key to match (for example "file" or "pr"). |
value * | string | Exact context tuple value to match (for example "src/legacy.js"). |
namespace | string | Optional logical namespace scope (never prefix with "org:"). |
feedback Record Memory Feedback
Adjust a memory salience weight based on recall utility (consumes 1 Write API call; non-idempotent because repeated calls compound the salience delta) and return { updated }. Enforces organization ownership on id; useful=true boosts salience toward 1.0 while useful=false dampens noisy or outdated entries without deleting them. Use after recall_memories to tune future ranking quality; use forget_memory instead for permanent removal, or consolidate to merge duplicate records.
| Parameter | Type | Description |
|---|---|---|
id * | string | Target memory UUID from recall_memories. |
useful * | boolean | True to boost salience when helpful; false to dampen salience when stale or noisy. |
consolidate Consolidate Namespace Memories
Run an idempotent maintenance pass on a workspace namespace to deduplicate redundant records, link superseded state, and promote recurring high-salience episodic memories to Semantic tier (consumes 1 Write API call; non-destructive to unique facts) and return { namespace, consolidated }. Requires Write permission and a logical namespace (never prefixed with "org:"). Use at session wrap-up after multiple encode_memory calls; use feedback instead to rate one memory, or delete_by_context to purge obsolete tags.
| Parameter | Type | Description |
|---|---|---|
namespace * | string | Logical workspace namespace to consolidate (for example "my-project"). |
health Check Memoria Health
Check Memoria Cloud service status, total organization memory count across all namespaces, and rolling 30-day API quota usage (read-only, idempotent; consumes 1 Read API call) and return { status, memory_count, used_calls_30d, api_call_limit }. Takes no parameters; api_call_limit is null on Unlimited plans. Use to verify connectivity and overall organization quota headroom; use stats instead when you need memory counts scoped to one specific project namespace.
stats Get Namespace Statistics
Retrieve the stored memory count for a single logical namespace alongside rolling 30-day organization quota metrics (read-only, idempotent; consumes 1 Read API call) and return { namespace, memory_count, used_calls_30d, api_call_limit }. Rejects reserved "org:" prefixes on namespace. Use when inspecting how many memories exist inside one specific project or wing namespace; use health instead for an organization-wide connectivity and total-memory check, or list_agent_wings for per-wing counts.
| Parameter | Type | Description |
|---|---|---|
namespace * | string | Logical workspace namespace to inspect (for example "my-project" or "wing:qa"). |
search_code Search Indexed Code
Search indexed code symbol definitions, file paths, and reference memories within a namespace (read-only, idempotent; consumes 1 Read API call) and return { results, total_candidates } capped at 20 ranked { memory, score } hits. Requires code memories in namespace (populated via /memoria-sync-code or encode_memory) and rejects reserved "org:" prefixes. Use to discover where functions, classes, or routes live by keyword; use explain_code instead to inspect callers and invariants of a known symbol, or recall_memories for general prose rules.
| Parameter | Type | Description |
|---|---|---|
query * | string | Function, class, route, or file keyword to locate. |
namespace | string | Logical repository or workspace namespace (defaults to MEMORIA_NAMESPACE or "default"). |
path | string | Optional workspace directory hint. |
type | string | Optional definition kind hint (function, class, const, file, or any). |
explain_code Explain Code Symbol
Synthesize definitions, caller/callee references, related tests, and architectural notes for a specific code symbol in a namespace (read-only, idempotent; consumes 1 Read API call) and return { results, total_candidates } (up to 20 ranked matches). Pass a non-empty identifier via target or its equivalent alias symbol (throws if both are omitted). Use before editing a known function, class, or module to check its blast radius and invariants; use search_code instead when you only have keywords and need to find symbol names first.
| Parameter | Type | Description |
|---|---|---|
depth | string | Optional traversal depth hint (shallow, standard, or deep). |
namespace | string | Logical repository or workspace namespace (defaults to MEMORIA_NAMESPACE or "default"). |
path | string | Optional workspace directory hint. |
symbol | string | Equivalent alias for target identifier (provide target or symbol). |
target | string | Exact function, class, or module identifier to explain (provide target or symbol). |
list_agent_wings List Specialist Agent Wings
List all five built-in specialist multi-agent wings (architect, reviewer, qa, security, ops), their isolated wing:<id> namespaces, and active memory counts (read-only, idempotent; consumes 1 Read API call) and return { wings }. Always returns all five wings even when memory_count is 0. Use to inspect wing responsibilities and queued handoff volume before delegating work; use handoff_to_agent to record a new cross-wing handoff, or stats to inspect a custom project namespace.
| Parameter | Type | Description |
|---|---|---|
namespace | string | Optional logical workspace namespace context (never prefix with "org:"). |
handoff_to_agent Hand Off Context to Specialist Wing
Persist a high-salience (0.9) Semantic handoff memory into a target specialist wing namespace (wing:<target>) (consumes 1 Write API call; non-idempotent: repeated calls create distinct handoff records) and return { id, wing, namespace }. Accepts destination via wing or alias to_wing (defaults to "architect") and sender via from_agent or alias from_wing (defaults to "agent"), attaching files and memory_ids as searchable context tuples. Use when delegating findings and next steps between architect, reviewer, qa, security, or ops agents; use encode_memory instead for general project memories.
| Parameter | Type | Description |
|---|---|---|
summary * | string | Required concise summary of findings, architectural constraints, and current state. |
files | array | Optional file paths attached as ["file", path] context tags. |
from_agent | string | Originating agent or role identifier (preferred; defaults to "agent"). |
from_wing | string | Originating specialist wing (used when from_agent is omitted). |
memory_ids | array | Optional related memory UUIDs attached as ["memory_id", id] context tags. |
namespace | string | Optional logical workspace namespace context. |
task | string | Optional concrete follow-up action appended for the receiving wing. |
to_wing | string | Alias for destination wing used when wing is omitted. |
wing | string | Destination specialist wing (preferred; defaults to "architect" if both wing and to_wing are omitted). |