sapience-mcp

v0.2.1
sapience-mcp Checked 4 days ago Published 1 month ago

Human-like memory and a judgment ledger for AI — an MCP server for Claude Code.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

search_memory

Search the memory system by semantic similarity. Use this at the start of any topic-specific conversation to surface relevant context, prior decisions, and evolved thinking — without being asked. Returns memories ranked by relevance × salience.

ParameterTypeDescription
query *stringNatural language query describing what context you need
namespacestringNamespace to search. Omit for this server's namespace; '*' searches every namespace.
top_kintegerNumber of memories to return (default 6)
typesarrayFilter by memory type. Options: ['episodic', 'feedback', 'project', 'reference', 'semantic', 'user']. Omit to search all.

save_memory

Save a new memory. Use this to record decisions made, insights surfaced, how the user's thinking has evolved, feedback given, or important context from this conversation.

ParameterTypeDescription
content *stringThe memory content — be specific and self-contained
memory_type *stringType of memory. One of: ['episodic', 'feedback', 'project', 'reference', 'semantic', 'user']
namespacestringNamespace to save into. Omit for this server's namespace.
saliencenumberImportance weight 0.0–1.0. High-stakes decisions = 0.9+. Routine context = 0.3–0.5.
sourcestringWhere this came from
topicstringPrimary topic tag (e.g. 'product-launch', 'hiring', 'q3-planning')

get_context_brief

Get a synthesized brief on a topic — what is known, how thinking has evolved, and what open questions remain. Use before deep-diving into any recurring topic like web onboarding tests, the stock portfolio, or an M&A situation.

ParameterTypeDescription
topic *stringThe topic to brief on (e.g. 'web onboarding', 'stock portfolio')
top_kintegerHow many memories to pull for synthesis (default 10)

consolidate

Run the consolidation job: extract semantic patterns from recent episodic memories. Run this at the end of sessions covering important topics. This is what makes the memory system get smarter over time.

ParameterTypeDescription
days_backintegerHow many days of episodic memory to consolidate (default 7)
namespacestringNamespace to consolidate. Omit for this server's namespace; '*' consolidates every namespace.

list_memories

List recent memories, optionally filtered by type.

ParameterTypeDescription
limitinteger
memory_typestringFilter by type. One of: ['episodic', 'feedback', 'project', 'reference', 'semantic', 'user']. Omit for all.
namespacestringNamespace to list. Omit for this server's namespace; '*' lists every namespace.

memory_stats

Return total memory count and breakdown by type.

get_memory

Inspect a single memory by ID: full content plus all metadata (type, topic, salience, timestamps, access history, source). Use before editing or deleting to see exactly what's stored.

ParameterTypeDescription
memory_id *stringMemory ID

edit_memory

Edit a memory in place — fix wrong content, adjust salience, retag topic, or reclassify type. Only the fields you pass change; id, created_at, and access history are preserved. Content changes are re-embedded automatically.

ParameterTypeDescription
memory_id *stringMemory ID to edit
contentstringReplacement content (full text, not a diff)
memory_typestringNew type. One of: ['episodic', 'feedback', 'project', 'reference', 'semantic', 'user']
saliencenumberNew importance weight 0.0–1.0
topicstringNew topic tag

delete_memory

Permanently delete a single memory by ID. Irreversible — inspect it with get_memory first, and confirm with the user before deleting anything they didn't explicitly ask to remove.

ParameterTypeDescription
memory_id *stringMemory ID to delete

export_memories

Export memories to a JSONL file (one memory per line, embeddings excluded). Use for backup before risky operations, or to move memories between machines.

ParameterTypeDescription
memory_typestringExport only this type. One of: ['episodic', 'feedback', 'project', 'reference', 'semantic', 'user']. Omit for all.
namespacestringNamespace to export. Defaults to '*' (every namespace) — exports are backups.
pathstringOutput file path. Defaults to exports/memories-<timestamp>.jsonl in the data dir.

find_duplicate_memories

Report near-duplicate memory pairs by embedding similarity. Report-only: nothing is deleted. Review the pairs, then remove specific losers with delete_memory after confirming with the user — prefer deleting the lower-salience or older duplicate.

ParameterTypeDescription
limitintegerMax pairs to return (default 50)
namespacestringNamespace to scan. Omit for this server's namespace.
thresholdnumberMinimum cosine similarity to flag a pair (default 0.92)

log_assessment

Log a forward-looking assessment to the judgment ledger. Use this whenever making a prediction, recommendation, or forward-looking call. Prefer a numeric 'probability' (0-1) — it enables real calibration (Brier score) over time. Assessments are tracked and later scored against what actually happened.

ParameterTypeDescription
domain *stringAssessment domain (one of the configured LEDGER_DOMAINS)
text *stringThe assessment or prediction, stated clearly
conditionsstringRelevant conditions or context at time of assessment
confidencestringCategorical confidence, used only if 'probability' is omitted (high=0.9, moderate=0.75, low=0.6)
horizonstringExpected resolution timeframe e.g. '2 weeks', '3 months'
logicstringThe reasoning behind this assessment at the time
probabilitynumberForecast probability the call proves right, 0-1 (e.g. 0.7). Preferred over 'confidence'; enables Brier scoring.
source_sessionstringBrief label for where this came from e.g. 'planning session 2025-01-15'

list_pending_assessments

List unresolved assessments from the judgment ledger. Use during weekly review to surface what needs scoring, or at session start to remind of open calls in a domain.

ParameterTypeDescription
domainstringFilter by domain. Omit for all domains.
limitintegerMax results (default 50)

resolve_assessment

Mark an assessment as resolved with its actual outcome and score. score: 1 = right, 0 = partially right, -1 = wrong. Call this as soon as the outcome of a prediction is known.

ParameterTypeDescription
id *stringAssessment ID from log_assessment
outcome *stringWhat actually happened
score *integer1 = right, 0 = partial, -1 = wrong

generate_calibration

Extract calibration patterns from resolved assessments in a domain and write a high-salience feedback memory. Run this after a batch of resolutions in a domain. Requires at least 3 resolved assessments in the domain.

ParameterTypeDescription
domain *stringDomain to generate calibration for

get_bias_map

Generate a structured bias report across all resolved assessments. Shows where judgment is well-calibrated vs. systematically off. Use for quarterly self-calibration review.

ParameterTypeDescription
domainstringFilter to one domain. Omit for full cross-domain map.