set_contextLABSCO 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
Follow the published steps — ollama pull nomic-embed-text
USE CASES
Asking what the graph knows about something
Summarise the topic and get an answer with its source entities and observations attached.
Keeping several projects from bleeding into each other
Set the project context so searches prefer that project's subtree, then clear it when you switch.
Working out how two things are connected
Find the shortest path between them, or walk outward a couple of hops.
Loading a lot of memory at once
Send entities, observations and relations as one atomic batch rather than a call each.
Tidying a graph that has grown duplicates
Read the merge suggestions and the review queue, then merge the ones you agree with.
Catching memory that disagrees with itself
Run contradiction detection over the observations rather than discovering it in an answer.
33 tools
Listed in project docs. Your client may show a different list.
get_contextclear_contextcreate_entityget_entityupdate_entitydelete_entitycreate_observationupdate_observationdelete_observationrank_observationsdetect_contradictionscreate_relationdelete_relationfind_relationssearch_entitieslist_entitiessearch_subgraphget_subgraph_by_idssummarizetraverse_graphfind_shortest_pathbulk_updatesuggest_mergesmerge_entitiesdream_state_statusget_maintenance_reportsapply_maintenance_reviewget_graph_statsget_versionget_current_timescan_projectscan_project_statusBEFORE YOU INSTALL
What to know first
Tools you get
33 tools named in the project's documentation.
Requires
- Ruby 3.4.1+
- Rails 8.1.2+
Where it runs
All 6 documented setups run the server on your machine.
INSTALLATION
Connect your client
Server setup
Install Ollama (https://ollama.com) then pull the default embedding model
ollama pull nomic-embed-textClone and enter the project
git clone https://github.com/steveoro/graph_mem.git
cd graph_memCopy example config and set your master key
cp .env.example .envStart the stack (MariaDB 11.8 + Rails in production mode)
docker compose up -dSeed canonical entity types
docker compose exec app bin/rails db:seedVerify Ollama connectivity
docker compose exec app bin/rails embeddings:checkBackfill embeddings
docker compose exec app bin/rails embeddings:backfillMCP Clients
Cursor — HTTP, Devin
{
"mcpServers": {
"graph_mem": {
"url": "http://localhost:3030/mcp",
"headers": {
"X-MCP-Client": "Agent-1"
}
}
}
}Antigravity
{
"mcpServers": {
"graph_mem": {
"serverUrl": "http://localhost:3030/mcp",
"headers": {
"X-MCP-Client": "Agent-1"
}
}
}
}Cursor — stdio
{
"mcpServers": {
"graph_mem": {
"command": "/bin/bash",
"args": [
"<YOUR_PATH_TO_GRAPH_MEM>/bin/mcp_graph_mem_runner.sh"
],
"env": {
"RAILS_ENV": "development"
}
}
}
}Cursor — Docker
{
"mcpServers": {
"graph_mem": {
"command": "/bin/bash",
"args": [
"<YOUR_PATH_TO_GRAPH_MEM>/bin/docker-mcp"
]
}
}
}Windsurf
{
"mcpServers": {
"graph_mem": {
"serverUrl": "http://localhost:3030/mcp/sse"
}
}
}