Semantic Mesh Memory (SEM) MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
@sem/mcp-server
Coherent Memory for LLM Agents
A memory layer that detects contradictions and surfaces them for review. Unlike append-only logs or RAG retrieval, this system models beliefs as nodes in a constraint network where semantic similarity implies expected agreement.
What it does
When you store beliefs, the system:
Embeds them locally (Xenova/all-MiniLM-L6-v2, no API calls)
Auto-links to similar existing beliefs
Computes strain using hybrid geometric-logical energy
Surfaces contradictions when beliefs conflict
Related MCP server: agent-knowledge
Installation
# Install globally
npm install -g @sem/mcp-server
# Or run via npx
npx @sem/mcp-serverClaude Code / MCP Configuration
Add to your mcp_servers.json:
{
"mcpServers": {
"sem-memory": {
"command": "npx",
"args": ["@sem/mcp-server"],
"env": {
"SEM_DATA_DIR": "/path/to/your/memory"
}
}
}
}Tools
memory_add
Add a belief to memory.
memory_add({
belief: "The user prefers dark mode",
source: "settings conversation",
confidence: 0.9
})
// Returns: { id, autoLinked, contradictions }memory_query
Search for relevant beliefs.
memory_query({ topic: "user preferences", limit: 5 })
// Returns: { beliefs: [...], contradictions: [...] }Each belief includes:
relevance: How relevant to the querystrain: Coherence tension (higher = needs attention)status: 'stable' | 'needs_review' | 'high_tension'
memory_contradictions
Get all current contradictions.
memory_contradictions()
// Returns pairs of conflicting beliefsmemory_link
Explicitly define a relationship between beliefs.
memory_link({
sourceId: "sem_123",
targetId: "sem_456",
relation: "contradicts" // or: supersedes, elaborates, related, caused, caused_by
})memory_forget
Remove a belief.
memory_forget({ id: "sem_123" })memory_stats
Get memory health metrics.
memory_stats()
// Returns: { totalBeliefs, totalEdges, stable, needsReview, highTension, energy... }How Strain Works
The system uses a hybrid energy model:
Logical Energy (E_logic)
Positive constraints: Penalize disagreement between related beliefs
Negative constraints: Penalize co-acceptance of contradicting beliefs
Geometric Energy (E_geom)
Spring energy based on embedding distance vs. rest length
Beliefs that drift apart semantically create tension
Total Energy: E_total = E_logic + λ * E_geom
High-strain beliefs are flagged as needs_review or high_tension.
Data Storage
By default, beliefs are stored in .sem-data/memory-index.jsonl. Set SEM_DATA_DIR env var to customize.
Theory
Based on Thagard & Verbeurgt's "Coherence as Constraint Satisfaction" - coherence is modeled as maximizing satisfaction of positive/negative constraints between elements.
See: Semantic Mesh Memory (paper)
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Long-term memory for AI agents: bitemporal fact ledger, contradiction detection, explainability.
Persistent memory for AI agents. EU-hosted, privacy-first, hybrid recall, contradiction detection.
Evidence-grounded, graph-connected, correctable memory for agents.
One memory for AI agents in Claude Code, Cursor, Codex and ChatGPT that flags conflicting facts.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceSemantic memory for AI agents — local-first MCP server with hybrid search, knowledge graph, contradiction detection, and plan-then-commit consolidation.227 npm4AGPL 3.0
- AlicenseAqualityCmaintenanceLong-term memory for AI agents. Compiles conversations into a structured knowledge base with Claim/Evidence model, source provenance, append-only timeline, and contradiction detection. Multi-path retrieval (Exact + BM25 + Graph + weighted RRF + reranker) — 96.6% R@5 on LongMemEval-S, zero vector dependencies.83MIT
- FlicenseNot gradedqualityAmaintenanceLocal-first memory for AI agents with evidence-backed recall, deterministic trust verdicts, self-inspection, and a tamper-evident audit history.3-
- AlicenseNot gradedqualityCmaintenanceA local-first memory control plane for AI agents, providing auditable recall via MCP with provenance and contradiction handling.139 npm2MIT