mcp-knowledge-graph
Advanced tools
+397
-69
@@ -6,2 +6,3 @@ #!/usr/bin/env node | ||
| import { promises as fs } from 'fs'; | ||
| import { existsSync } from 'fs'; | ||
| import path from 'path'; | ||
@@ -18,13 +19,91 @@ import { fileURLToPath } from 'url'; | ||
| } | ||
| // Define the path to the JSONL file | ||
| // Define the base directory for memory files | ||
| const __dirname = path.dirname(fileURLToPath(import.meta.url)); | ||
| // Use the custom path or default to the installation directory | ||
| const MEMORY_FILE_PATH = memoryPath || path.join(__dirname, 'memory.jsonl'); | ||
| // Handle memory path - could be a file or directory | ||
| let baseMemoryPath; | ||
| if (memoryPath) { | ||
| // If memory-path points to a .jsonl file, use its directory as the base | ||
| if (memoryPath.endsWith('.jsonl')) { | ||
| baseMemoryPath = path.dirname(memoryPath); | ||
| } | ||
| else { | ||
| // Otherwise treat it as a directory | ||
| baseMemoryPath = memoryPath; | ||
| } | ||
| } | ||
| else { | ||
| baseMemoryPath = __dirname; | ||
| } | ||
| // Simple marker to identify our files - prevents writing to unrelated JSONL files | ||
| const FILE_MARKER = { | ||
| type: "_aim", | ||
| source: "mcp-knowledge-graph" | ||
| }; | ||
| // Project detection - look for common project markers | ||
| function findProjectRoot(startDir = process.cwd()) { | ||
| const projectMarkers = ['.git', 'package.json', 'pyproject.toml', 'Cargo.toml', 'go.mod']; | ||
| let currentDir = startDir; | ||
| const maxDepth = 5; | ||
| for (let i = 0; i < maxDepth; i++) { | ||
| // Check for project markers | ||
| for (const marker of projectMarkers) { | ||
| if (existsSync(path.join(currentDir, marker))) { | ||
| return currentDir; | ||
| } | ||
| } | ||
| // Move up one directory | ||
| const parentDir = path.dirname(currentDir); | ||
| if (parentDir === currentDir) { | ||
| // Reached root directory | ||
| break; | ||
| } | ||
| currentDir = parentDir; | ||
| } | ||
| return null; | ||
| } | ||
| // Function to get memory file path based on context and optional location override | ||
| function getMemoryFilePath(context, location) { | ||
| const filename = context ? `memory-${context}.jsonl` : 'memory.jsonl'; | ||
| // If location is explicitly specified, use it | ||
| if (location === 'global') { | ||
| return path.join(baseMemoryPath, filename); | ||
| } | ||
| if (location === 'project') { | ||
| const projectRoot = findProjectRoot(); | ||
| if (projectRoot) { | ||
| const aimDir = path.join(projectRoot, '.aim'); | ||
| return path.join(aimDir, filename); // Will create .aim if it doesn't exist | ||
| } | ||
| else { | ||
| throw new Error('No project detected - cannot use project location'); | ||
| } | ||
| } | ||
| // Auto-detect logic (existing behavior) | ||
| const projectRoot = findProjectRoot(); | ||
| if (projectRoot) { | ||
| const aimDir = path.join(projectRoot, '.aim'); | ||
| if (existsSync(aimDir)) { | ||
| return path.join(aimDir, filename); | ||
| } | ||
| } | ||
| // Fallback to configured base directory | ||
| return path.join(baseMemoryPath, filename); | ||
| } | ||
| // The KnowledgeGraphManager class contains all operations to interact with the knowledge graph | ||
| class KnowledgeGraphManager { | ||
| async loadGraph() { | ||
| async loadGraph(context, location) { | ||
| const filePath = getMemoryFilePath(context, location); | ||
| try { | ||
| const data = await fs.readFile(MEMORY_FILE_PATH, "utf-8"); | ||
| const data = await fs.readFile(filePath, "utf-8"); | ||
| const lines = data.split("\n").filter(line => line.trim() !== ""); | ||
| return lines.reduce((graph, line) => { | ||
| if (lines.length === 0) { | ||
| return { entities: [], relations: [] }; | ||
| } | ||
| // Check first line for our file marker | ||
| const firstLine = JSON.parse(lines[0]); | ||
| if (firstLine.type !== "_aim" || firstLine.source !== "mcp-knowledge-graph") { | ||
| 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"}`); | ||
| } | ||
| // Process remaining lines (skip metadata) | ||
| return lines.slice(1).reduce((graph, line) => { | ||
| const item = JSON.parse(line); | ||
@@ -40,2 +119,3 @@ if (item.type === "entity") | ||
| if (error instanceof Error && 'code' in error && error.code === "ENOENT") { | ||
| // File doesn't exist - we'll create it with metadata on first save | ||
| return { entities: [], relations: [] }; | ||
@@ -46,18 +126,23 @@ } | ||
| } | ||
| async saveGraph(graph) { | ||
| async saveGraph(graph, context, location) { | ||
| const filePath = getMemoryFilePath(context, location); | ||
| // Write our simple file marker | ||
| const lines = [ | ||
| JSON.stringify(FILE_MARKER), | ||
| ...graph.entities.map(e => JSON.stringify({ type: "entity", ...e })), | ||
| ...graph.relations.map(r => JSON.stringify({ type: "relation", ...r })), | ||
| ]; | ||
| await fs.writeFile(MEMORY_FILE_PATH, lines.join("\n")); | ||
| // Ensure directory exists | ||
| await fs.mkdir(path.dirname(filePath), { recursive: true }); | ||
| await fs.writeFile(filePath, lines.join("\n")); | ||
| } | ||
| async createEntities(entities) { | ||
| const graph = await this.loadGraph(); | ||
| async createEntities(entities, context, location) { | ||
| const graph = await this.loadGraph(context, location); | ||
| const newEntities = entities.filter(e => !graph.entities.some(existingEntity => existingEntity.name === e.name)); | ||
| graph.entities.push(...newEntities); | ||
| await this.saveGraph(graph); | ||
| await this.saveGraph(graph, context, location); | ||
| return newEntities; | ||
| } | ||
| async createRelations(relations) { | ||
| const graph = await this.loadGraph(); | ||
| async createRelations(relations, context, location) { | ||
| const graph = await this.loadGraph(context, location); | ||
| const newRelations = relations.filter(r => !graph.relations.some(existingRelation => existingRelation.from === r.from && | ||
@@ -67,7 +152,7 @@ existingRelation.to === r.to && | ||
| graph.relations.push(...newRelations); | ||
| await this.saveGraph(graph); | ||
| await this.saveGraph(graph, context, location); | ||
| return newRelations; | ||
| } | ||
| async addObservations(observations) { | ||
| const graph = await this.loadGraph(); | ||
| async addObservations(observations, context, location) { | ||
| const graph = await this.loadGraph(context, location); | ||
| const results = observations.map(o => { | ||
@@ -82,13 +167,13 @@ const entity = graph.entities.find(e => e.name === o.entityName); | ||
| }); | ||
| await this.saveGraph(graph); | ||
| await this.saveGraph(graph, context, location); | ||
| return results; | ||
| } | ||
| async deleteEntities(entityNames) { | ||
| const graph = await this.loadGraph(); | ||
| async deleteEntities(entityNames, context, location) { | ||
| const graph = await this.loadGraph(context, location); | ||
| graph.entities = graph.entities.filter(e => !entityNames.includes(e.name)); | ||
| graph.relations = graph.relations.filter(r => !entityNames.includes(r.from) && !entityNames.includes(r.to)); | ||
| await this.saveGraph(graph); | ||
| await this.saveGraph(graph, context, location); | ||
| } | ||
| async deleteObservations(deletions) { | ||
| const graph = await this.loadGraph(); | ||
| async deleteObservations(deletions, context, location) { | ||
| const graph = await this.loadGraph(context, location); | ||
| deletions.forEach(d => { | ||
@@ -100,17 +185,17 @@ const entity = graph.entities.find(e => e.name === d.entityName); | ||
| }); | ||
| await this.saveGraph(graph); | ||
| await this.saveGraph(graph, context, location); | ||
| } | ||
| async deleteRelations(relations) { | ||
| const graph = await this.loadGraph(); | ||
| async deleteRelations(relations, context, location) { | ||
| const graph = await this.loadGraph(context, location); | ||
| graph.relations = graph.relations.filter(r => !relations.some(delRelation => r.from === delRelation.from && | ||
| r.to === delRelation.to && | ||
| r.relationType === delRelation.relationType)); | ||
| await this.saveGraph(graph); | ||
| await this.saveGraph(graph, context, location); | ||
| } | ||
| async readGraph() { | ||
| return this.loadGraph(); | ||
| async readGraph(context, location) { | ||
| return this.loadGraph(context, location); | ||
| } | ||
| // Very basic search function | ||
| async searchNodes(query) { | ||
| const graph = await this.loadGraph(); | ||
| async searchNodes(query, context, location) { | ||
| const graph = await this.loadGraph(context, location); | ||
| // Filter entities | ||
@@ -130,4 +215,4 @@ const filteredEntities = graph.entities.filter(e => e.name.toLowerCase().includes(query.toLowerCase()) || | ||
| } | ||
| async openNodes(names) { | ||
| const graph = await this.loadGraph(); | ||
| async openNodes(names, context, location) { | ||
| const graph = await this.loadGraph(context, location); | ||
| // Filter entities | ||
@@ -145,2 +230,46 @@ const filteredEntities = graph.entities.filter(e => names.includes(e.name)); | ||
| } | ||
| async listDatabases() { | ||
| const result = { | ||
| project_databases: [], | ||
| global_databases: [], | ||
| current_location: "" | ||
| }; | ||
| // Check project-local .aim directory | ||
| const projectRoot = findProjectRoot(); | ||
| if (projectRoot) { | ||
| const aimDir = path.join(projectRoot, '.aim'); | ||
| if (existsSync(aimDir)) { | ||
| result.current_location = "project (.aim directory detected)"; | ||
| try { | ||
| const files = await fs.readdir(aimDir); | ||
| result.project_databases = files | ||
| .filter(file => file.endsWith('.jsonl')) | ||
| .map(file => file === 'memory.jsonl' ? 'default' : file.replace('memory-', '').replace('.jsonl', '')) | ||
| .sort(); | ||
| } | ||
| catch (error) { | ||
| // Directory exists but can't read - ignore | ||
| } | ||
| } | ||
| else { | ||
| result.current_location = "global (no .aim directory in project)"; | ||
| } | ||
| } | ||
| else { | ||
| result.current_location = "global (no project detected)"; | ||
| } | ||
| // Check global directory | ||
| try { | ||
| const files = await fs.readdir(baseMemoryPath); | ||
| result.global_databases = files | ||
| .filter(file => file.endsWith('.jsonl')) | ||
| .map(file => file === 'memory.jsonl' ? 'default' : file.replace('memory-', '').replace('.jsonl', '')) | ||
| .sort(); | ||
| } | ||
| catch (error) { | ||
| // Directory doesn't exist or can't read | ||
| result.global_databases = []; | ||
| } | ||
| return result; | ||
| } | ||
| } | ||
@@ -161,7 +290,38 @@ const knowledgeGraphManager = new KnowledgeGraphManager(); | ||
| { | ||
| name: "create_entities", | ||
| description: "Create multiple new entities in the knowledge graph", | ||
| name: "aim_create_entities", | ||
| description: `Create multiple new entities in the knowledge graph. | ||
| DATABASE SELECTION: By default, all memories are stored in the master database. Use the 'context' parameter to organize information into separate knowledge graphs for different areas of life or work. | ||
| STORAGE LOCATION: Files are stored in the user's configured directory, or project-local .aim directory if one exists. Each database creates its own file (e.g., memory-work.jsonl, memory-personal.jsonl). | ||
| LOCATION OVERRIDE: Use the 'location' parameter to force storage in a specific location: | ||
| - 'project': Always use project-local .aim directory (creates if needed) | ||
| - 'global': Always use global configured directory | ||
| - Leave blank: Auto-detect (project if .aim exists, otherwise global) | ||
| WHEN TO USE DATABASES: | ||
| - Any descriptive name: 'work', 'personal', 'health', 'research', 'basket-weaving', 'book-club', etc. | ||
| - New databases are created automatically - no setup required | ||
| - IMPORTANT: Use consistent, simple names - prefer 'work' over 'work-stuff' or 'job-related' | ||
| - Common examples: 'work' (professional), 'personal' (private), 'health' (medical), 'research' (academic) | ||
| - Leave blank: General information or when unsure (uses master database) | ||
| EXAMPLES: | ||
| - Master database (default): aim_create_entities({entities: [{name: "John", entityType: "person", observations: ["Met at conference"]}]}) | ||
| - Work database: aim_create_entities({context: "work", entities: [{name: "Q4_Project", entityType: "project", observations: ["Due December 2024"]}]}) | ||
| - Master database in global location: aim_create_entities({location: "global", entities: [{name: "John", entityType: "person", observations: ["Met at conference"]}]}) | ||
| - Work database in project location: aim_create_entities({context: "work", location: "project", entities: [{name: "Q4_Project", entityType: "project", observations: ["Due December 2024"]}]})`, | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| context: { | ||
| type: "string", | ||
| 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." | ||
| }, | ||
| location: { | ||
| type: "string", | ||
| enum: ["project", "global"], | ||
| description: "Optional storage location override. 'project' forces project-local .aim directory, 'global' forces global directory. If not specified, uses automatic detection." | ||
| }, | ||
| entities: { | ||
@@ -188,7 +348,26 @@ type: "array", | ||
| { | ||
| name: "create_relations", | ||
| description: "Create multiple new relations between entities in the knowledge graph. Relations should be in active voice", | ||
| name: "aim_create_relations", | ||
| description: `Create multiple new relations between entities in the knowledge graph. Relations should be in active voice. | ||
| DATABASE SELECTION: Relations are created within the specified database's knowledge graph. Entities must exist in the same database. | ||
| LOCATION OVERRIDE: Use the 'location' parameter to force storage in 'project' (.aim directory) or 'global' (configured directory). Leave blank for auto-detection. | ||
| EXAMPLES: | ||
| - Master database (default): aim_create_relations({relations: [{from: "John", to: "TechConf2024", relationType: "attended"}]}) | ||
| - Work database: aim_create_relations({context: "work", relations: [{from: "Alice", to: "Q4_Project", relationType: "manages"}]}) | ||
| - Master database in global location: aim_create_relations({location: "global", relations: [{from: "John", to: "TechConf2024", relationType: "attended"}]}) | ||
| - Personal database in project location: aim_create_relations({context: "personal", location: "project", relations: [{from: "Mom", to: "Gardening", relationType: "enjoys"}]})`, | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| context: { | ||
| type: "string", | ||
| description: "Optional memory context. Relations will be created in the specified context's knowledge graph." | ||
| }, | ||
| location: { | ||
| type: "string", | ||
| enum: ["project", "global"], | ||
| description: "Optional storage location override. 'project' forces project-local .aim directory, 'global' forces global directory. If not specified, uses automatic detection." | ||
| }, | ||
| relations: { | ||
@@ -211,7 +390,26 @@ type: "array", | ||
| { | ||
| name: "add_observations", | ||
| description: "Add new observations to existing entities in the knowledge graph", | ||
| name: "aim_add_observations", | ||
| description: `Add new observations to existing entities in the knowledge graph. | ||
| DATABASE SELECTION: Observations are added to entities within the specified database's knowledge graph. | ||
| LOCATION OVERRIDE: Use the 'location' parameter to force storage in 'project' (.aim directory) or 'global' (configured directory). Leave blank for auto-detection. | ||
| EXAMPLES: | ||
| - Master database (default): aim_add_observations({observations: [{entityName: "John", contents: ["Lives in Seattle", "Works in tech"]}]}) | ||
| - Work database: aim_add_observations({context: "work", observations: [{entityName: "Q4_Project", contents: ["Behind schedule", "Need more resources"]}]}) | ||
| - Master database in global location: aim_add_observations({location: "global", observations: [{entityName: "John", contents: ["Lives in Seattle", "Works in tech"]}]}) | ||
| - Health database in project location: aim_add_observations({context: "health", location: "project", observations: [{entityName: "Daily_Routine", contents: ["30min morning walk", "8 glasses water"]}]})`, | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| context: { | ||
| type: "string", | ||
| description: "Optional memory context. Observations will be added to entities in the specified context's knowledge graph." | ||
| }, | ||
| location: { | ||
| type: "string", | ||
| enum: ["project", "global"], | ||
| description: "Optional storage location override. 'project' forces project-local .aim directory, 'global' forces global directory. If not specified, uses automatic detection." | ||
| }, | ||
| observations: { | ||
@@ -237,7 +435,26 @@ type: "array", | ||
| { | ||
| name: "delete_entities", | ||
| description: "Delete multiple entities and their associated relations from the knowledge graph", | ||
| name: "aim_delete_entities", | ||
| description: `Delete multiple entities and their associated relations from the knowledge graph. | ||
| DATABASE SELECTION: Entities are deleted from the specified database's knowledge graph. | ||
| LOCATION OVERRIDE: Use the 'location' parameter to force deletion from 'project' (.aim directory) or 'global' (configured directory). Leave blank for auto-detection. | ||
| EXAMPLES: | ||
| - Master database (default): aim_delete_entities({entityNames: ["OldProject"]}) | ||
| - Work database: aim_delete_entities({context: "work", entityNames: ["CompletedTask", "CancelledMeeting"]}) | ||
| - Master database in global location: aim_delete_entities({location: "global", entityNames: ["OldProject"]}) | ||
| - Personal database in project location: aim_delete_entities({context: "personal", location: "project", entityNames: ["ExpiredReminder"]})`, | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| context: { | ||
| type: "string", | ||
| description: "Optional memory context. Entities will be deleted from the specified context's knowledge graph." | ||
| }, | ||
| location: { | ||
| type: "string", | ||
| enum: ["project", "global"], | ||
| description: "Optional storage location override. 'project' forces project-local .aim directory, 'global' forces global directory. If not specified, uses automatic detection." | ||
| }, | ||
| entityNames: { | ||
@@ -253,7 +470,26 @@ type: "array", | ||
| { | ||
| name: "delete_observations", | ||
| description: "Delete specific observations from entities in the knowledge graph", | ||
| name: "aim_delete_observations", | ||
| description: `Delete specific observations from entities in the knowledge graph. | ||
| DATABASE SELECTION: Observations are deleted from entities within the specified database's knowledge graph. | ||
| LOCATION OVERRIDE: Use the 'location' parameter to force deletion from 'project' (.aim directory) or 'global' (configured directory). Leave blank for auto-detection. | ||
| EXAMPLES: | ||
| - Master database (default): aim_delete_observations({deletions: [{entityName: "John", observations: ["Outdated info"]}]}) | ||
| - Work database: aim_delete_observations({context: "work", deletions: [{entityName: "Project", observations: ["Old deadline"]}]}) | ||
| - Master database in global location: aim_delete_observations({location: "global", deletions: [{entityName: "John", observations: ["Outdated info"]}]}) | ||
| - Health database in project location: aim_delete_observations({context: "health", location: "project", deletions: [{entityName: "Exercise", observations: ["Injured knee"]}]})`, | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| context: { | ||
| type: "string", | ||
| description: "Optional memory context. Observations will be deleted from entities in the specified context's knowledge graph." | ||
| }, | ||
| location: { | ||
| type: "string", | ||
| enum: ["project", "global"], | ||
| description: "Optional storage location override. 'project' forces project-local .aim directory, 'global' forces global directory. If not specified, uses automatic detection." | ||
| }, | ||
| deletions: { | ||
@@ -279,7 +515,26 @@ type: "array", | ||
| { | ||
| name: "delete_relations", | ||
| description: "Delete multiple relations from the knowledge graph", | ||
| name: "aim_delete_relations", | ||
| description: `Delete multiple relations from the knowledge graph. | ||
| DATABASE SELECTION: Relations are deleted from the specified database's knowledge graph. | ||
| LOCATION OVERRIDE: Use the 'location' parameter to force deletion from 'project' (.aim directory) or 'global' (configured directory). Leave blank for auto-detection. | ||
| EXAMPLES: | ||
| - Master database (default): aim_delete_relations({relations: [{from: "John", to: "OldCompany", relationType: "worked_at"}]}) | ||
| - Work database: aim_delete_relations({context: "work", relations: [{from: "Alice", to: "CancelledProject", relationType: "manages"}]}) | ||
| - Master database in global location: aim_delete_relations({location: "global", relations: [{from: "John", to: "OldCompany", relationType: "worked_at"}]}) | ||
| - Personal database in project location: aim_delete_relations({context: "personal", location: "project", relations: [{from: "Me", to: "OldHobby", relationType: "enjoys"}]})`, | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| context: { | ||
| type: "string", | ||
| description: "Optional memory context. Relations will be deleted from the specified context's knowledge graph." | ||
| }, | ||
| location: { | ||
| type: "string", | ||
| enum: ["project", "global"], | ||
| description: "Optional storage location override. 'project' forces project-local .aim directory, 'global' forces global directory. If not specified, uses automatic detection." | ||
| }, | ||
| relations: { | ||
@@ -303,15 +558,54 @@ type: "array", | ||
| { | ||
| name: "read_graph", | ||
| description: "Read the entire knowledge graph", | ||
| name: "aim_read_graph", | ||
| description: `Read the entire knowledge graph. | ||
| DATABASE SELECTION: Reads from the specified database or master database if no database is specified. | ||
| LOCATION OVERRIDE: Use the 'location' parameter to force reading from 'project' (.aim directory) or 'global' (configured directory). Leave blank for auto-detection. | ||
| EXAMPLES: | ||
| - Master database (default): aim_read_graph({}) | ||
| - Work database: aim_read_graph({context: "work"}) | ||
| - Master database in global location: aim_read_graph({location: "global"}) | ||
| - Personal database in project location: aim_read_graph({context: "personal", location: "project"})`, | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: {}, | ||
| properties: { | ||
| context: { | ||
| type: "string", | ||
| description: "Optional memory context. Reads from the specified context's knowledge graph or master database if not specified." | ||
| }, | ||
| location: { | ||
| type: "string", | ||
| enum: ["project", "global"], | ||
| description: "Optional storage location override. 'project' forces project-local .aim directory, 'global' forces global directory. If not specified, uses automatic detection." | ||
| } | ||
| }, | ||
| }, | ||
| }, | ||
| { | ||
| name: "search_nodes", | ||
| description: "Search for nodes in the knowledge graph based on a query", | ||
| name: "aim_search_nodes", | ||
| description: `Search for nodes in the knowledge graph based on a query. | ||
| DATABASE SELECTION: Searches within the specified database or master database if no database is specified. | ||
| LOCATION OVERRIDE: Use the 'location' parameter to force searching in 'project' (.aim directory) or 'global' (configured directory). Leave blank for auto-detection. | ||
| EXAMPLES: | ||
| - Master database (default): aim_search_nodes({query: "John"}) | ||
| - Work database: aim_search_nodes({context: "work", query: "project"}) | ||
| - Master database in global location: aim_search_nodes({location: "global", query: "John"}) | ||
| - Personal database in project location: aim_search_nodes({context: "personal", location: "project", query: "family"})`, | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| context: { | ||
| type: "string", | ||
| description: "Optional memory context. Searches within the specified context's knowledge graph or master database if not specified." | ||
| }, | ||
| location: { | ||
| type: "string", | ||
| enum: ["project", "global"], | ||
| description: "Optional storage location override. 'project' forces project-local .aim directory, 'global' forces global directory. If not specified, uses automatic detection." | ||
| }, | ||
| query: { type: "string", description: "The search query to match against entity names, types, and observation content" }, | ||
@@ -323,7 +617,26 @@ }, | ||
| { | ||
| name: "open_nodes", | ||
| description: "Open specific nodes in the knowledge graph by their names", | ||
| name: "aim_open_nodes", | ||
| description: `Open specific nodes in the knowledge graph by their names. | ||
| DATABASE SELECTION: Retrieves entities from the specified database or master database if no database is specified. | ||
| LOCATION OVERRIDE: Use the 'location' parameter to force retrieval from 'project' (.aim directory) or 'global' (configured directory). Leave blank for auto-detection. | ||
| EXAMPLES: | ||
| - Master database (default): aim_open_nodes({names: ["John", "TechConf2024"]}) | ||
| - Work database: aim_open_nodes({context: "work", names: ["Q4_Project", "Alice"]}) | ||
| - Master database in global location: aim_open_nodes({location: "global", names: ["John", "TechConf2024"]}) | ||
| - Personal database in project location: aim_open_nodes({context: "personal", location: "project", names: ["Mom", "Birthday_Plans"]})`, | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| context: { | ||
| type: "string", | ||
| description: "Optional memory context. Retrieves entities from the specified context's knowledge graph or master database if not specified." | ||
| }, | ||
| location: { | ||
| type: "string", | ||
| enum: ["project", "global"], | ||
| description: "Optional storage location override. 'project' forces project-local .aim directory, 'global' forces global directory. If not specified, uses automatic detection." | ||
| }, | ||
| names: { | ||
@@ -338,2 +651,15 @@ type: "array", | ||
| }, | ||
| { | ||
| name: "aim_list_databases", | ||
| description: `List all available memory databases in both project and global locations. | ||
| DISCOVERY: Shows which databases exist, where they're stored, and which location is currently active. | ||
| EXAMPLES: | ||
| - aim_list_databases() - Shows all available databases and current storage location`, | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: {}, | ||
| }, | ||
| }, | ||
| ], | ||
@@ -348,23 +674,25 @@ }; | ||
| switch (name) { | ||
| case "create_entities": | ||
| return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.createEntities(args.entities), null, 2) }] }; | ||
| case "create_relations": | ||
| return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.createRelations(args.relations), null, 2) }] }; | ||
| case "add_observations": | ||
| return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.addObservations(args.observations), null, 2) }] }; | ||
| case "delete_entities": | ||
| await knowledgeGraphManager.deleteEntities(args.entityNames); | ||
| case "aim_create_entities": | ||
| return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.createEntities(args.entities, args.context, args.location), null, 2) }] }; | ||
| case "aim_create_relations": | ||
| return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.createRelations(args.relations, args.context, args.location), null, 2) }] }; | ||
| case "aim_add_observations": | ||
| return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.addObservations(args.observations, args.context, args.location), null, 2) }] }; | ||
| case "aim_delete_entities": | ||
| await knowledgeGraphManager.deleteEntities(args.entityNames, args.context, args.location); | ||
| return { content: [{ type: "text", text: "Entities deleted successfully" }] }; | ||
| case "delete_observations": | ||
| await knowledgeGraphManager.deleteObservations(args.deletions); | ||
| case "aim_delete_observations": | ||
| await knowledgeGraphManager.deleteObservations(args.deletions, args.context, args.location); | ||
| return { content: [{ type: "text", text: "Observations deleted successfully" }] }; | ||
| case "delete_relations": | ||
| await knowledgeGraphManager.deleteRelations(args.relations); | ||
| case "aim_delete_relations": | ||
| await knowledgeGraphManager.deleteRelations(args.relations, args.context, args.location); | ||
| return { content: [{ type: "text", text: "Relations deleted successfully" }] }; | ||
| case "read_graph": | ||
| return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.readGraph(), null, 2) }] }; | ||
| case "search_nodes": | ||
| return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.searchNodes(args.query), null, 2) }] }; | ||
| case "open_nodes": | ||
| return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.openNodes(args.names), null, 2) }] }; | ||
| case "aim_read_graph": | ||
| return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.readGraph(args.context, args.location), null, 2) }] }; | ||
| case "aim_search_nodes": | ||
| return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.searchNodes(args.query, args.context, args.location), null, 2) }] }; | ||
| case "aim_open_nodes": | ||
| return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.openNodes(args.names, args.context, args.location), null, 2) }] }; | ||
| case "aim_list_databases": | ||
| return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.listDatabases(), null, 2) }] }; | ||
| default: | ||
@@ -371,0 +699,0 @@ throw new Error(`Unknown tool: ${name}`); |
@@ -1,1 +0,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,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,CAAC,CAAC;AACzD,CAAC;AAED,oCAAoC;AACpC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/D,+DAA+D;AAC/D,MAAM,gBAAgB,GAAG,UAAU,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;AAoB5E,+FAA+F;AAC/F,MAAM,qBAAqB;IACjB,KA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AAO,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"} |
+5
-2
| { | ||
| "name": "mcp-knowledge-graph", | ||
| "version": "1.0.3", | ||
| "version": "1.2.0", | ||
| "description": "MCP server enabling persistent memory for AI models through a local knowledge graph", | ||
@@ -10,2 +10,5 @@ "license": "MIT", | ||
| "type": "module", | ||
| "engines": { | ||
| "node": ">=18.0.0" | ||
| }, | ||
| "bin": { | ||
@@ -32,2 +35,2 @@ "mcp-knowledge-graph": "dist/index.js" | ||
| } | ||
| } | ||
| } |
+207
-182
@@ -1,162 +0,206 @@ | ||
| # `mcp-knowledge-graph` | ||
| # MCP Knowledge Graph | ||
| > Knowledge Graph Memory Server | ||
| **Persistent memory for AI models through a local knowledge graph.** | ||
| An improved implementation of persistent memory using a local knowledge graph with a customizable `--memory-path`. | ||
| Store and retrieve information across conversations using entities, relations, and observations. Works with Claude Code/Desktop and any MCP-compatible AI platform. | ||
| 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. | ||
| ## Why ".aim" and "aim_" prefixes? | ||
| > [!NOTE] | ||
| > 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. | ||
| AIM stands for **AI Memory** - the core concept of this knowledge graph system. The three AIM elements provide clear organization and safety: | ||
| ## Server Name | ||
| - **`.aim` directories**: Keep AI memory files organized and easily identifiable | ||
| - **`aim_` tool prefixes**: Group related memory functions together in multi-tool setups | ||
| - **`_aim` safety markers**: Each memory file starts with `{"type":"_aim","source":"mcp-knowledge-graph"}` to prevent accidental overwrites of unrelated JSONL files | ||
| ```txt | ||
| mcp-knowledge-graph | ||
| ``` | ||
| This consistent AIM naming makes it obvious which directories, tools, and files belong to our AI memory system. | ||
|  | ||
| ## Storage Logic | ||
|  | ||
| **File Location Priority:** | ||
| ## Core Concepts | ||
| 1. **Project with `.aim`** - Uses `.aim/memory.jsonl` (project-local) | ||
| 2. **No project/no .aim** - Uses configured global directory | ||
| 3. **Contexts** - Adds suffix: `memory-work.jsonl`, `memory-personal.jsonl` | ||
| ### Entities | ||
| **Safety System:** | ||
| Entities are the primary nodes in the knowledge graph. Each entity has: | ||
| - Every memory file starts with `{"type":"_aim","source":"mcp-knowledge-graph"}` | ||
| - System refuses to write to files without this marker | ||
| - Prevents accidental overwrite of unrelated JSONL files | ||
| - A unique name (identifier) | ||
| - An entity type (e.g., "person", "organization", "event") | ||
| - A list of observations | ||
| ## Master Database Concept | ||
| Example: | ||
| **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`. | ||
| - **Default Behavior**: All memory operations use the master database unless you specify a different one | ||
| - **Always Available**: Exists in both project-local and global locations | ||
| - **Primary Storage**: Your main knowledge graph that persists across all conversations | ||
| - **Named Databases**: Optional additional databases (`work`, `personal`, `health`) for organizing specific topics | ||
| ## Key Features | ||
| - **Master Database**: Primary memory store used by default for all operations | ||
| - **Multiple Databases**: Optional named databases for organizing memories by topic | ||
| - **Project Detection**: Automatic project-local memory using `.aim` directories | ||
| - **Location Override**: Force operations to use project or global storage | ||
| - **Safe Operations**: Built-in protection against overwriting unrelated files | ||
| - **Database Discovery**: List all available databases in both locations | ||
| ## Quick Start | ||
| ### Global Memory (Recommended) | ||
| Add to your `claude_desktop_config.json` or `.claude.json`: | ||
| ```json | ||
| { | ||
| "name": "John_Smith", | ||
| "entityType": "person", | ||
| "observations": ["Speaks fluent Spanish"] | ||
| "mcpServers": { | ||
| "memory": { | ||
| "command": "npx", | ||
| "args": [ | ||
| "-y", | ||
| "mcp-knowledge-graph", | ||
| "--memory-path", | ||
| "/Users/yourusername/.aim/" | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
| ### Relations | ||
| This creates memory files in your specified directory: | ||
| Relations define directed connections between entities. They are always stored in active voice and describe how entities interact or relate to each other. | ||
| - `memory.jsonl` - **Master Database** (default for all operations) | ||
| - `memory-work.jsonl` - Work database | ||
| - `memory-personal.jsonl` - Personal database | ||
| - etc. | ||
| Example: | ||
| ### Project-Local Memory | ||
| ```json | ||
| { | ||
| "from": "John_Smith", | ||
| "to": "ExampleCorp", | ||
| "relationType": "works_at" | ||
| } | ||
| In any project, create a `.aim` directory: | ||
| ```bash | ||
| mkdir .aim | ||
| ``` | ||
| ### Observations | ||
| Now memory tools automatically use `.aim/memory.jsonl` (project-local **master database**) instead of global storage when run from this project. | ||
| Observations are discrete pieces of information about an entity. They are: | ||
| ## How AI Uses Databases | ||
| - Stored as strings | ||
| - Attached to specific entities | ||
| - Can be added or removed independently | ||
| - Should be atomic (one fact per observation) | ||
| 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: | ||
| Example: | ||
| ```json | ||
| // Master Database (default - no context needed) | ||
| aim_create_entities({ | ||
| entities: [{ | ||
| name: "John_Doe", | ||
| entityType: "person", | ||
| observations: ["Met at conference"] | ||
| }] | ||
| }) | ||
| ```json | ||
| { | ||
| "entityName": "John_Smith", | ||
| "observations": [ | ||
| "Speaks fluent Spanish", | ||
| "Graduated in 2019", | ||
| "Prefers morning meetings" | ||
| ] | ||
| } | ||
| // Work database | ||
| aim_create_entities({ | ||
| context: "work", | ||
| entities: [{ | ||
| name: "Q4_Project", | ||
| entityType: "project", | ||
| observations: ["Due December 2024"] | ||
| }] | ||
| }) | ||
| // Personal database | ||
| aim_create_entities({ | ||
| context: "personal", | ||
| entities: [{ | ||
| name: "Mom", | ||
| entityType: "person", | ||
| observations: ["Birthday March 15th"] | ||
| }] | ||
| }) | ||
| // Master database in specific location | ||
| aim_create_entities({ | ||
| location: "global", | ||
| entities: [{ | ||
| name: "Important_Info", | ||
| entityType: "reference", | ||
| observations: ["Stored in global master database"] | ||
| }] | ||
| }) | ||
| ``` | ||
| ## API | ||
| ## File Organization | ||
| ### Tools | ||
| **Global Setup:** | ||
| - **create_entities** | ||
| - Create multiple new entities in the knowledge graph | ||
| - Input: `entities` (array of objects) | ||
| - Each object contains: | ||
| - `name` (string): Entity identifier | ||
| - `entityType` (string): Type classification | ||
| - `observations` (string[]): Associated observations | ||
| - Ignores entities with existing names | ||
| ```tree | ||
| /Users/yourusername/.aim/ | ||
| ├── memory.jsonl # Master Database (default) | ||
| ├── memory-work.jsonl # Work database | ||
| ├── memory-personal.jsonl # Personal database | ||
| └── memory-health.jsonl # Health database | ||
| ``` | ||
| - **create_relations** | ||
| - Create multiple new relations between entities | ||
| - Input: `relations` (array of objects) | ||
| - Each object contains: | ||
| - `from` (string): Source entity name | ||
| - `to` (string): Target entity name | ||
| - `relationType` (string): Relationship type in active voice | ||
| - Skips duplicate relations | ||
| **Project Setup:** | ||
| - **add_observations** | ||
| - Add new observations to existing entities | ||
| - Input: `observations` (array of objects) | ||
| - Each object contains: | ||
| - `entityName` (string): Target entity | ||
| - `contents` (string[]): New observations to add | ||
| - Returns added observations per entity | ||
| - Fails if entity doesn't exist | ||
| ```tree | ||
| my-project/ | ||
| ├── .aim/ | ||
| │ ├── memory.jsonl # Project Master Database (default) | ||
| │ └── memory-work.jsonl # Project Work database | ||
| └── src/ | ||
| ``` | ||
| - **delete_entities** | ||
| - Remove entities and their relations | ||
| - Input: `entityNames` (string[]) | ||
| - Cascading deletion of associated relations | ||
| - Silent operation if entity doesn't exist | ||
| ## Available Tools | ||
| - **delete_observations** | ||
| - Remove specific observations from entities | ||
| - Input: `deletions` (array of objects) | ||
| - Each object contains: | ||
| - `entityName` (string): Target entity | ||
| - `observations` (string[]): Observations to remove | ||
| - Silent operation if observation doesn't exist | ||
| - `aim_create_entities` - Add new people, projects, events | ||
| - `aim_create_relations` - Link entities together | ||
| - `aim_add_observations` - Add facts to existing entities | ||
| - `aim_search_nodes` - Find information by keyword | ||
| - `aim_read_graph` - View entire memory | ||
| - `aim_open_nodes` - Retrieve specific entities by name | ||
| - `aim_list_databases` - Show all available databases and current location | ||
| - `aim_delete_entities` - Remove entities | ||
| - `aim_delete_observations` - Remove specific facts | ||
| - `aim_delete_relations` - Remove connections | ||
| - **delete_relations** | ||
| - Remove specific relations from the graph | ||
| - Input: `relations` (array of objects) | ||
| - Each object contains: | ||
| - `from` (string): Source entity name | ||
| - `to` (string): Target entity name | ||
| - `relationType` (string): Relationship type | ||
| - Silent operation if relation doesn't exist | ||
| ### Parameters | ||
| - **read_graph** | ||
| - Read the entire knowledge graph | ||
| - No input required | ||
| - Returns complete graph structure with all entities and relations | ||
| - `context` (optional) - Specify named database (`work`, `personal`, etc.). Defaults to **master database** | ||
| - `location` (optional) - Force `project` or `global` storage location. Defaults to auto-detection | ||
| - **search_nodes** | ||
| - Search for nodes based on query | ||
| - Input: `query` (string) | ||
| - Searches across: | ||
| - Entity names | ||
| - Entity types | ||
| - Observation content | ||
| - Returns matching entities and their relations | ||
| ## Database Discovery | ||
| - **open_nodes** | ||
| - Retrieve specific nodes by name | ||
| - Input: `names` (string[]) | ||
| - Returns: | ||
| - Requested entities | ||
| - Relations between requested entities | ||
| - Silently skips non-existent nodes | ||
| Use `aim_list_databases` to see all available databases: | ||
| ## Usage with MCP-Compatible Platforms | ||
| ```json | ||
| { | ||
| "project_databases": [ | ||
| "default", // Master Database (project-local) | ||
| "project-work" // Named database | ||
| ], | ||
| "global_databases": [ | ||
| "default", // Master Database (global) | ||
| "work", | ||
| "personal", | ||
| "health" | ||
| ], | ||
| "current_location": "project (.aim directory detected)" | ||
| } | ||
| ``` | ||
| 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. | ||
| **Key Points:** | ||
| ### Setup with Claude Desktop | ||
| - **"default"** = Master Database in both locations | ||
| - **Current location** shows whether you're using project or global storage | ||
| - **Master database exists everywhere** - it's your primary memory store | ||
| - **Named databases** are optional additions for specific topics | ||
| Add this to your claude_desktop_config.json: | ||
| ## Configuration Examples | ||
| **Important:** Always specify `--memory-path` to control where your memory files are stored. | ||
| **Home directory:** | ||
| ```json | ||
@@ -171,16 +215,5 @@ { | ||
| "--memory-path", | ||
| "/Users/shaneholloman/Dropbox/shane/db/memory.jsonl" | ||
| ], | ||
| "autoapprove": [ | ||
| "create_entities", | ||
| "create_relations", | ||
| "add_observations", | ||
| "delete_entities", | ||
| "delete_observations", | ||
| "delete_relations", | ||
| "read_graph", | ||
| "search_nodes", | ||
| "open_nodes" | ||
| "/Users/yourusername/.aim" | ||
| ] | ||
| }, | ||
| } | ||
| } | ||
@@ -190,10 +223,22 @@ } | ||
| ### Setup with Other AI Platforms | ||
| **Custom location (e.g., Dropbox):** | ||
| 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. | ||
| ```json | ||
| { | ||
| "mcpServers": { | ||
| "memory": { | ||
| "command": "npx", | ||
| "args": [ | ||
| "-y", | ||
| "mcp-knowledge-graph", | ||
| "--memory-path", | ||
| "/Users/yourusername/Dropbox/.aim" | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
| ### Custom Memory Path | ||
| **Auto-approve all operations:** | ||
| You can specify a custom path for the memory file: | ||
| ```json | ||
@@ -208,16 +253,14 @@ { | ||
| "--memory-path", | ||
| "/Users/shaneholloman/Dropbox/shane/db/memory.jsonl" | ||
| "/Users/yourusername/.aim" | ||
| ], | ||
| "autoapprove": [ | ||
| "create_entities", | ||
| "create_relations", | ||
| "add_observations", | ||
| "delete_entities", | ||
| "delete_observations", | ||
| "delete_relations", | ||
| "read_graph", | ||
| "search_nodes", | ||
| "open_nodes" | ||
| "aim_create_entities", | ||
| "aim_create_relations", | ||
| "aim_add_observations", | ||
| "aim_search_nodes", | ||
| "aim_read_graph", | ||
| "aim_open_nodes", | ||
| "aim_list_databases" | ||
| ] | ||
| }, | ||
| } | ||
| } | ||
@@ -227,49 +270,31 @@ } | ||
| If no path is specified, it will default to memory.jsonl in the server's installation directory. | ||
| ## Troubleshooting | ||
| ### System Prompt | ||
| **"File does not contain required _aim safety marker" error:** | ||
| 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. | ||
| - The file may not belong to this system | ||
| - Manual JSONL files need `{"type":"_aim","source":"mcp-knowledge-graph"}` as first line | ||
| - If you created the file manually, add the `_aim` marker or delete and let the system recreate it | ||
| 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. | ||
| **Memories going to unexpected locations:** | ||
| ```txt | ||
| Follow these steps for each interaction: | ||
| - Check if you're in a project directory with `.aim` folder (uses project-local storage) | ||
| - Otherwise uses the configured global `--memory-path` directory | ||
| - Use `aim_list_databases` to see all available databases and current location | ||
| - Use `ls .aim/` or `ls /Users/yourusername/.aim/` to see your memory files | ||
| 1. User Identification: | ||
| - You should assume that you are interacting with default_user | ||
| - If you have not identified default_user, proactively try to do so. | ||
| **Too many similar databases:** | ||
| 2. Memory Retrieval: | ||
| - Always begin your chat by saying only "Remembering..." and retrieve all relevant information from your knowledge graph | ||
| - Always refer to your knowledge graph as your "memory" | ||
| - AI models try to use consistent names, but may create variations | ||
| - Manually delete unwanted database files if needed | ||
| - Encourage AI to use simple, consistent database names | ||
| - **Remember**: Master database is always available as the default - named databases are optional | ||
| 3. Memory Gathering: | ||
| - While conversing with the user, be attentive to any new information that falls into these categories: | ||
| a) Basic Identity (age, gender, location, job title, education level, etc.) | ||
| b) Behaviors (interests, habits, etc.) | ||
| c) Preferences (communication style, preferred language, etc.) | ||
| d) Goals (goals, targets, aspirations, etc.) | ||
| e) Relationships (personal and professional relationships up to 3 degrees of separation) | ||
| ## Requirements | ||
| 4. Memory Update: | ||
| - If any new information was gathered during the interaction, update your memory as follows: | ||
| a) Create entities for recurring organizations, people, and significant events | ||
| b) Connect them to the current entities using relations | ||
| c) Store facts about them as observations | ||
| ``` | ||
| - Node.js 18+ | ||
| - MCP-compatible AI platform | ||
| ## Integration with Other AI Models | ||
| 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. | ||
| To integrate with other models: | ||
| 1. Configure the model to access the MCP server | ||
| 2. Ensure the model can make function calls to the exposed tools | ||
| 3. Adapt the system prompt to the specific model's instruction format | ||
| 4. Use the same knowledge graph operations regardless of the model | ||
| ## License | ||
| 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. | ||
| MIT |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
66900
67.28%662
81.37%297
9.19%4
100%