cognitive-harness-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cognitive-harness-mcp remember that I prefer concise responses"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AIGC: ContentProducer: '001191110102MAD55U9H0F10002' ContentPropagator: '001191110102MAD55U9H0F10002' Label: '1' ProduceID: '0bf1a272-39fc-4f88-8fad-189948a77516' PropagateID: '0bf1a272-39fc-4f88-8fad-189948a77516' ReservedCode1: '38e2655c-0184-453c-9751-e961162b2613' ReservedCode2: '38e2655c-0184-453c-9751-e961162b2613'
cognitive-harness-mcp
认知 Harness 的 TeleAgent MCP Server — 让 LLM Agent 具备用户认知记忆能力。
Related MCP server: agent-memory
能力
通过 MCP 工具为 TeleAgent 提供认知记忆中间件:
工具 | 说明 |
| 按关键词/类型/生活域检索用户记忆(支持分页) |
| 写入用户认知记忆(七类内容 × 三轴模型,自动元数据) |
| 更新记忆字段 |
| 删除/版本化降级记忆 |
| 获取压缩认知画像(交互偏好/核心画像/分域认知/已知事实/待跟进) |
| 记忆统计(总量/类型分布/域分布/规则数) |
| 列出全部记忆(分页) |
架构
cognitive-harness-mcp/
├── package.json
├── tsconfig.json
├── src/
│ ├── index.ts # MCP Server 入口(stdio)
│ ├── core/ # 复用认知 Harness 核心逻辑(纯 TS,零 Cordis 依赖)
│ │ ├── index.ts
│ │ ├── types.ts # 七类内容 × 三轴认知模型
│ │ ├── mode-types.ts
│ │ ├── events.ts
│ │ ├── store.ts # FileMemoryStore + resolveConflict
│ │ ├── summary.ts # SummaryService(认知摘要)
│ │ ├── recall.ts # RecallInjector + 记忆工具接口
│ │ ├── id.ts
│ │ └── ingest.ts
│ ├── services/
│ │ └── memory-service.ts # MemoryService(存储+摘要封装)
│ └── tools/
│ ├── registry.ts # 工具注册助手
│ └── memory-tools.ts # 7 个认知记忆工具
└── dist/ # 构建产物(node dist/index.js)构建
npm install
npm run build部署(TeleAgent,stdio)
构建:
npm run build在 TeleAgent「工具设置 → MCP 配置」中添加以下 JSON:
{
"mcpServers": {
"cognitive-harness": {
"command": "node",
"args": ["/Users/gwen/Desktop/vibe coding 项目/认知 harness/cognitive-harness-mcp/dist/index.js"]
}
}
}保存后确认 MCP 状态为「已连接」
环境变量(可选)
变量 | 说明 | 默认值 |
| 记忆 JSON 文件路径 |
|
记忆文件
记忆持久化为人类可读 JSON(默认存于 TeleAgent 记忆目录),可人工编辑/预填。格式为 MemoryEntry[](见 src/core/types.ts)。
设计要点
规则类记忆(protocol/pragmatic)必须带因果说明(记"为什么"而非扁平结论)
支持版本化降级(
cognitive_forget的 degrade 模式),用户想法变了不删旧规则,降级保留证据认知摘要为压缩画像,token 消耗对数增长
复用自研认知 Harness 核心(
认知 harness仓库),仅去掉 Cordis 依赖
License
MIT
Available Tools
7 toolscognitive_forget遗忘用户认知记忆ADestructive
删除或降级一条用户记忆。默认 degrade(版本化降级):保留证据链、置信度减半,适用于"用户想法变了"的场景;delete 为彻底删除,不可恢复,请谨慎使用。
Args: memory_id: 要遗忘的记忆 ID mode: 'degrade'(默认,版本化降级)| 'delete'(彻底删除) reason: 遗忘原因,可选
Returns: { "success": boolean, "mode": string }
Inputs: memory_id (required), mode, reason.
cognitive_list列出用户全部记忆BRead-onlyIdempotent
按时间倒序列出全部用户记忆(分页)。用于浏览记忆全貌。默认返回最近 20 条。
Inputs: limit, offset.
cognitive_search搜索用户认知记忆ARead-onlyIdempotent
按关键词、内容类型、生活域等条件检索用户认知记忆,返回与查询最相关的记忆条目(按置信度降序,支持分页)。
当对话涉及用户的历史偏好、身份背景、正在进行的项目、过往事件时,先调用此工具获取上下文再作答,避免凭猜测回复。
Args:
keyword (string, optional): 关键词,匹配记忆内容子串
type (string, optional): 内容类型过滤:fact/protocol/pragmatic/emotion/value/procedure/episodic
domain (string, optional): 生活域过滤:career/family/intimate/health/finance/entertainment/social/growth/basic_cognition/uncategorized
scope (array[string], optional): 场景标签过滤
include_dynamic (boolean, default true): 是否包含动态内容
limit (number, default 20): 返回条数上限
offset (number, default 0): 分页偏移
Returns(结构化): { "total": number, // 总命中数 "count": number, // 本次返回数 "offset": number, "has_more": boolean, // 是否还有更多 "entries": [{ id, type, content, domain, depth, confidence, rule_status, scope, timestamp, is_dynamic, pending_follow_up }] }
Examples:
"我记得用户说过他喜欢什么" -> keyword="喜欢"
"查一下用户工作相关的记忆" -> domain="career"
"用户对 PPT 有什么偏好" -> keyword="PPT"
Error:
无匹配时返回 total=0 的空列表,不是错误
Inputs: type, limit, scope, domain, +3 more.
cognitive_stats用户记忆统计ARead-onlyIdempotent
返回记忆存储的统计信息:总量、按类型分布、按领域分布、确认规则数。用于了解记忆覆盖面。
Inputs: no named parameters.
cognitive_summary获取用户认知摘要ARead-onlyIdempotent
获取压缩的用户认知画像("印象"):交互偏好、核心画像、分域认知、已知事实、待跟进。适用于对话开始、或需要全面理解用户时。比逐条检索更高效。
Args: format: 'system_prompt'(默认,返回带引导语的注入片段)| 'markdown'(纯摘要)
Returns: { "summary": string, "memory_count": number }
Inputs: format.
cognitive_update更新用户认知记忆AIdempotent
更新一条已存在的记忆的部分字段。找不到该记忆时返回错误。
Args:
memory_id (string): 要更新的记忆 ID(可从 cognitive_search / cognitive_list 获取)
content / type / scope / confidence / domain / is_dynamic / pending_follow_up: 需要更新的字段
Returns: { "success": boolean, "memory": { 更新后的完整条目 } 或 null }
Inputs: memory_id (required), type, scope, domain, +4 more.
cognitive_write写入用户认知记忆A
写入一条关于用户的认知记忆。适用于对话中出现的:客观事实、明确的偏好或规则、表达的真实含义、情绪模式、价值观、工作流程、重要事件。
规则类记忆(protocol/pragmatic)必须带因果说明:记录"为什么"而不是扁平结论。例如不要只记"用户发长段落时不要直接执行",而要记"用户长文+探讨意图=头脑风暴的邀请,直接动手会打断思路"。
Args:
type (string, 必填): 内容类型,见下方枚举说明
content (string 或 object): 记忆内容
domain (string, 可选): 主生活域
scope (string[], 可选): 场景标签
depth (string, 可选): D1-D4 抽象深度,默认 D1
confidence (number, 0-1, 默认 0.7): 置信度
is_dynamic (boolean, 默认 false): 动态内容
pending_follow_up (boolean, 默认 false): 待跟进
Returns: { "memory_id": string, // 新记忆 ID "type": string, "content": ..., "domain": string, "confidence": number }
Inputs: type (required), content (required), depth, scope, +6 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool targets a distinct operation: search, list, stats, summary, write, update, and forget are clearly separated by purpose. Search and list both retrieve memories but are differentiated by query-based filtering versus chronological browsing.
All tools share the cognitive_ prefix and mostly use verb-style names like cognitive_search, cognitive_write, and cognitive_update. The pattern is slightly weakened by noun-style names cognitive_stats and cognitive_summary, but the convention remains highly predictable.
Seven tools is well-scoped for a memory management server: full CRUD plus search, statistics, and aggregated summary. Each tool earns its place without redundancy or bloat.
The tool surface fully covers the memory lifecycle: write, read via search/list/summary, update, and forget with both degrade and delete modes. The addition of stats and summary fills retrieval and introspection needs, leaving no obvious gaps.
Maintenance
Related MCP Connectors
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Cross-tool persistent memory and context for AI assistants over MCP.
Hosted agent memory: store, search, and recall facts across sessions from any MCP client.
Persistent memory for AI agents to retain, retrieve, and recall conversation context through MCP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides long-term memory for AI agents via MCP tools to store, recall, and delete memories, with per-user scoping and usage limits.AGPL 3.0
- AlicenseAqualityBmaintenanceEnables agents to manage persistent long-term memory through MCP tools for searching, adding, updating, giving feedback, and forgetting memories, with automated pipelines for redaction, distillation, and reconciliation.13MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to store and semantically retrieve durable memories across sessions via MCP or REST, with tools for remembering, recalling, asking, updating, and forgetting memories.17 npmMIT
- AlicenseNot gradedqualityBmaintenanceProvides AI agents with persistent, human-like memory infrastructure via MCP, enabling them to store, search, summarize, and forget episodic, semantic, procedural, and working memories across sessions.322 npmMIT