
Titan Memory MCP Server

2025.03.20
47
TypeScript神经记忆系统LLM记忆管理开发效率
Titan Memory MCP Server 是一个为LLM(如Claude 3.7 Sonnet)设计的神经记忆系统,能够学习和预测序列,并通过记忆向量保持状态。它提供了一套工具,使得LLM能够在交互过程中维持记忆状态,适用于Cursor等开发环境。
View on GitHub
Overview
产品定位
Titan Memory MCP Server 是一个神经记忆系统,专为LLM设计,用于在交互过程中维持记忆状态,提高开发效率。
核心功能
- 神经记忆架构:基于Transformer的记忆系统,能够学习和预测序列
- 记忆管理:高效的张量操作,自动内存清理
- MCP集成:完全兼容Cursor和其他MCP客户端
- 文本编码:将文本输入转换为张量表示
- 记忆持久化:在会话之间保存和加载记忆状态
适用场景
- 在Cursor等开发环境中自动运行,无需人工干预
- 为LLM提供独立的记忆系统,不受LLM版本限制
- 在开发过程中维持代码和上下文的记忆状态
工具列表
help
:获取可用工具的帮助信息init_model
:初始化Titan Memory模型forward_pass
:通过模型进行前向传递以获取预测train_step
:执行训练步骤以更新模型get_memory_state
:获取当前记忆状态和统计信息manifold_step
:沿流形方向更新记忆prune_memory
:删除不太相关的记忆以释放空间save_checkpoint
:将记忆状态保存到文件load_checkpoint
:从文件加载记忆状态reset_gradients
:重置累积的梯度以从训练问题中恢复
常见问题解答
- 如何初始化模型?:使用
init_model
工具,可以自定义配置参数 - 如何保存和加载记忆状态?:使用
save_checkpoint
和load_checkpoint
工具 - 如何训练模型?:使用
train_step
工具,提供当前和下一个输入
使用教程
使用依赖
确保已安装Node.js和npm。
安装教程
# Clone the repository
git clone https://github.com/yourusername/titan-memory.git
cd titan-memory
# Install dependencies
npm install
# Build the project
npm run build
# Start the server
npm start
调试方式
启动服务器后,可以使用以下命令进行基本调试:
// Initialize the model
const result = await callTool("init_model", {
inputDim: 768,
memorySlots: 10000,
transformerLayers: 8,
});
// Perform a forward pass
const { predicted, memoryUpdate } = await callTool("forward_pass", {
x: "const x = 5;", // or vector: [0.1, 0.2, ...]
memoryState: currentMemory,
});
// Train the model
const result = await callTool("train_step", {
x_t: "function hello() {",
x_next: " console.log('world');",
});
// Get memory state
const state = await callTool("get_memory_state", {});