### Start MCP Server Source: https://github.com/t1nker-1220/memories-with-lessons-mcp-server/blob/main/README.md Instructions on how to start the built MCP server using Node.js. ```bash node /path/to/the/dist/index.js ``` -------------------------------- ### System Prompt for Chat Personalization Source: https://github.com/t1nker-1220/memories-with-lessons-mcp-server/blob/main/README.md An example system prompt to guide the model in chat personalization, focusing on user identification, memory retrieval, and memory updates. ```string Follow these steps for each interaction: 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. 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" 3. Memory - 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) 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 b) Store facts about them as observations ``` -------------------------------- ### Clone and Build MCP Server Source: https://github.com/t1nker-1220/memories-with-lessons-mcp-server/blob/main/README.md Steps to clone the repository, install dependencies, and build the MCP server project using pnpm. ```bash git clone [repository-url] cd [repository-name] pnpm install pnpm build ``` -------------------------------- ### Configure Claude Desktop with NPX and Custom Environment Variable Source: https://github.com/t1nker-1220/memories-with-lessons-mcp-server/blob/main/README.md Configuration for Claude Desktop using NPX with a custom environment variable for memory file path. ```json { "mcpServers": { "memory": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-memory" ], "env": { "MEMORY_FILE_PATH": "/path/to/custom/memory.json" } } } } ``` -------------------------------- ### Lesson Management Tools Source: https://github.com/t1nker-1220/memories-with-lessons-mcp-server/blob/main/README.md Tools for creating, managing, and recommending lessons based on error patterns and context. Includes detailed lesson creation with error analysis and success tracking. ```APIDOC create_lesson(lesson: dict) Creates a new lesson from an error and its solution. Input: lesson (object): - name (string): Unique identifier - entityType (string): Must be "lesson" - observations (string[]): Notes about the error and solution - errorPattern (object): - type (string): Category of error - message (string): Error message - context (string): Where error occurred - stackTrace (string, optional): Stack trace - metadata (object): - severity ("low" | "medium" | "high" | "critical") - environment (object): System details - frequency (number): Times encountered - successRate (number): Solution success rate - verificationSteps (array): - Each step contains: - command (string): Action to take - expectedOutput (string): Expected result - successIndicators (string[]): Success markers Automatically initializes metadata timestamps. Validates all required fields. find_similar_errors(errorPattern: dict) Finds similar errors and their solutions. Input: errorPattern (object): - type (string): Error category - message (string): Error message - context (string): Error context Returns matching lessons sorted by success rate. Uses fuzzy matching for error messages. update_lesson_success(lessonName: string, success: boolean) Updates success tracking for a lesson. Input: lessonName (string): Lesson to update. success (boolean): Whether solution worked. Updates success rate (weighted average) and frequency counter. get_lesson_recommendations(context: string) Gets relevant lessons for the current context. Input: context (string): The current context for recommendations. Searches across error type, message, context, and lesson observations. Returns lessons sorted by context relevance and success rate. Includes full solution details. ``` -------------------------------- ### MCP Server Tools Source: https://github.com/t1nker-1220/memories-with-lessons-mcp-server/blob/main/README.md Documentation for the tools available in the MCP server for lesson management and recommendations. ```APIDOC Tools: - create_lesson - Description: Create a new lesson from an error and its solution. - Input: `lesson` (object) - Contains error pattern, solution steps, and metadata. - Automatically tracks creation time and updates. - Verifies solution steps are complete. - find_similar_errors - Description: Find similar errors and their solutions. - Input: `errorPattern` (object) - Contains error type, message, and context. - Returns matching lessons sorted by success rate. - Includes related solutions and verification steps. - update_lesson_success - Description: Update success tracking for a lesson. - Input: - `lessonName` (string): Lesson to update. - `success` (boolean): Whether solution worked. - Updates success rate and frequency metrics. - get_lesson_recommendations - Description: Get relevant lessons for current context. - Input: `context` (string). - Returns lessons sorted by relevance and success rate. - Includes full solution details and verification steps. ``` -------------------------------- ### Configure Claude Desktop with NPX Source: https://github.com/t1nker-1220/memories-with-lessons-mcp-server/blob/main/README.md Configuration for Claude Desktop to use the MCP memory server via NPX. ```json { "mcpServers": { "memory": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-memory" ] } } } ``` -------------------------------- ### Configure Claude Desktop with Docker Source: https://github.com/t1nker-1220/memories-with-lessons-mcp-server/blob/main/README.md Configuration for Claude Desktop to use the MCP memory server via Docker. ```json { "mcpServers": { "memory": { "command": "docker", "args": ["run", "-i", "-v", "claude-memory:/app/dist", "--rm", "mcp/memory"] } } } ``` -------------------------------- ### Build Docker Image for MCP Memory Server Source: https://github.com/t1nker-1220/memories-with-lessons-mcp-server/blob/main/README.md Command to build the Docker image for the MCP memory server. ```dockerfile docker build -t mcp/memory -f src/memory/Dockerfile . ``` -------------------------------- ### Knowledge Graph Management Tools Source: https://github.com/t1nker-1220/memories-with-lessons-mcp-server/blob/main/README.md Provides a comprehensive set of tools for interacting with the knowledge graph, including entity and relation manipulation, data retrieval, and search functionalities. ```APIDOC create_entities(entities: list[dict]) Creates multiple new entities in the knowledge graph. Input: entities (array of objects): - name (string): Entity identifier - entityType (string): Type classification - observations (string[]): Associated observations Ignores entities with existing names. create_relations(relations: list[dict]) Creates multiple new relations between entities. Input: relations (array of objects): - from (string): Source entity name - to (string): Target entity name - relationType (string): Relationship type in active voice Skips duplicate relations. add_observations(observations: list[dict]) Adds new observations to existing entities. Input: observations (array of objects): - entityName (string): Target entity - contents (string[]): New observations to add Returns added observations per entity. Fails if entity doesn't exist. delete_entities(entityNames: list[string]) Removes entities and their relations. Input: entityNames (string[]): Names of entities to delete. Cascading deletion of associated relations. Silent operation if entity doesn't exist. delete_observations(deletions: list[dict]) Removes specific observations from entities. Input: deletions (array of objects): - entityName (string): Target entity - observations (string[]): Observations to remove Silent operation if observation doesn't exist. delete_relations(relations: list[dict]) Removes specific relations from the graph. Input: relations (array of objects): - from (string): Source entity name - to (string): Target entity name - relationType (string): Relationship type Silent operation if relation doesn't exist. read_graph() Reads the entire knowledge graph. No input required. Returns complete graph structure with all entities and relations. search_nodes(query: string) Searches for nodes based on a query. Input: query (string): The search query. Searches across entity names, entity types, and observation content. Returns matching entities and their relations. open_nodes(names: list[string]) Retrieves specific nodes by name. Input: names (string[]): Names of the nodes to retrieve. Returns requested entities and relations between them. Silently skips non-existent nodes. ``` -------------------------------- ### Lesson Structure Source: https://github.com/t1nker-1220/memories-with-lessons-mcp-server/blob/main/README.md Defines the structure for lessons, which capture knowledge about errors, solutions, and their context, including metadata and verification steps. ```json { "name": "NPM_VERSION_MISMATCH_01", "entityType": "lesson", "observations": [ "Error occurs when using incompatible package versions", "Affects Windows environments specifically", "Resolution requires version pinning" ], "errorPattern": { "type": "dependency", "message": "Cannot find package @shadcn/ui", "context": "package installation" }, "metadata": { "severity": "high", "environment": { "os": "windows", "nodeVersion": "18.x" }, "createdAt": "2025-02-13T13:21:58.523Z", "updatedAt": "2025-02-13T13:22:21.336Z", "frequency": 1, "successRate": 1.0 }, "verificationSteps": [ { "command": "pnpm add shadcn@latest", "expectedOutput": "Successfully installed shadcn", "successIndicators": ["added shadcn"] } ] } ``` -------------------------------- ### Observation Structure Source: https://github.com/t1nker-1220/memories-with-lessons-mcp-server/blob/main/README.md Defines how observations (pieces of information) are attached to entities in the knowledge graph. ```json { "entityName": "John_Smith", "observations": [ "Speaks fluent Spanish", "Graduated in 2019", "Prefers morning meetings" ] } ``` -------------------------------- ### Entity Structure Source: https://github.com/t1nker-1220/memories-with-lessons-mcp-server/blob/main/README.md Defines the structure of an entity in the knowledge graph, including its unique name, type, and associated observations. ```json { "name": "John_Smith", "entityType": "person", "observations": ["Speaks fluent Spanish"] } ``` -------------------------------- ### Relation Structure Source: https://github.com/t1nker-1220/memories-with-lessons-mcp-server/blob/main/README.md Defines the structure for relations between entities in the knowledge graph, representing directed connections. ```json { "from": "John_Smith", "to": "Anthropic", "relationType": "works_at" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.