📖 KeepThinking 使用文档

KeepThinking — AI 的第二大脑。全球唯一跨平台本地 AI 记忆引擎。开源、免费、零上传。

🚀 安装

打开终端,粘贴下面一行:

curl -sL https://keepthinking.vip/install | bash

支持 macOS / Linux,需 Node.js ≥ 18。安装后浏览器访问 localhost:3456 进入 Web 控制台。

无需令牌、无需注册、无需登录。安装即用,完全免费。

⏹ 卸载

# 停止服务
systemctl --user stop keepthinking

# 删除所有文件和记忆数据
rm -rf ~/.keepthinking
rm -f ~/.config/systemd/user/keepthinking.service

🌐 MCP 多客户端配置

KeepThinking MCP Server 基于标准 JSON-RPC 2.0 协议。一份记忆,所有 AI 工具共享。

详细配置指南:MCP_SETUP.md

Claude Desktop

// ~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "keepthinking": {
      "command": "node",
      "args": ["~/.keepthinking/mcp/server.js"]
    }
  }
}

Cursor

// 项目根目录 .cursor/mcp.json
{
  "mcpServers": {
    "keepthinking": {
      "command": "node",
      "args": ["~/.keepthinking/mcp/server.js"]
    }
  }
}

VS Code + Cline

Cline 设置 → MCP Servers → 添加 stdio server:Name keepthinking,Command node,Args ~/.keepthinking/mcp/server.js

Windsurf

项目根目录创建 .windsurf/mcp.json,内容同 Cursor。

🔧 MCP 工具列表

工具功能
search_memory关键词搜索认知图谱和历史决策
search_semantic本地 AI 语义向量搜索——理解含义
get_context获取完整项目上下文(认知图谱+Git信息)
list_projects列出所有已知项目及统计
cognitive_graph返回完整认知图谱(节点+边)
engine_status引擎健康状态:节点数、磁盘、内存

🖥 Web 控制台

安装后浏览器访问 http://localhost:3456

📡 HTTP API

所有 API 仅监听 127.0.0.1:3456,不对外暴露。

端点说明
GET /api/health健康检查
GET /api/stats引擎统计(节点/边/磁盘/内存)
GET /api/projects项目列表
GET /api/context?project=xxx项目上下文
GET /api/search?q=xxx&max=10关键词搜索
GET /api/search/semantic?q=xxx&max=10语义搜索
GET /api/graph?project=xxx认知图谱

🔒 隐私与安全

📁 数据目录结构

~/.keepthinking/
├── memory/
│   ├── graph.json         # 认知图谱(节点+边)
│   ├── experiences.json   # 任务经验记录
│   ├── decisions.json     # 决策记录
│   └── embed_cache.json   # 语义向量缓存
├── mcp/
│   └── server.js          # MCP stdio server
├── server/
│   └── server.js          # HTTP 控制台服务
└── web/
    └── console.html       # Web 管理界面

← 返回首页