Memoria — Deterministic AI Memory & Code Intelligence MCP

v1.0.2
io.github.kolivritech/memoria-mcp Checked 1 day ago Published 13 days ago

Official 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…

ParameterTypeDescription
content *stringNon-empty memory text to persist.
contextarrayOptional [key, value] string pairs (for example [["file", "src/auth.js"]]) targetable by delete_by_context.
namespacestringLogical project or workspace namespace (defaults to MEMORIA_NAMESPACE or "default"; never prefix with "org:").
saliencenumberImportance weight from 0.0 to 1.0 (use >=0.7 for durable team rules).
typestringMemory 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.

ParameterTypeDescription
memories *arrayNon-empty array of memory objects to persist atomically.
namespacestringFallback 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…

ParameterTypeDescription
query *stringKeywords or natural-language question to match against stored memories.
limitintegerHard cap on returned { memory, score } items (default 20).
modestringOptional domain retrieval profile override (organizational, research, operational, sales, support, or personal).
namespacestringLogical workspace namespace filter (defaults to MEMORIA_NAMESPACE or "default"; never prefix with "org:").
token_budgetintegerAdvisory 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.

ParameterTypeDescription
query *stringActive task, feature, or session topic used to rank relevant facts and history.
modestringOptional domain retrieval profile override (organizational, research, operational, sales, support, or personal).
namespacestringLogical workspace namespace (defaults to MEMORIA_NAMESPACE or "default"; never prefix with "org:").
token_budgetintegerMaximum 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.

ParameterTypeDescription
id *stringExact 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.

ParameterTypeDescription
key *stringExact context tuple key to match (for example "file" or "pr").
value *stringExact context tuple value to match (for example "src/legacy.js").
namespacestringOptional 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.

ParameterTypeDescription
id *stringTarget memory UUID from recall_memories.
useful *booleanTrue 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.

ParameterTypeDescription
namespace *stringLogical 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.

ParameterTypeDescription
namespace *stringLogical 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.

ParameterTypeDescription
query *stringFunction, class, route, or file keyword to locate.
namespacestringLogical repository or workspace namespace (defaults to MEMORIA_NAMESPACE or "default").
pathstringOptional workspace directory hint.
typestringOptional 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.

ParameterTypeDescription
depthstringOptional traversal depth hint (shallow, standard, or deep).
namespacestringLogical repository or workspace namespace (defaults to MEMORIA_NAMESPACE or "default").
pathstringOptional workspace directory hint.
symbolstringEquivalent alias for target identifier (provide target or symbol).
targetstringExact 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.

ParameterTypeDescription
namespacestringOptional 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.

ParameterTypeDescription
summary *stringRequired concise summary of findings, architectural constraints, and current state.
filesarrayOptional file paths attached as ["file", path] context tags.
from_agentstringOriginating agent or role identifier (preferred; defaults to "agent").
from_wingstringOriginating specialist wing (used when from_agent is omitted).
memory_idsarrayOptional related memory UUIDs attached as ["memory_id", id] context tags.
namespacestringOptional logical workspace namespace context.
taskstringOptional concrete follow-up action appended for the receiving wing.
to_wingstringAlias for destination wing used when wing is omitted.
wingstringDestination specialist wing (preferred; defaults to "architect" if both wing and to_wing are omitted).