loading…
Search for a command to run...
loading…
Provides a coherent memory layer for LLM agents that models beliefs as nodes in a constraint network to detect and surface semantic contradictions. It uses loca
Provides a coherent memory layer for LLM agents that models beliefs as nodes in a constraint network to detect and surface semantic contradictions. It uses local embeddings and a hybrid geometric-logical energy model to identify conflicting information that requires review.
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.
When you store beliefs, the system:
# Install globally
npm install -g @sem/mcp-server
# Or run via npx
npx @sem/mcp-server
Add to your mcp_servers.json:
{
"mcpServers": {
"sem-memory": {
"command": "npx",
"args": ["@sem/mcp-server"],
"env": {
"SEM_DATA_DIR": "/path/to/your/memory"
}
}
}
}
memory_addAdd a belief to memory.
memory_add({
belief: "The user prefers dark mode",
source: "settings conversation",
confidence: 0.9
})
// Returns: { id, autoLinked, contradictions }
memory_querySearch 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_contradictionsGet all current contradictions.
memory_contradictions()
// Returns pairs of conflicting beliefs
memory_linkExplicitly define a relationship between beliefs.
memory_link({
sourceId: "sem_123",
targetId: "sem_456",
relation: "contradicts" // or: supersedes, elaborates, related, caused, caused_by
})
memory_forgetRemove a belief.
memory_forget({ id: "sem_123" })
memory_statsGet memory health metrics.
memory_stats()
// Returns: { totalBeliefs, totalEdges, stable, needsReview, highTension, energy... }
The system uses a hybrid energy model:
Logical Energy (E_logic)
Geometric Energy (E_geom)
Total Energy: E_total = E_logic + λ * E_geom
High-strain beliefs are flagged as needs_review or high_tension.
By default, beliefs are stored in .sem-data/memory-index.jsonl. Set SEM_DATA_DIR env var to customize.
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)
MIT
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"semantic-mesh-memory-sem-mcp-server": {
"command": "npx",
"args": []
}
}
}