mcp-knowledge-graph 1.0.3 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,163 +1,226 @@
1
- # `mcp-knowledge-graph`
1
+ # MCP Knowledge Graph
2
2
 
3
- > Knowledge Graph Memory Server
3
+ **Persistent memory for AI models through a local knowledge graph.**
4
4
 
5
- An improved implementation of persistent memory using a local knowledge graph with a customizable `--memory-path`.
5
+ Store and retrieve information across conversations using entities, relations, and observations. Works with Claude Code/Desktop and any MCP-compatible AI platform.
6
6
 
7
- This lets AI models remember information about the user across chats. It works with any AI model that supports the Model Context Protocol (MCP) or function calling capabilities.
7
+ ## Why ".aim" and "aim_" prefixes?
8
8
 
9
- > [!NOTE]
10
- > This is a fork of the original [Memory Server](https://github.com/modelcontextprotocol/servers/tree/main/src/memory) and is intended to not use the ephemeral memory npx installation method.
9
+ AIM stands for **AI Memory** - the core concept of this knowledge graph system. The three AIM elements provide clear organization and safety:
11
10
 
12
- ## Server Name
11
+ - **`.aim` directories**: Keep AI memory files organized and easily identifiable
12
+ - **`aim_` tool prefixes**: Group related memory functions together in multi-tool setups
13
+ - **`_aim` safety markers**: Each memory file starts with `{"type":"_aim","source":"mcp-knowledge-graph"}` to prevent accidental overwrites of unrelated JSONL files
13
14
 
14
- ```txt
15
- mcp-knowledge-graph
16
- ```
15
+ This consistent AIM naming makes it obvious which directories, tools, and files belong to our AI memory system.
16
+
17
+ ## CRITICAL: Understanding `.aim` dir vs `_aim` file marker
18
+
19
+ **Two different things with similar names:**
20
+
21
+ - `.aim` = **Project-local directory name** (MUST be named exactly `.aim` for project detection to work)
22
+ - `_aim` = **File safety marker** (appears inside JSONL files: `{"type":"_aim","source":"mcp-knowledge-graph"}`)
23
+
24
+ **For project-local storage:**
25
+
26
+ - Directory MUST be named `.aim` in your project root
27
+ - Example: `my-project/.aim/memory.jsonl`
28
+ - The system specifically looks for this exact name
29
+
30
+ **For global storage (--memory-path):**
31
+
32
+ - Can be ANY directory you want
33
+ - Examples: `~/yourusername/.aim/`, `~/memories/`, `~/Dropbox/ai-memory/`, `~/Documents/ai-data/`
34
+ - Complete flexibility - choose whatever location works for you
35
+
36
+ ## Storage Logic
17
37
 
18
- ![screen-of-server-name](https://raw.githubusercontent.com/shaneholloman/mcp-knowledge-graph/main/img/server-name.png)
38
+ **File Location Priority:**
19
39
 
20
- ![read-function](https://raw.githubusercontent.com/shaneholloman/mcp-knowledge-graph/main/img/read-function.png)
40
+ 1. **Project with `.aim`** - Uses `.aim/memory.jsonl` (project-local)
41
+ 2. **No project/no .aim** - Uses configured global directory
42
+ 3. **Contexts** - Adds suffix: `memory-work.jsonl`, `memory-personal.jsonl`
21
43
 
22
- ## Core Concepts
44
+ **Safety System:**
23
45
 
24
- ### Entities
46
+ - Every memory file starts with `{"type":"_aim","source":"mcp-knowledge-graph"}`
47
+ - System refuses to write to files without this marker
48
+ - Prevents accidental overwrite of unrelated JSONL files
25
49
 
26
- Entities are the primary nodes in the knowledge graph. Each entity has:
50
+ ## Master Database Concept
27
51
 
28
- - A unique name (identifier)
29
- - An entity type (e.g., "person", "organization", "event")
30
- - A list of observations
52
+ **The master database is your primary memory store** - used by default when no specific database is requested. It's always named `default` in listings and stored as `memory.jsonl`.
31
53
 
32
- Example:
54
+ - **Default Behavior**: All memory operations use the master database unless you specify a different one
55
+ - **Always Available**: Exists in both project-local and global locations
56
+ - **Primary Storage**: Your main knowledge graph that persists across all conversations
57
+ - **Named Databases**: Optional additional databases (`work`, `personal`, `health`) for organizing specific topics
58
+
59
+ ## Key Features
60
+
61
+ - **Master Database**: Primary memory store used by default for all operations
62
+ - **Multiple Databases**: Optional named databases for organizing memories by topic
63
+ - **Project Detection**: Automatic project-local memory using `.aim` directories
64
+ - **Location Override**: Force operations to use project or global storage
65
+ - **Safe Operations**: Built-in protection against overwriting unrelated files
66
+ - **Database Discovery**: List all available databases in both locations
67
+
68
+ ## Quick Start
69
+
70
+ ### Global Memory (Recommended)
71
+
72
+ Add to your `claude_desktop_config.json` or `.claude.json`:
33
73
 
34
74
  ```json
35
75
  {
36
- "name": "John_Smith",
37
- "entityType": "person",
38
- "observations": ["Speaks fluent Spanish"]
76
+ "mcpServers": {
77
+ "memory": {
78
+ "command": "npx",
79
+ "args": [
80
+ "-y",
81
+ "mcp-knowledge-graph",
82
+ "--memory-path",
83
+ "/Users/yourusername/.aim/"
84
+ ]
85
+ }
86
+ }
39
87
  }
40
88
  ```
41
89
 
42
- ### Relations
90
+ This creates memory files in your specified directory:
91
+
92
+ - `memory.jsonl` - **Master Database** (default for all operations)
93
+ - `memory-work.jsonl` - Work database
94
+ - `memory-personal.jsonl` - Personal database
95
+ - etc.
96
+
97
+ ### Project-Local Memory
98
+
99
+ In any project, create a `.aim` directory:
100
+
101
+ ```bash
102
+ mkdir .aim
103
+ ```
104
+
105
+ Now memory tools automatically use `.aim/memory.jsonl` (project-local **master database**) instead of global storage when run from this project.
43
106
 
44
- Relations define directed connections between entities. They are always stored in active voice and describe how entities interact or relate to each other.
107
+ ## How AI Uses Databases
45
108
 
46
- Example:
109
+ Once configured, AI models use the **master database by default** or can specify named databases with a `context` parameter. New databases are created automatically - no setup required:
47
110
 
48
111
  ```json
49
- {
50
- "from": "John_Smith",
51
- "to": "ExampleCorp",
52
- "relationType": "works_at"
53
- }
112
+ // Master Database (default - no context needed)
113
+ aim_create_entities({
114
+ entities: [{
115
+ name: "John_Doe",
116
+ entityType: "person",
117
+ observations: ["Met at conference"]
118
+ }]
119
+ })
120
+
121
+ // Work database
122
+ aim_create_entities({
123
+ context: "work",
124
+ entities: [{
125
+ name: "Q4_Project",
126
+ entityType: "project",
127
+ observations: ["Due December 2024"]
128
+ }]
129
+ })
130
+
131
+ // Personal database
132
+ aim_create_entities({
133
+ context: "personal",
134
+ entities: [{
135
+ name: "Mom",
136
+ entityType: "person",
137
+ observations: ["Birthday March 15th"]
138
+ }]
139
+ })
140
+
141
+ // Master database in specific location
142
+ aim_create_entities({
143
+ location: "global",
144
+ entities: [{
145
+ name: "Important_Info",
146
+ entityType: "reference",
147
+ observations: ["Stored in global master database"]
148
+ }]
149
+ })
54
150
  ```
55
151
 
56
- ### Observations
152
+ ## File Organization
57
153
 
58
- Observations are discrete pieces of information about an entity. They are:
154
+ **Global Setup:**
59
155
 
60
- - Stored as strings
61
- - Attached to specific entities
62
- - Can be added or removed independently
63
- - Should be atomic (one fact per observation)
156
+ ```tree
157
+ /Users/yourusername/.aim/
158
+ ├── memory.jsonl # Master Database (default)
159
+ ├── memory-work.jsonl # Work database
160
+ ├── memory-personal.jsonl # Personal database
161
+ └── memory-health.jsonl # Health database
162
+ ```
64
163
 
65
- Example:
164
+ **Project Setup:**
165
+
166
+ ```tree
167
+ my-project/
168
+ ├── .aim/
169
+ │ ├── memory.jsonl # Project Master Database (default)
170
+ │ └── memory-work.jsonl # Project Work database
171
+ └── src/
172
+ ```
173
+
174
+ ## Available Tools
175
+
176
+ - `aim_create_entities` - Add new people, projects, events
177
+ - `aim_create_relations` - Link entities together
178
+ - `aim_add_observations` - Add facts to existing entities
179
+ - `aim_search_nodes` - Find information by keyword
180
+ - `aim_read_graph` - View entire memory
181
+ - `aim_open_nodes` - Retrieve specific entities by name
182
+ - `aim_list_databases` - Show all available databases and current location
183
+ - `aim_delete_entities` - Remove entities
184
+ - `aim_delete_observations` - Remove specific facts
185
+ - `aim_delete_relations` - Remove connections
186
+
187
+ ### Parameters
188
+
189
+ - `context` (optional) - Specify named database (`work`, `personal`, etc.). Defaults to **master database**
190
+ - `location` (optional) - Force `project` or `global` storage location. Defaults to auto-detection
191
+
192
+ ## Database Discovery
193
+
194
+ Use `aim_list_databases` to see all available databases:
66
195
 
67
196
  ```json
68
197
  {
69
- "entityName": "John_Smith",
70
- "observations": [
71
- "Speaks fluent Spanish",
72
- "Graduated in 2019",
73
- "Prefers morning meetings"
74
- ]
198
+ "project_databases": [
199
+ "default", // Master Database (project-local)
200
+ "project-work" // Named database
201
+ ],
202
+ "global_databases": [
203
+ "default", // Master Database (global)
204
+ "work",
205
+ "personal",
206
+ "health"
207
+ ],
208
+ "current_location": "project (.aim directory detected)"
75
209
  }
76
210
  ```
77
211
 
78
- ## API
79
-
80
- ### Tools
81
-
82
- - **create_entities**
83
- - Create multiple new entities in the knowledge graph
84
- - Input: `entities` (array of objects)
85
- - Each object contains:
86
- - `name` (string): Entity identifier
87
- - `entityType` (string): Type classification
88
- - `observations` (string[]): Associated observations
89
- - Ignores entities with existing names
90
-
91
- - **create_relations**
92
- - Create multiple new relations between entities
93
- - Input: `relations` (array of objects)
94
- - Each object contains:
95
- - `from` (string): Source entity name
96
- - `to` (string): Target entity name
97
- - `relationType` (string): Relationship type in active voice
98
- - Skips duplicate relations
99
-
100
- - **add_observations**
101
- - Add new observations to existing entities
102
- - Input: `observations` (array of objects)
103
- - Each object contains:
104
- - `entityName` (string): Target entity
105
- - `contents` (string[]): New observations to add
106
- - Returns added observations per entity
107
- - Fails if entity doesn't exist
108
-
109
- - **delete_entities**
110
- - Remove entities and their relations
111
- - Input: `entityNames` (string[])
112
- - Cascading deletion of associated relations
113
- - Silent operation if entity doesn't exist
114
-
115
- - **delete_observations**
116
- - Remove specific observations from entities
117
- - Input: `deletions` (array of objects)
118
- - Each object contains:
119
- - `entityName` (string): Target entity
120
- - `observations` (string[]): Observations to remove
121
- - Silent operation if observation doesn't exist
122
-
123
- - **delete_relations**
124
- - Remove specific relations from the graph
125
- - Input: `relations` (array of objects)
126
- - Each object contains:
127
- - `from` (string): Source entity name
128
- - `to` (string): Target entity name
129
- - `relationType` (string): Relationship type
130
- - Silent operation if relation doesn't exist
131
-
132
- - **read_graph**
133
- - Read the entire knowledge graph
134
- - No input required
135
- - Returns complete graph structure with all entities and relations
136
-
137
- - **search_nodes**
138
- - Search for nodes based on query
139
- - Input: `query` (string)
140
- - Searches across:
141
- - Entity names
142
- - Entity types
143
- - Observation content
144
- - Returns matching entities and their relations
145
-
146
- - **open_nodes**
147
- - Retrieve specific nodes by name
148
- - Input: `names` (string[])
149
- - Returns:
150
- - Requested entities
151
- - Relations between requested entities
152
- - Silently skips non-existent nodes
153
-
154
- ## Usage with MCP-Compatible Platforms
155
-
156
- This server can be used with any AI platform that supports the Model Context Protocol (MCP) or function calling capabilities, including Claude, GPT, Llama, and others.
157
-
158
- ### Setup with Claude Desktop
159
-
160
- Add this to your claude_desktop_config.json:
212
+ **Key Points:**
213
+
214
+ - **"default"** = Master Database in both locations
215
+ - **Current location** shows whether you're using project or global storage
216
+ - **Master database exists everywhere** - it's your primary memory store
217
+ - **Named databases** are optional additions for specific topics
218
+
219
+ ## Configuration Examples
220
+
221
+ **Important:** Always specify `--memory-path` to control where your memory files are stored.
222
+
223
+ **Home directory:**
161
224
 
162
225
  ```json
163
226
  {
@@ -168,31 +231,32 @@ Add this to your claude_desktop_config.json:
168
231
  "-y",
169
232
  "mcp-knowledge-graph",
170
233
  "--memory-path",
171
- "/Users/shaneholloman/Dropbox/shane/db/memory.jsonl"
172
- ],
173
- "autoapprove": [
174
- "create_entities",
175
- "create_relations",
176
- "add_observations",
177
- "delete_entities",
178
- "delete_observations",
179
- "delete_relations",
180
- "read_graph",
181
- "search_nodes",
182
- "open_nodes"
234
+ "/Users/yourusername/.aim"
183
235
  ]
184
- },
236
+ }
185
237
  }
186
238
  }
187
239
  ```
188
240
 
189
- ### Setup with Other AI Platforms
190
-
191
- Any AI platform that supports function calling or the MCP standard can connect to this server. The specific configuration will depend on the platform, but the server exposes standard tools through the MCP interface.
241
+ **Custom location (e.g., Dropbox):**
192
242
 
193
- ### Custom Memory Path
243
+ ```json
244
+ {
245
+ "mcpServers": {
246
+ "memory": {
247
+ "command": "npx",
248
+ "args": [
249
+ "-y",
250
+ "mcp-knowledge-graph",
251
+ "--memory-path",
252
+ "/Users/yourusername/Dropbox/.aim"
253
+ ]
254
+ }
255
+ }
256
+ }
257
+ ```
194
258
 
195
- You can specify a custom path for the memory file:
259
+ **Auto-approve all operations:**
196
260
 
197
261
  ```json
198
262
  {
@@ -203,69 +267,49 @@ You can specify a custom path for the memory file:
203
267
  "-y",
204
268
  "mcp-knowledge-graph",
205
269
  "--memory-path",
206
- "/Users/shaneholloman/Dropbox/shane/db/memory.jsonl"
270
+ "/Users/yourusername/.aim"
207
271
  ],
208
272
  "autoapprove": [
209
- "create_entities",
210
- "create_relations",
211
- "add_observations",
212
- "delete_entities",
213
- "delete_observations",
214
- "delete_relations",
215
- "read_graph",
216
- "search_nodes",
217
- "open_nodes"
273
+ "aim_create_entities",
274
+ "aim_create_relations",
275
+ "aim_add_observations",
276
+ "aim_search_nodes",
277
+ "aim_read_graph",
278
+ "aim_open_nodes",
279
+ "aim_list_databases"
218
280
  ]
219
- },
281
+ }
220
282
  }
221
283
  }
222
284
  ```
223
285
 
224
- If no path is specified, it will default to memory.jsonl in the server's installation directory.
225
-
226
- ### System Prompt
286
+ ## Troubleshooting
227
287
 
228
- The prompt for utilizing memory depends on the use case and the AI model you're using. Changing the prompt will help the model determine the frequency and types of memories created.
288
+ **"File does not contain required _aim safety marker" error:**
229
289
 
230
- Here is an example prompt for chat personalization that can be adapted for any AI model. For Claude users, you could use this prompt in the "Custom Instructions" field of a [Claude.ai Project](https://www.anthropic.com/news/projects). For other models, adapt it to their respective instruction formats.
290
+ - The file may not belong to this system
291
+ - Manual JSONL files need `{"type":"_aim","source":"mcp-knowledge-graph"}` as first line
292
+ - If you created the file manually, add the `_aim` marker or delete and let the system recreate it
231
293
 
232
- ```txt
233
- Follow these steps for each interaction:
294
+ **Memories going to unexpected locations:**
234
295
 
235
- 1. User Identification:
236
- - You should assume that you are interacting with default_user
237
- - If you have not identified default_user, proactively try to do so.
238
-
239
- 2. Memory Retrieval:
240
- - Always begin your chat by saying only "Remembering..." and retrieve all relevant information from your knowledge graph
241
- - Always refer to your knowledge graph as your "memory"
242
-
243
- 3. Memory Gathering:
244
- - While conversing with the user, be attentive to any new information that falls into these categories:
245
- a) Basic Identity (age, gender, location, job title, education level, etc.)
246
- b) Behaviors (interests, habits, etc.)
247
- c) Preferences (communication style, preferred language, etc.)
248
- d) Goals (goals, targets, aspirations, etc.)
249
- e) Relationships (personal and professional relationships up to 3 degrees of separation)
250
-
251
- 4. Memory Update:
252
- - If any new information was gathered during the interaction, update your memory as follows:
253
- a) Create entities for recurring organizations, people, and significant events
254
- b) Connect them to the current entities using relations
255
- c) Store facts about them as observations
256
- ```
296
+ - Check if you're in a project directory with `.aim` folder (uses project-local storage)
297
+ - Otherwise uses the configured global `--memory-path` directory
298
+ - Use `aim_list_databases` to see all available databases and current location
299
+ - Use `ls .aim/` or `ls /Users/yourusername/.aim/` to see your memory files
257
300
 
258
- ## Integration with Other AI Models
301
+ **Too many similar databases:**
259
302
 
260
- This server implements the Model Context Protocol (MCP) standard, making it compatible with any AI model that supports function calling. The knowledge graph structure and API are model-agnostic, allowing for flexible integration with various AI platforms.
303
+ - AI models try to use consistent names, but may create variations
304
+ - Manually delete unwanted database files if needed
305
+ - Encourage AI to use simple, consistent database names
306
+ - **Remember**: Master database is always available as the default - named databases are optional
261
307
 
262
- To integrate with other models:
308
+ ## Requirements
263
309
 
264
- 1. Configure the model to access the MCP server
265
- 2. Ensure the model can make function calls to the exposed tools
266
- 3. Adapt the system prompt to the specific model's instruction format
267
- 4. Use the same knowledge graph operations regardless of the model
310
+ - Node.js 18+
311
+ - MCP-compatible AI platform
268
312
 
269
313
  ## License
270
314
 
271
- This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
315
+ MIT
package/dist/index.js CHANGED
@@ -3,10 +3,16 @@ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
4
  import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
5
5
  import { promises as fs } from 'fs';
6
+ import { existsSync } from 'fs';
6
7
  import path from 'path';
7
8
  import { fileURLToPath } from 'url';
9
+ import { createRequire } from 'module';
8
10
  import minimist from 'minimist';
9
11
  import { isAbsolute } from 'path';
12
+ // Read version from package.json - single source of truth
13
+ // Path is '../package.json' because compiled code runs from dist/
14
+ const require = createRequire(import.meta.url);
15
+ const pkg = require('../package.json');
10
16
  // Parse args and handle paths safely
11
17
  const argv = minimist(process.argv.slice(2));
12
18
  let memoryPath = argv['memory-path'];
@@ -14,17 +20,96 @@ let memoryPath = argv['memory-path'];
14
20
  if (memoryPath && !isAbsolute(memoryPath)) {
15
21
  memoryPath = path.resolve(process.cwd(), memoryPath);
16
22
  }
17
- // Define the path to the JSONL file
23
+ // Define the base directory for memory files
18
24
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
19
- // Use the custom path or default to the installation directory
20
- const MEMORY_FILE_PATH = memoryPath || path.join(__dirname, 'memory.jsonl');
25
+ // Handle memory path - could be a file or directory
26
+ let baseMemoryPath;
27
+ if (memoryPath) {
28
+ // If memory-path points to a .jsonl file, use its directory as the base
29
+ if (memoryPath.endsWith('.jsonl')) {
30
+ baseMemoryPath = path.dirname(memoryPath);
31
+ }
32
+ else {
33
+ // Otherwise treat it as a directory
34
+ baseMemoryPath = memoryPath;
35
+ }
36
+ }
37
+ else {
38
+ baseMemoryPath = __dirname;
39
+ }
40
+ // Simple marker to identify our files - prevents writing to unrelated JSONL files
41
+ const FILE_MARKER = {
42
+ type: "_aim",
43
+ source: "mcp-knowledge-graph"
44
+ };
45
+ // Project detection - look for common project markers
46
+ // .aim is checked first: if it exists, that's an explicit signal for project-local storage
47
+ function findProjectRoot(startDir = process.cwd()) {
48
+ const projectMarkers = ['.aim', '.git', 'package.json', 'pyproject.toml', 'Cargo.toml', 'go.mod'];
49
+ let currentDir = startDir;
50
+ const maxDepth = 5;
51
+ for (let i = 0; i < maxDepth; i++) {
52
+ // Check for project markers
53
+ for (const marker of projectMarkers) {
54
+ if (existsSync(path.join(currentDir, marker))) {
55
+ return currentDir;
56
+ }
57
+ }
58
+ // Move up one directory
59
+ const parentDir = path.dirname(currentDir);
60
+ if (parentDir === currentDir) {
61
+ // Reached root directory
62
+ break;
63
+ }
64
+ currentDir = parentDir;
65
+ }
66
+ return null;
67
+ }
68
+ // Function to get memory file path based on context and optional location override
69
+ function getMemoryFilePath(context, location) {
70
+ const filename = context ? `memory-${context}.jsonl` : 'memory.jsonl';
71
+ // If location is explicitly specified, use it
72
+ if (location === 'global') {
73
+ return path.join(baseMemoryPath, filename);
74
+ }
75
+ if (location === 'project') {
76
+ const projectRoot = findProjectRoot();
77
+ if (projectRoot) {
78
+ const aimDir = path.join(projectRoot, '.aim');
79
+ return path.join(aimDir, filename); // Will create .aim if it doesn't exist
80
+ }
81
+ else {
82
+ throw new Error('No project detected - cannot use project location');
83
+ }
84
+ }
85
+ // Auto-detect logic (existing behavior)
86
+ const projectRoot = findProjectRoot();
87
+ if (projectRoot) {
88
+ const aimDir = path.join(projectRoot, '.aim');
89
+ if (existsSync(aimDir)) {
90
+ return path.join(aimDir, filename);
91
+ }
92
+ }
93
+ // Fallback to configured base directory
94
+ return path.join(baseMemoryPath, filename);
95
+ }
21
96
  // The KnowledgeGraphManager class contains all operations to interact with the knowledge graph
22
97
  class KnowledgeGraphManager {
23
- async loadGraph() {
98
+ async loadGraph(context, location) {
99
+ const filePath = getMemoryFilePath(context, location);
24
100
  try {
25
- const data = await fs.readFile(MEMORY_FILE_PATH, "utf-8");
101
+ const data = await fs.readFile(filePath, "utf-8");
26
102
  const lines = data.split("\n").filter(line => line.trim() !== "");
27
- return lines.reduce((graph, line) => {
103
+ if (lines.length === 0) {
104
+ return { entities: [], relations: [] };
105
+ }
106
+ // Check first line for our file marker
107
+ const firstLine = JSON.parse(lines[0]);
108
+ if (firstLine.type !== "_aim" || firstLine.source !== "mcp-knowledge-graph") {
109
+ throw new Error(`File ${filePath} does not contain required _aim safety marker. This file may not belong to the knowledge graph system. Expected first line: {"type":"_aim","source":"mcp-knowledge-graph"}`);
110
+ }
111
+ // Process remaining lines (skip metadata)
112
+ return lines.slice(1).reduce((graph, line) => {
28
113
  const item = JSON.parse(line);
29
114
  if (item.type === "entity")
30
115
  graph.entities.push(item);
@@ -35,36 +120,42 @@ class KnowledgeGraphManager {
35
120
  }
36
121
  catch (error) {
37
122
  if (error instanceof Error && 'code' in error && error.code === "ENOENT") {
123
+ // File doesn't exist - we'll create it with metadata on first save
38
124
  return { entities: [], relations: [] };
39
125
  }
40
126
  throw error;
41
127
  }
42
128
  }
43
- async saveGraph(graph) {
129
+ async saveGraph(graph, context, location) {
130
+ const filePath = getMemoryFilePath(context, location);
131
+ // Write our simple file marker
44
132
  const lines = [
133
+ JSON.stringify(FILE_MARKER),
45
134
  ...graph.entities.map(e => JSON.stringify({ type: "entity", ...e })),
46
135
  ...graph.relations.map(r => JSON.stringify({ type: "relation", ...r })),
47
136
  ];
48
- await fs.writeFile(MEMORY_FILE_PATH, lines.join("\n"));
137
+ // Ensure directory exists
138
+ await fs.mkdir(path.dirname(filePath), { recursive: true });
139
+ await fs.writeFile(filePath, lines.join("\n"));
49
140
  }
50
- async createEntities(entities) {
51
- const graph = await this.loadGraph();
141
+ async createEntities(entities, context, location) {
142
+ const graph = await this.loadGraph(context, location);
52
143
  const newEntities = entities.filter(e => !graph.entities.some(existingEntity => existingEntity.name === e.name));
53
144
  graph.entities.push(...newEntities);
54
- await this.saveGraph(graph);
145
+ await this.saveGraph(graph, context, location);
55
146
  return newEntities;
56
147
  }
57
- async createRelations(relations) {
58
- const graph = await this.loadGraph();
148
+ async createRelations(relations, context, location) {
149
+ const graph = await this.loadGraph(context, location);
59
150
  const newRelations = relations.filter(r => !graph.relations.some(existingRelation => existingRelation.from === r.from &&
60
151
  existingRelation.to === r.to &&
61
152
  existingRelation.relationType === r.relationType));
62
153
  graph.relations.push(...newRelations);
63
- await this.saveGraph(graph);
154
+ await this.saveGraph(graph, context, location);
64
155
  return newRelations;
65
156
  }
66
- async addObservations(observations) {
67
- const graph = await this.loadGraph();
157
+ async addObservations(observations, context, location) {
158
+ const graph = await this.loadGraph(context, location);
68
159
  const results = observations.map(o => {
69
160
  const entity = graph.entities.find(e => e.name === o.entityName);
70
161
  if (!entity) {
@@ -74,38 +165,38 @@ class KnowledgeGraphManager {
74
165
  entity.observations.push(...newObservations);
75
166
  return { entityName: o.entityName, addedObservations: newObservations };
76
167
  });
77
- await this.saveGraph(graph);
168
+ await this.saveGraph(graph, context, location);
78
169
  return results;
79
170
  }
80
- async deleteEntities(entityNames) {
81
- const graph = await this.loadGraph();
171
+ async deleteEntities(entityNames, context, location) {
172
+ const graph = await this.loadGraph(context, location);
82
173
  graph.entities = graph.entities.filter(e => !entityNames.includes(e.name));
83
174
  graph.relations = graph.relations.filter(r => !entityNames.includes(r.from) && !entityNames.includes(r.to));
84
- await this.saveGraph(graph);
175
+ await this.saveGraph(graph, context, location);
85
176
  }
86
- async deleteObservations(deletions) {
87
- const graph = await this.loadGraph();
177
+ async deleteObservations(deletions, context, location) {
178
+ const graph = await this.loadGraph(context, location);
88
179
  deletions.forEach(d => {
89
180
  const entity = graph.entities.find(e => e.name === d.entityName);
90
181
  if (entity) {
91
182
  entity.observations = entity.observations.filter(o => !d.observations.includes(o));
92
183
  }
93
184
  });
94
- await this.saveGraph(graph);
185
+ await this.saveGraph(graph, context, location);
95
186
  }
96
- async deleteRelations(relations) {
97
- const graph = await this.loadGraph();
187
+ async deleteRelations(relations, context, location) {
188
+ const graph = await this.loadGraph(context, location);
98
189
  graph.relations = graph.relations.filter(r => !relations.some(delRelation => r.from === delRelation.from &&
99
190
  r.to === delRelation.to &&
100
191
  r.relationType === delRelation.relationType));
101
- await this.saveGraph(graph);
192
+ await this.saveGraph(graph, context, location);
102
193
  }
103
- async readGraph() {
104
- return this.loadGraph();
194
+ async readGraph(context, location) {
195
+ return this.loadGraph(context, location);
105
196
  }
106
197
  // Very basic search function
107
- async searchNodes(query) {
108
- const graph = await this.loadGraph();
198
+ async searchNodes(query, context, location) {
199
+ const graph = await this.loadGraph(context, location);
109
200
  // Filter entities
110
201
  const filteredEntities = graph.entities.filter(e => e.name.toLowerCase().includes(query.toLowerCase()) ||
111
202
  e.entityType.toLowerCase().includes(query.toLowerCase()) ||
@@ -120,8 +211,8 @@ class KnowledgeGraphManager {
120
211
  };
121
212
  return filteredGraph;
122
213
  }
123
- async openNodes(names) {
124
- const graph = await this.loadGraph();
214
+ async openNodes(names, context, location) {
215
+ const graph = await this.loadGraph(context, location);
125
216
  // Filter entities
126
217
  const filteredEntities = graph.entities.filter(e => names.includes(e.name));
127
218
  // Create a Set of filtered entity names for quick lookup
@@ -134,12 +225,56 @@ class KnowledgeGraphManager {
134
225
  };
135
226
  return filteredGraph;
136
227
  }
228
+ async listDatabases() {
229
+ const result = {
230
+ project_databases: [],
231
+ global_databases: [],
232
+ current_location: ""
233
+ };
234
+ // Check project-local .aim directory
235
+ const projectRoot = findProjectRoot();
236
+ if (projectRoot) {
237
+ const aimDir = path.join(projectRoot, '.aim');
238
+ if (existsSync(aimDir)) {
239
+ result.current_location = "project (.aim directory detected)";
240
+ try {
241
+ const files = await fs.readdir(aimDir);
242
+ result.project_databases = files
243
+ .filter(file => file.endsWith('.jsonl'))
244
+ .map(file => file === 'memory.jsonl' ? 'default' : file.replace('memory-', '').replace('.jsonl', ''))
245
+ .sort();
246
+ }
247
+ catch (error) {
248
+ // Directory exists but can't read - ignore
249
+ }
250
+ }
251
+ else {
252
+ result.current_location = "global (no .aim directory in project)";
253
+ }
254
+ }
255
+ else {
256
+ result.current_location = "global (no project detected)";
257
+ }
258
+ // Check global directory
259
+ try {
260
+ const files = await fs.readdir(baseMemoryPath);
261
+ result.global_databases = files
262
+ .filter(file => file.endsWith('.jsonl'))
263
+ .map(file => file === 'memory.jsonl' ? 'default' : file.replace('memory-', '').replace('.jsonl', ''))
264
+ .sort();
265
+ }
266
+ catch (error) {
267
+ // Directory doesn't exist or can't read
268
+ result.global_databases = [];
269
+ }
270
+ return result;
271
+ }
137
272
  }
138
273
  const knowledgeGraphManager = new KnowledgeGraphManager();
139
274
  // The server instance and tools exposed to AI models
140
275
  const server = new Server({
141
- name: "mcp-knowledge-graph",
142
- version: "1.0.1",
276
+ name: pkg.name,
277
+ version: pkg.version,
143
278
  }, {
144
279
  capabilities: {
145
280
  tools: {},
@@ -149,11 +284,43 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
149
284
  return {
150
285
  tools: [
151
286
  {
152
- name: "create_entities",
153
- description: "Create multiple new entities in the knowledge graph",
287
+ name: "aim_create_entities",
288
+ description: `Create multiple new entities in the knowledge graph.
289
+
290
+ AIM (AI Memory) provides persistent memory for AI assistants using a local knowledge graph. The 'aim_' prefix groups all memory tools together.
291
+
292
+ WHAT'S STORED: Entities (people, projects, concepts), relations between them, and observations (facts about entities).
293
+
294
+ DATABASES: Use the 'context' parameter to organize memories into separate graphs:
295
+ - Leave blank: Uses the master database (default for general information)
296
+ - Any name: Creates/uses a named database ('work', 'personal', 'health', 'research', etc.)
297
+ - New databases are created automatically - no setup required
298
+ - IMPORTANT: Use consistent, simple names - prefer 'work' over 'work-stuff'
299
+
300
+ STORAGE LOCATIONS: Files are stored as JSONL (e.g., memory.jsonl, memory-work.jsonl):
301
+ - Project-local: .aim directory in project root (auto-detected if exists)
302
+ - Global: User's configured --memory-path directory
303
+ - Use 'location' parameter to override: 'project' or 'global'
304
+
305
+ RETURNS: Array of created entities.
306
+
307
+ EXAMPLES:
308
+ - Master database (default): aim_create_entities({entities: [{name: "John", entityType: "person", observations: ["Met at conference"]}]})
309
+ - Work database: aim_create_entities({context: "work", entities: [{name: "Q4_Project", entityType: "project", observations: ["Due December 2024"]}]})
310
+ - Master database in global location: aim_create_entities({location: "global", entities: [{name: "John", entityType: "person", observations: ["Met at conference"]}]})
311
+ - Work database in project location: aim_create_entities({context: "work", location: "project", entities: [{name: "Q4_Project", entityType: "project", observations: ["Due December 2024"]}]})`,
154
312
  inputSchema: {
155
313
  type: "object",
156
314
  properties: {
315
+ context: {
316
+ type: "string",
317
+ description: "Optional memory context. Defaults to master database if not specified. Use any descriptive name ('work', 'personal', 'health', 'basket-weaving', etc.) - new contexts created automatically."
318
+ },
319
+ location: {
320
+ type: "string",
321
+ enum: ["project", "global"],
322
+ description: "Optional storage location override. 'project' forces project-local .aim directory, 'global' forces global directory. If not specified, uses automatic detection."
323
+ },
157
324
  entities: {
158
325
  type: "array",
159
326
  items: {
@@ -175,11 +342,36 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
175
342
  },
176
343
  },
177
344
  {
178
- name: "create_relations",
179
- description: "Create multiple new relations between entities in the knowledge graph. Relations should be in active voice",
345
+ name: "aim_create_relations",
346
+ description: `Create relations (edges) between entities in the knowledge graph.
347
+
348
+ RELATION STRUCTURE: Each relation has 'from' (subject), 'relationType' (verb), and 'to' (object).
349
+ - Use active voice verbs: "manages", "works_at", "knows", "attended", "created"
350
+ - Read as: "from relationType to" (e.g., "Alice manages Q4_Project")
351
+ - Avoid passive: use "manages" not "is_managed_by"
352
+
353
+ IMPORTANT: Both 'from' and 'to' entities must already exist in the same database.
354
+
355
+ RETURNS: Array of created relations (duplicates are ignored).
356
+
357
+ DATABASE: Relations are created in the specified 'context' database, or master database if not specified.
358
+
359
+ EXAMPLES:
360
+ - aim_create_relations({relations: [{from: "John", to: "TechConf2024", relationType: "attended"}]})
361
+ - aim_create_relations({context: "work", relations: [{from: "Alice", to: "Q4_Project", relationType: "manages"}]})
362
+ - Multiple: aim_create_relations({relations: [{from: "John", to: "Alice", relationType: "knows"}, {from: "John", to: "Acme_Corp", relationType: "works_at"}]})`,
180
363
  inputSchema: {
181
364
  type: "object",
182
365
  properties: {
366
+ context: {
367
+ type: "string",
368
+ description: "Optional memory context. Relations will be created in the specified context's knowledge graph."
369
+ },
370
+ location: {
371
+ type: "string",
372
+ enum: ["project", "global"],
373
+ description: "Optional storage location override. 'project' forces project-local .aim directory, 'global' forces global directory. If not specified, uses automatic detection."
374
+ },
183
375
  relations: {
184
376
  type: "array",
185
377
  items: {
@@ -197,11 +389,30 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
197
389
  },
198
390
  },
199
391
  {
200
- name: "add_observations",
201
- description: "Add new observations to existing entities in the knowledge graph",
392
+ name: "aim_add_observations",
393
+ description: `Add new observations (facts) to existing entities.
394
+
395
+ IMPORTANT: Entity must already exist - use aim_create_entities first. Throws error if entity not found.
396
+
397
+ RETURNS: Array of {entityName, addedObservations} showing what was added (duplicates are ignored).
398
+
399
+ DATABASE: Adds to entities in the specified 'context' database, or master database if not specified.
400
+
401
+ EXAMPLES:
402
+ - aim_add_observations({observations: [{entityName: "John", contents: ["Lives in Seattle", "Works in tech"]}]})
403
+ - aim_add_observations({context: "work", observations: [{entityName: "Q4_Project", contents: ["Behind schedule", "Need more resources"]}]})`,
202
404
  inputSchema: {
203
405
  type: "object",
204
406
  properties: {
407
+ context: {
408
+ type: "string",
409
+ description: "Optional memory context. Observations will be added to entities in the specified context's knowledge graph."
410
+ },
411
+ location: {
412
+ type: "string",
413
+ enum: ["project", "global"],
414
+ description: "Optional storage location override. 'project' forces project-local .aim directory, 'global' forces global directory. If not specified, uses automatic detection."
415
+ },
205
416
  observations: {
206
417
  type: "array",
207
418
  items: {
@@ -222,11 +433,30 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
222
433
  },
223
434
  },
224
435
  {
225
- name: "delete_entities",
226
- description: "Delete multiple entities and their associated relations from the knowledge graph",
436
+ name: "aim_delete_entities",
437
+ description: `Delete multiple entities and their associated relations from the knowledge graph.
438
+
439
+ DATABASE SELECTION: Entities are deleted from the specified database's knowledge graph.
440
+
441
+ LOCATION OVERRIDE: Use the 'location' parameter to force deletion from 'project' (.aim directory) or 'global' (configured directory). Leave blank for auto-detection.
442
+
443
+ EXAMPLES:
444
+ - Master database (default): aim_delete_entities({entityNames: ["OldProject"]})
445
+ - Work database: aim_delete_entities({context: "work", entityNames: ["CompletedTask", "CancelledMeeting"]})
446
+ - Master database in global location: aim_delete_entities({location: "global", entityNames: ["OldProject"]})
447
+ - Personal database in project location: aim_delete_entities({context: "personal", location: "project", entityNames: ["ExpiredReminder"]})`,
227
448
  inputSchema: {
228
449
  type: "object",
229
450
  properties: {
451
+ context: {
452
+ type: "string",
453
+ description: "Optional memory context. Entities will be deleted from the specified context's knowledge graph."
454
+ },
455
+ location: {
456
+ type: "string",
457
+ enum: ["project", "global"],
458
+ description: "Optional storage location override. 'project' forces project-local .aim directory, 'global' forces global directory. If not specified, uses automatic detection."
459
+ },
230
460
  entityNames: {
231
461
  type: "array",
232
462
  items: { type: "string" },
@@ -237,11 +467,30 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
237
467
  },
238
468
  },
239
469
  {
240
- name: "delete_observations",
241
- description: "Delete specific observations from entities in the knowledge graph",
470
+ name: "aim_delete_observations",
471
+ description: `Delete specific observations from entities in the knowledge graph.
472
+
473
+ DATABASE SELECTION: Observations are deleted from entities within the specified database's knowledge graph.
474
+
475
+ LOCATION OVERRIDE: Use the 'location' parameter to force deletion from 'project' (.aim directory) or 'global' (configured directory). Leave blank for auto-detection.
476
+
477
+ EXAMPLES:
478
+ - Master database (default): aim_delete_observations({deletions: [{entityName: "John", observations: ["Outdated info"]}]})
479
+ - Work database: aim_delete_observations({context: "work", deletions: [{entityName: "Project", observations: ["Old deadline"]}]})
480
+ - Master database in global location: aim_delete_observations({location: "global", deletions: [{entityName: "John", observations: ["Outdated info"]}]})
481
+ - Health database in project location: aim_delete_observations({context: "health", location: "project", deletions: [{entityName: "Exercise", observations: ["Injured knee"]}]})`,
242
482
  inputSchema: {
243
483
  type: "object",
244
484
  properties: {
485
+ context: {
486
+ type: "string",
487
+ description: "Optional memory context. Observations will be deleted from entities in the specified context's knowledge graph."
488
+ },
489
+ location: {
490
+ type: "string",
491
+ enum: ["project", "global"],
492
+ description: "Optional storage location override. 'project' forces project-local .aim directory, 'global' forces global directory. If not specified, uses automatic detection."
493
+ },
245
494
  deletions: {
246
495
  type: "array",
247
496
  items: {
@@ -262,11 +511,30 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
262
511
  },
263
512
  },
264
513
  {
265
- name: "delete_relations",
266
- description: "Delete multiple relations from the knowledge graph",
514
+ name: "aim_delete_relations",
515
+ description: `Delete multiple relations from the knowledge graph.
516
+
517
+ DATABASE SELECTION: Relations are deleted from the specified database's knowledge graph.
518
+
519
+ LOCATION OVERRIDE: Use the 'location' parameter to force deletion from 'project' (.aim directory) or 'global' (configured directory). Leave blank for auto-detection.
520
+
521
+ EXAMPLES:
522
+ - Master database (default): aim_delete_relations({relations: [{from: "John", to: "OldCompany", relationType: "worked_at"}]})
523
+ - Work database: aim_delete_relations({context: "work", relations: [{from: "Alice", to: "CancelledProject", relationType: "manages"}]})
524
+ - Master database in global location: aim_delete_relations({location: "global", relations: [{from: "John", to: "OldCompany", relationType: "worked_at"}]})
525
+ - Personal database in project location: aim_delete_relations({context: "personal", location: "project", relations: [{from: "Me", to: "OldHobby", relationType: "enjoys"}]})`,
267
526
  inputSchema: {
268
527
  type: "object",
269
528
  properties: {
529
+ context: {
530
+ type: "string",
531
+ description: "Optional memory context. Relations will be deleted from the specified context's knowledge graph."
532
+ },
533
+ location: {
534
+ type: "string",
535
+ enum: ["project", "global"],
536
+ description: "Optional storage location override. 'project' forces project-local .aim directory, 'global' forces global directory. If not specified, uses automatic detection."
537
+ },
270
538
  relations: {
271
539
  type: "array",
272
540
  items: {
@@ -285,30 +553,95 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
285
553
  },
286
554
  },
287
555
  {
288
- name: "read_graph",
289
- description: "Read the entire knowledge graph",
556
+ name: "aim_read_graph",
557
+ description: `Read the entire knowledge graph.
558
+
559
+ DATABASE SELECTION: Reads from the specified database or master database if no database is specified.
560
+
561
+ LOCATION OVERRIDE: Use the 'location' parameter to force reading from 'project' (.aim directory) or 'global' (configured directory). Leave blank for auto-detection.
562
+
563
+ EXAMPLES:
564
+ - Master database (default): aim_read_graph({})
565
+ - Work database: aim_read_graph({context: "work"})
566
+ - Master database in global location: aim_read_graph({location: "global"})
567
+ - Personal database in project location: aim_read_graph({context: "personal", location: "project"})`,
290
568
  inputSchema: {
291
569
  type: "object",
292
- properties: {},
570
+ properties: {
571
+ context: {
572
+ type: "string",
573
+ description: "Optional memory context. Reads from the specified context's knowledge graph or master database if not specified."
574
+ },
575
+ location: {
576
+ type: "string",
577
+ enum: ["project", "global"],
578
+ description: "Optional storage location override. 'project' forces project-local .aim directory, 'global' forces global directory. If not specified, uses automatic detection."
579
+ }
580
+ },
293
581
  },
294
582
  },
295
583
  {
296
- name: "search_nodes",
297
- description: "Search for nodes in the knowledge graph based on a query",
584
+ name: "aim_search_nodes",
585
+ description: `Fuzzy search for entities in the knowledge graph. Use this when you don't know exact entity names.
586
+
587
+ WHAT IT SEARCHES: Matches query (case-insensitive) against:
588
+ - Entity names (e.g., "John" matches "John_Smith")
589
+ - Entity types (e.g., "person" matches all person entities)
590
+ - Observation content (e.g., "Seattle" matches entities with Seattle in their observations)
591
+
592
+ VS aim_open_nodes: Use search when you need fuzzy matching. Use open_nodes when you know exact entity names.
593
+
594
+ RETURNS: Matching entities and relations between them.
595
+
596
+ DATABASE: Searches within the specified 'context' database, or master database if not specified.
597
+
598
+ EXAMPLES:
599
+ - Master database (default): aim_search_nodes({query: "John"})
600
+ - Work database: aim_search_nodes({context: "work", query: "project"})
601
+ - Search by type: aim_search_nodes({query: "person"})
602
+ - Search observation content: aim_search_nodes({query: "Seattle"})`,
298
603
  inputSchema: {
299
604
  type: "object",
300
605
  properties: {
301
- query: { type: "string", description: "The search query to match against entity names, types, and observation content" },
606
+ context: {
607
+ type: "string",
608
+ description: "Optional database name. Searches within this database or master database if not specified."
609
+ },
610
+ location: {
611
+ type: "string",
612
+ enum: ["project", "global"],
613
+ description: "Optional storage location override. 'project' for .aim directory, 'global' for configured directory."
614
+ },
615
+ query: { type: "string", description: "Search text to match against entity names, entity types, and observation content (case-insensitive)" },
302
616
  },
303
617
  required: ["query"],
304
618
  },
305
619
  },
306
620
  {
307
- name: "open_nodes",
308
- description: "Open specific nodes in the knowledge graph by their names",
621
+ name: "aim_open_nodes",
622
+ description: `Retrieve specific entities by exact name. Use this when you know the exact entity names you want.
623
+
624
+ VS aim_search_nodes: Use open_nodes for exact name lookup. Use search_nodes when you need fuzzy matching or don't know exact names.
625
+
626
+ RETURNS: Requested entities and relations between them. Non-existent names are silently ignored.
627
+
628
+ DATABASE: Retrieves from the specified 'context' database, or master database if not specified.
629
+
630
+ EXAMPLES:
631
+ - Master database (default): aim_open_nodes({names: ["John", "TechConf2024"]})
632
+ - Work database: aim_open_nodes({context: "work", names: ["Q4_Project", "Alice"]})`,
309
633
  inputSchema: {
310
634
  type: "object",
311
635
  properties: {
636
+ context: {
637
+ type: "string",
638
+ description: "Optional memory context. Retrieves entities from the specified context's knowledge graph or master database if not specified."
639
+ },
640
+ location: {
641
+ type: "string",
642
+ enum: ["project", "global"],
643
+ description: "Optional storage location override. 'project' forces project-local .aim directory, 'global' forces global directory. If not specified, uses automatic detection."
644
+ },
312
645
  names: {
313
646
  type: "array",
314
647
  items: { type: "string" },
@@ -318,6 +651,28 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
318
651
  required: ["names"],
319
652
  },
320
653
  },
654
+ {
655
+ name: "aim_list_databases",
656
+ description: `List all available memory databases and show current storage location.
657
+
658
+ DATABASE TYPES:
659
+ - "default": The master database (memory.jsonl) - used when no context is specified
660
+ - Named databases: Created via context parameter (e.g., "work" -> memory-work.jsonl)
661
+
662
+ RETURNS: {project_databases: [...], global_databases: [...], current_location: "..."}
663
+ - project_databases: Databases in .aim directory (if project detected)
664
+ - global_databases: Databases in global --memory-path directory
665
+ - current_location: Where operations will default to
666
+
667
+ Use this to discover what databases exist before querying them.
668
+
669
+ EXAMPLES:
670
+ - aim_list_databases() - Shows all available databases and current storage location`,
671
+ inputSchema: {
672
+ type: "object",
673
+ properties: {},
674
+ },
675
+ },
321
676
  ],
322
677
  };
323
678
  });
@@ -327,27 +682,29 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
327
682
  throw new Error(`No arguments provided for tool: ${name}`);
328
683
  }
329
684
  switch (name) {
330
- case "create_entities":
331
- return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.createEntities(args.entities), null, 2) }] };
332
- case "create_relations":
333
- return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.createRelations(args.relations), null, 2) }] };
334
- case "add_observations":
335
- return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.addObservations(args.observations), null, 2) }] };
336
- case "delete_entities":
337
- await knowledgeGraphManager.deleteEntities(args.entityNames);
685
+ case "aim_create_entities":
686
+ return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.createEntities(args.entities, args.context, args.location), null, 2) }] };
687
+ case "aim_create_relations":
688
+ return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.createRelations(args.relations, args.context, args.location), null, 2) }] };
689
+ case "aim_add_observations":
690
+ return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.addObservations(args.observations, args.context, args.location), null, 2) }] };
691
+ case "aim_delete_entities":
692
+ await knowledgeGraphManager.deleteEntities(args.entityNames, args.context, args.location);
338
693
  return { content: [{ type: "text", text: "Entities deleted successfully" }] };
339
- case "delete_observations":
340
- await knowledgeGraphManager.deleteObservations(args.deletions);
694
+ case "aim_delete_observations":
695
+ await knowledgeGraphManager.deleteObservations(args.deletions, args.context, args.location);
341
696
  return { content: [{ type: "text", text: "Observations deleted successfully" }] };
342
- case "delete_relations":
343
- await knowledgeGraphManager.deleteRelations(args.relations);
697
+ case "aim_delete_relations":
698
+ await knowledgeGraphManager.deleteRelations(args.relations, args.context, args.location);
344
699
  return { content: [{ type: "text", text: "Relations deleted successfully" }] };
345
- case "read_graph":
346
- return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.readGraph(), null, 2) }] };
347
- case "search_nodes":
348
- return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.searchNodes(args.query), null, 2) }] };
349
- case "open_nodes":
350
- return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.openNodes(args.names), null, 2) }] };
700
+ case "aim_read_graph":
701
+ return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.readGraph(args.context, args.location), null, 2) }] };
702
+ case "aim_search_nodes":
703
+ return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.searchNodes(args.query, args.context, args.location), null, 2) }] };
704
+ case "aim_open_nodes":
705
+ return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.openNodes(args.names, args.context, args.location), null, 2) }] };
706
+ case "aim_list_databases":
707
+ return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.listDatabases(), null, 2) }] };
351
708
  default:
352
709
  throw new Error(`Unknown tool: ${name}`);
353
710
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,qCAAqC;AACrC,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7C,IAAI,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC;AAErC,qDAAqD;AACrD,IAAI,UAAU,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;IACxC,UAAU,GAAG,I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AO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,qBAAqB,CAAC,SAAS,CAAC,IAAI,CAAC,KAAiB,EAAE,IAAI,CAAC,OAAiB,EAAE,IAAI,CAAC,QAAgC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QACtM,KAAK,oBAAoB;YACvB,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,qBAAqB,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QACrH;YACE,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAC;AAC/D,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;IAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "mcp-knowledge-graph",
3
- "version": "1.0.3",
3
+ "version": "1.2.2",
4
4
  "description": "MCP server enabling persistent memory for AI models through a local knowledge graph",
5
5
  "license": "MIT",
6
6
  "author": "Shane Holloman",
7
7
  "homepage": "https://github.com/shaneholloman/mcp-knowledge-graph",
8
8
  "bugs": "https://github.com/shaneholloman/mcp-knowledge-graph/issues",
9
9
  "type": "module",
10
+ "engines": {
11
+ "node": ">=18.0.0"
12
+ },
10
13
  "bin": {
11
14
  "mcp-knowledge-graph": "dist/index.js"
12
15
  },
@@ -28,4 +31,4 @@
28
31
  "shx": "^0.3.4",
29
32
  "typescript": "^5.6.2"
30
33
  }
31
- }
34
+ }