Labsco
MCP SERVER

GraphMem

by steveoro

A knowledge graph as memory: entities, observations and relations, with hybrid search, multi-hop traversal and a background job that merges duplicates while you are idle.

Agent Memory
Summary
It cleans up after itself, and asks before the ambiguous merges.

Graph memory degrades into near-duplicate entities faster than anything else. A background compaction job walks the graph merging what is clearly the same thing and queuing the rest for review, and it yields to live tool traffic rather than blocking it. Alongside that, contradiction detection tells you when two observations disagree — which is the failure mode that quietly poisons a memory store.

What it is

A self-hosted Rails server storing memory as a graph. Entities carry observations and are linked by typed relations; search combines text and vector similarity; and setting a project context makes searches prefer what belongs to that project without hiding the rest.

What you get
  • create_entity, get_entity, update_entity and delete_entity, with a semantic duplicate check on creation and entity types canonicalised automatically
  • create_observation, update_observation and delete_observation, plus rank_observations and detect_contradictions
  • create_relation, delete_relation and find_relations for single-hop links
  • search_entities and search_subgraph — text and vector results fused, with the active project boosted
  • summarize, which answers a question from the graph with the source entities and observations attached
  • traverse_graph and find_shortest_path for bounded multi-hop walks between entities
  • set_context, get_context and clear_context to scope everything to one project
  • bulk_update — many creations in one atomic transaction that rolls back entirely on error
  • suggest_merges and merge_entities for cleaning up duplicates, with dream_state_status and get_maintenance_reports covering the background compaction and its review queue
  • get_graph_stats, list_entities, get_subgraph_by_ids, scan_project and scan_project_status
Requirements

Your own deployment: Ruby and Rails, and MariaDB 11.8 or newer because the vector search uses its native VECTOR support. Embeddings come from a local Ollama instance. A Docker Compose stack brings up the database and the app together. Clients connect over Streamable HTTP, with the legacy SSE endpoint and a stdio transport also available.

Setup effort

One command — docker compose up -d