JK

jakedismo/kuzumem-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

24 stars 7 forks 质量 58 趋势 10

基于 KuzuDB 的内存库,用于使用 TypeScript 构建的代码代理,并遵循 MCP 协议

概览

一种基于 TypeScript 实现的分布式内存银行,作为 MCP(模型上下文协议)工具,存储内存在具备存储库和分支过滤功能。分支隔离通过使用图唯一标识符实现,实现集中存储库,同时支持仓库特定和分支视图。完全符合 MCP 规范,实现与集成环境(IDE)和 AI 代理的无缝集成。 - - 高级推理模型(OpenAI o3/o4-mini,Claude 4)支持MCP采样,用于智能内存管理 - - 自动快照系统,保证回滚功能 - - MCP采样分析实际内存状态以制定自适应优化策略 - - 12个整合工具涵盖所有内存库操作 - - 确保每个资源仅实例化一次,且线程安全良好 - - 遵循高级内存库规范,使用KùzuDB图 - - 所有操作均按仓库名称和分支进行上下文化 - - 用途......

概述(AI 翻译)

一种基于 TypeScript 实现的分布式内存银行,作为 MCP(模型上下文协议)工具,将内存存储在具备仓库和分支过滤功能的 **KùzuDB 图数据库中。分支隔离通过使用图唯一标识符实现,实现集中存储库,同时支持仓库特定和分支特定视图。完全符合 MCP 规范,实现与 IDE 和 AI 代理的无缝集成。

主要特色

  • ** 🧠 AI驱动内存优化** - 高级推理模型(OpenAI o3/o4-mini,Claude 4),采用MCP采样实现智能内存管理
  • ** 🛡️ 生产准备安全** - 自动快照系统,保证回滚功能
  • ** 🎯 上下文感知智能** - MCP采样分析实际内存状态以实现自适应优化策略
  • ** 🔧 统一工具架构** - 12个涵盖所有内存库操作的整合工具
  • ** 🧵 线程安全的单例模式** - 确保每个资源仅实例化一次,且有适当的线程安全
  • ** 📊 分布式图结构** - 遵循使用 KùzuDB 图的高级内存库规范

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

KuzuMem-MCP

A TypeScript implementation of a distributed memory bank as an MCP (Model Context Protocol) tool, storing memories in a KùzuDB graph database with repository and branch filtering capabilities. Branch isolation is achieved by using a graph-unique identifier for entities, enabling a centralized memory bank while allowing repository-specific and branch-specific views. Fully compliant with MCP specification for seamless integration with IDEs and AI agents.

Key Features

  • 🧠 AI-Powered Memory Optimization - Advanced reasoning models (OpenAI o3/o4-mini, Claude 4) with MCP sampling for intelligent memory management
  • 🛡️ Production-Ready Safety - Automatic snapshot system with guaranteed rollback capabilities
  • 🎯 Context-Aware Intelligence - MCP sampling analyzes actual memory state for adaptive optimization strategies
  • 🔧 Unified Tool Architecture - 12 consolidated tools covering all memory bank operations
  • 🧵 Thread-Safe Singleton Pattern - Ensures each resource is instantiated only once, with proper thread safety
  • 📊 Distributed Graph Structure - Follows the advanced memory bank specification using a KùzuDB graph
  • 🌿 Repository & Branch Awareness - All operations are contextualized by repository name and branch
  • ⚡ Asynchronous Operations - Uses async/await for better performance
  • 🔌 Multiple Access Interfaces - Access via CLI and multiple MCP server implementations
  • 💾 KùzuDB Backend - Utilizes KùzuDB for graph-based memory storage and querying
  • ✅ Fully MCP Compliant - All tools follow the Model Context Protocol for client integration
  • 📡 Progressive Results Streaming - Supports streaming for long-running graph operations
  • 🏠 Client Project Root Isolation - Each client project gets its own isolated database instance
  • 🧠 High-Reasoning Analysis - Leverages OpenAI HIGH reasoning and Anthropic extended thinking for memory optimization
  • 🗑️ Safe Bulk Operations - Advanced bulk deletion with dependency validation and dry-run capabilities

Unified Tools

The system currently broadcasts 12 unified tools that consolidate all memory bank operations:

  1. memory-bank - Initialize and manage memory bank metadata
  2. entity - Create, update, delete, and retrieve all entity types (components, decisions, rules, files, tags)
  3. introspect - Explore graph schema and metadata
  4. context - Manage work session context
  5. query - Unified search across contexts, entities, relationships, dependencies, governance, history, and tags
  6. associate - Create relationships between entities
  7. analyze - Run graph algorithms (PageRank, K-Core, Louvain, Shortest Path)
  8. detect - Detect patterns (strongly/weakly connected components)
  9. bulk-import - Efficient bulk entity import
  10. search - Full-text search across all entity types with KuzuDB FTS integration
在 GitHub 查看完整 README

安装

npx -y ts-node /absolute/path/to/kuzumem-mcp/src/mcp-stdio-server.ts
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "KuzuMem-MCP": { "command": "npx", "args": ["-y", "ts-node", "/absolute/path/to/kuzumem-mcp/src/mcp-stdio-server.ts"], "env": { "PORT": "3000", "HOST": "localhost", "DB_FILENAME": "memory-bank.kuzu", "HTTP_STREAM_PORT": "3001" } } } }