Skip to main content

MCP Server for AI long-term memory and context management

Project description

🧠 MindCore Memory MCP

让 AI 记住一切,不再遗忘。生产级长期记忆 MCP Server。

"The best AI agent isn't the smartest — it's the one that remembers."

GitHub stars License: MIT Python 3.10+ woshilaohei/mindcore-memory-mcp MCP server

⚡ 一句话价值

MindCore Memory 解决 AI Agent 最大痛点:上下文窗口有限、长对话信息丢失、跨session记忆断裂。


🎯 解决什么问题

痛点 现状 MindCore Memory
AI 上下文忘性大 对话结束什么都忘 ✅ 持久化长期记忆
跨session无法回忆 每次都重新教 ✅ 跨会话知识复用
记忆混乱无优先级 所有记忆权重一样 ✅ 重要性分级+置信度
RAG暴力灌入 上下文过载质量下降 ✅ 精准上下文窗口

🚀 3行上手

# 1. 安装
pip install mindcore-memory

# 2. 启动 MCP Server
mindcore-memory

# 3. 在你的 AI Agent 中调用
memory_id = memory_store("用户说他叫张三,周三有空")
context = memory_recall("用户的时间安排")

📊 Eval Framework 实测

✅ Storage Integrity:     100% (存储持久化正确)
✅ Recall Relevance:      100% (相关记忆优先召回)
✅ Confidence Calibration: 100% (置信度正确校准)
✅ Importance Weighting:  100% (高优先级记忆排名靠前)
✅ Context Efficiency:    100% (上下文窗口不过载)

Overall Score: 100%

📈 Star History

Star History Chart


🔧 核心工具

memory_store - 存储记忆

memory_store(
    content="Python是荷兰人Guido van Rossum创建的",
    importance=3,        # 1-4级重要性
    tags=["python", "history"],
    confidence=0.95,      # 置信度
    source="agent"       # agent/user/tool
)

memory_recall - 召回记忆

memory_recall(
    query="Python创始人是谁",
    tags=["python"],      # 可选标签过滤
    limit=10             # 返回数量
)

memory_context - 构建上下文窗口

# 为当前任务构建最优上下文(自动去重+优先级排序)
context = memory_context(
    query="当前项目状态",
    max_tokens=2000      # 自动截断
)

memory_stats - 系统状态

# 查看记忆统计:总数/分布/置信度
stats = memory_stats()

💰 开源说明

本项目为开源项目(MIT License),代码完全免费。存储层使用本地 JSON 文件,无云服务依赖,无数据收集。如需商业合作或定制开发,欢迎联系作者。


🤝 支持

如果 MindCore Memory 对你有帮助:

  • ⭐ 给仓库点个 Star
  • 🐛 提交 Issue 反馈问题
  • 🔧 提交 PR 贡献代码

🏗️ 项目结构

mindcore-memory-mcp/
├── mindcore_memory/          # Python 包(pip install 入口)
│   ├── __init__.py
│   ├── memory_engine.py      # 核心记忆引擎
│   ├── server.py             # MCP Server(stdio+HTTP双传输)
│   ├── http_app.py           # HTTP端点(生产部署)
│   └── eval_framework.py     # 评测框架
├── tests/
│   └── test_memory.py        # 单元测试
├── examples/
│   └── basic_usage.py        # 使用示例
├── .github/workflows/
│   └── ci.yml                # CI/CD
├── pyproject.toml
├── README.md
└── LICENSE

🔌 集成方式

Claude Desktop

{
  "mcpServers": {
    "mindcore-memory": {
      "command": "pip",
      "args": ["install", "mindcore-memory"]
    }
  }
}

VS Code AI

直接在扩展市场搜索 MindCore Memory

HTTP API(生产环境)

curl -X POST http://localhost:8080/mcp \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"memory_store","arguments":{"content":"test"}},"id":1}'

📐 生产级标准

标准 实现
JSON-RPC 2.0 ✅ stdio + HTTP 双传输
Bearer Token认证 ✅ HTTP端点可选认证
输入验证 ✅ Pydantic schemas
CI/CD ✅ GitHub Actions
单元测试 ✅ pytest + 覆盖率
Eval Framework ✅ 5项核心指标
可观测性 ✅ structlog完整日志
用户数据主权 ✅ JSONL本地文件,无vendor lock-in

🤝 贡献

欢迎提交 Issue 和 PR!

📄 许可证

MIT License - 详见 LICENSE



让 AI 拥有记忆,让人类更信任 AI。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mindcore_memory-0.1.3.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mindcore_memory-0.1.3-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file mindcore_memory-0.1.3.tar.gz.

File metadata

  • Download URL: mindcore_memory-0.1.3.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for mindcore_memory-0.1.3.tar.gz
Algorithm Hash digest
SHA256 f075152cb754c2166520bee9249ef0004ccb200b0d4809b65c3bbb78a1d1f2eb
MD5 0ebbe5725f5a5de44d1e7b8606c19504
BLAKE2b-256 cb45700f29a5d55f8bda78bc5a0fb984e13a12ceb16b9f5aa457d06d5f603cd6

See more details on using hashes here.

File details

Details for the file mindcore_memory-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for mindcore_memory-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9f5ccfa3f60445a590ab959fdb7156caed9c826f16d7da868daebaf91249f30f
MD5 806cae1a03388282bb9b0545a185cf5c
BLAKE2b-256 87bb1fe611baa16661a739f78ffbf42540d7464254502863b9551d8aa5e0fe15

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page