j5ed-knowledge-graph
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@j5ed-knowledge-graphsearch for entities about machine learning"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
j5ed-knowledge-graph
A knowledge graph memory server for the Model Context Protocol (MCP). Gives AI assistants persistent, structured memory across sessions using a simple entity-relation-observation graph.
Forked from the official @modelcontextprotocol/server-memory and significantly enhanced with SQLite storage, multi-agent isolation, tiered search, index navigation, wiki-mode history tracking, and three transport modes.
What's different from upstream
Feature | Upstream | j5ed |
Storage | NDJSON flat file | SQLite with WAL mode, FTS5 search, foreign keys |
| Returns full graph every time | Returns lightweight index stubs by default; |
| Flat substring match | Tokenized multi-word queries, tiered results by match count, field-priority ranking, per-tier caps |
| Returns relations between opened nodes only | Also returns inbound relations to index entities (table-of-contents navigation) |
Deletes | Hard delete — data destroyed | Soft delete — observations/relations superseded, history preserved |
Multi-agent | None | Tenant isolation via provenance columns — agents only see their own entities |
Multi-user | None | Two-dimensional isolation with |
Auth | None | Bearer token authentication for HTTP/SSE transports |
Read grants | None | Cross-agent read visibility via |
Write safety | None | SQLite transactions — atomic writes, no lost data under concurrency |
History | None | Full mutation timeline per entity — who changed what, when, why |
Transports | stdio only | stdio, SSE, and Streamable HTTP |
Param handling | Strict | Gracefully handles double-serialized JSON from flaky clients |
Related MCP server: Knowledge Master
Installation
npm install j5ed-knowledge-graphOr run directly:
npx j5ed-knowledge-graphMCP Configuration
stdio (local, default)
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "j5ed-knowledge-graph"],
"env": {
"DB_PATH": "/path/to/memory.db"
}
}
}
}Streamable HTTP (network)
npx j5ed-knowledge-graph --http --port 3100{
"mcpServers": {
"memory": {
"url": "http://localhost:3100/mcp"
}
}
}SSE (legacy network)
npx j5ed-knowledge-graph --sse --port 3100Environment Variables
Variable | Default | Description |
|
| Path to the SQLite database file |
|
| Legacy NDJSON file path (used by migration script only) |
|
| Agent identity used for stdio connections and when no auth header is provided |
| (empty) | Comma-separated |
| (empty) | Comma-separated |
Multi-Agent Setup
When multiple agents share a graph, each agent's writes are tagged with provenance and reads are filtered to show only entities owned by (or granted to) that agent.
Example: two agents with cross-read access
AGENT_CREDENTIALS="assistant:token-abc,researcher:token-xyz" \
AGENT_READ_GRANTS="assistant:researcher" \
npx j5ed-knowledge-graph --http --port 3100assistantauthenticates withBearer token-abc, sees its own entities +researcher'sresearcherauthenticates withBearer token-xyz, sees only its own entitiesWrites are always scoped — agents can only delete what they authored
Tools
Core Tools
Tool | Description |
| Create new entities with name, type, and observations |
| Create directed relations between entities |
| Append observations to existing entities |
| Soft-delete entities — all observations/relations superseded, history preserved |
| Soft-delete specific observations — gone from live view, preserved in history |
| Soft-delete specific relations |
| Returns index stubs by default; |
| Tiered search across entity names, types, and observations |
| Retrieve full entities by name, with index navigation |
Wiki-Mode Tools
Tool | Description |
| Full mutation timeline for an entity — all observations ever written, ordered chronologically |
| Show observations you wrote that another agent changed, with rationale |
| Replace an observation with new content, preserving the version chain with rationale |
| Add a comment to an observation without modifying it |
| List all comments on an observation |
Always Supersede, Never Delete
All delete operations are soft deletes. When you delete an observation, it gets a superseded_at timestamp and disappears from live queries — but it remains in the database for full history tracking.
The supersede tool goes further: it creates a replacement observation linked to the original via previous_version_id, forming a version chain. Use entity_history to walk the full timeline.
This design exists because the graph is shared across agents. If agent A deletes agent B's observation, there should be an audit trail — not silent data loss.
Index Navigation Pattern
The graph supports an index-first navigation pattern for large knowledge bases:
read_graph()— returns lightweight stubs for index entities (name, type, summary)Pick relevant index —
open_nodes(["MY_INDEX"])See inbound relations — entities with
indexed_inrelations to the index are its table of contentsDrill into specifics —
open_nodes(["SPECIFIC_ENTITY"])
Index entities are detected by entityType containing "index" (case-insensitive) or entity name ending with _INDEX.
Search Behavior
Multi-word queries are tokenized. Results are grouped into tiers by how many tokens matched:
Tier 1: entities matching any 1 token (broadest)
Tier N: entities matching all N tokens (most specific)
Within each tier, entities are ranked by field priority: index entities first, then name matches (+30), type matches (+20), observation matches (+10). Per-tier caps prevent noise.
Results are returned as lightweight stubs (name, type, matchedIn fields, optional snippet). Use open_nodes() to get full observations.
Storage
SQLite database with WAL mode for concurrent read safety. Schema includes:
entities — immutable rows with unique name constraint
observations — versioned facts with soft-delete via supersession
relations — directed edges with soft-delete, partial unique index on live rows
comments — append-only annotations on observations
observations_fts — FTS5 virtual table for full-text search, auto-synced via triggers
Migrating from NDJSON
If you're upgrading from a previous version that used NDJSON storage:
MEMORY_FILE_PATH=/path/to/memory.json DB_PATH=/path/to/memory.db npm run migrateThe migration script extracts provenance tags (authored_by:, authored_at:, user_id:) from observation strings into proper database columns. The original NDJSON file is not modified.
Docker
docker build -t j5ed-knowledge-graph .
docker run -i -v graph-data:/app/dist --rm j5ed-knowledge-graphDevelopment
git clone https://github.com/arktechnwa/j5ed-knowledge-graph.git
cd j5ed-knowledge-graph
npm install
npm run build
npm test # 8 suites, 58 tests
npm run dev # stdio mode with ts-nodeLicense
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent, portable memory for AI assistants — your private memory graph, from any MCP client.
- memnodeOAuthdev.memnode
Persistent, inspectable memory for AI agents with lineage, correction, and a hosted MCP endpoint.
An MCP memory server. One memory your agents share — across models, devices and apps.
- ContextaOAuthcc.contexta
Persistent memory and knowledge graph for AI assistants — keyword + vector + graph search.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceMCP server that gives AI agents and teams persistent, shared memory using a knowledge graph with vector embeddings, automatic consolidation of related facts, and hybrid search.3-
- AlicenseAqualityCmaintenanceA local knowledge graph MCP server that provides AI agents with permanent, structured memory about codebases, enabling semantic search, blast radius analysis, and convention enforcement.82MIT
- AlicenseNot gradedqualityAmaintenanceA universal MCP server providing persistent, structured memory through a knowledge graph with graph storage, semantic vector search, and multi-hop traversal for AI agents and IDEs.1MIT
- FlicenseAqualityDmaintenanceA lightweight MCP server that provides persistent knowledge graph storage for AI assistants, enabling memory across sessions through entity-relationship storage with JSON file persistence.101-