Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ba56646
feat(memory): expose expert memory as an MCP server for external agents
ArvinQi Aug 20, 2026
004714a
style: format memory_mcp.py with ruff
Aug 23, 2026
ccfb9ef
Merge branch 'main' into feat/memory-mcp-server
ArvinQi Aug 23, 2026
fea4c59
fix: resolve mypy type errors in memory_mcp.py
ArvinQi Aug 23, 2026
0e7eec8
feat(memory-mcp): 内网增强——调用者 user 追溯 + 自动提取 + 工具描述
ArvinQi Aug 26, 2026
9160cbe
feat(memory-mcp): 记忆分层工具集 + 生产流水线调度
ArvinQi Aug 26, 2026
d629bb1
refactor(memory-mcp): 精简工具面——合并 L0/L2 查询,11→9 个工具
ArvinQi Aug 26, 2026
a857871
chore: remove upstream PR.md draft (PR description lives on GitHub)
ArvinQi Aug 26, 2026
97f1eb9
docs(memory-mcp): 新增专家记忆 MCP Server 使用文档
Aug 28, 2026
92cdb0f
Merge branch 'TencentCloud:main' into feat/memory-mcp-extension
ArvinQi Sep 4, 2026
02f437f
feat(memory-mcp): 幂等 capture 去重 + harness_memory 召回质量补丁
ArvinQi Sep 5, 2026
0006ad6
Merge branch 'TencentCloud:main' into feat/memory-mcp-extension
ArvinQi Sep 7, 2026
226b458
fix(memory-mcp): 修复 memory_candidates status 与 memory_reject 崩溃
ArvinQi Sep 14, 2026
6de7c34
feat(memory-mcp): 读面补齐 + 专家按请求绑定 + 发送者归属
ArvinQi Sep 14, 2026
f7ca99a
fix(api): 记忆 MCP lifespan 补返回类型标注,修掉 mypy no-untyped-def
ArvinQi Sep 14, 2026
abf140b
fix(mcp): recall 支持 session/thread 作用域 + capture 丢弃召回回声
ArvinQi Sep 14, 2026
5c27a7a
test(memory): 补 recall 质量补丁 memory_recall_patch 的最小单测
ArvinQi Sep 14, 2026
efbff27
Merge tag 'v1.0.2b7' of /Users/temptrip/Project/demo/octop-upstream i…
ArvinQi Oct 13, 2026
855cc3b
chore(sync): merge community v1.0.2b7 and migrate memory stack to oct…
ArvinQi Oct 13, 2026
09b25c3
feat(memory-mcp): port local terminal integration (installer, hooks, …
ArvinQi Oct 13, 2026
466f1d8
feat(memory-mcp): port the current tool surface onto v1.0.2b7
ArvinQi Oct 13, 2026
aa0c193
feat(memory-mcp): drop the memory_recall tool
ArvinQi Oct 13, 2026
28b1de2
docs(memory-mcp): lead with a curl quick start
ArvinQi Oct 13, 2026
d811b6f
docs(memory-mcp): state that the quick setup needs only the instance …
ArvinQi Oct 13, 2026
1e9acf4
refactor(memory-mcp): drop the OAuth entry mode and the second creden…
ArvinQi Oct 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
592 changes: 592 additions & 0 deletions docs/memory-mcp.md

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions src/octop/api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,24 @@ async def acme_http01_challenge(token: str) -> PlainTextResponse:
],
)

# 专家记忆 MCP server(对外暴露,独立 token 鉴权,未配置 OCTOP_MEMORY_MCP_TOKEN 时不挂载)
from octop.infra.agents.memory_mcp import mount_memory_mcp

memory_mcp_managers = mount_memory_mcp(app, server)
if memory_mcp_managers:
from collections.abc import AsyncIterator
from contextlib import AsyncExitStack, asynccontextmanager

@asynccontextmanager
async def _memory_mcp_lifespan(application: FastAPI) -> AsyncIterator[None]:
# streamable_http_app 的 task group 依赖 lifespan,挂载后须手动并入
async with AsyncExitStack() as stack:
for mgr in memory_mcp_managers:
await stack.enter_async_context(mgr.run())
yield

app.router.lifespan_context = _memory_mcp_lifespan

if enable_api_docs:

@app.get("/api/docs", include_in_schema=False)
Expand Down
164 changes: 164 additions & 0 deletions src/octop/infra/agents/agent_presets/dsh-memory-share/cordis.patch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# DSH agent preset「记忆共享模式」: the shipped `cordis` (创造模式) child plugin
# list, plus the octop memory hooks. Copied from DSH's `@deepseek-ai/dsh-web-app`
# preset `cordis` — refresh this copy when that preset changes (见 client_setup.py
# 的 `_DSH_PRESET_FILES`), and keep `configPath` as the installer's placeholder.
- insert:
- id: preset-octop-shared-memory
name: '@deepseek-ai/dsh-agent-preset'
config:
id: octop-shared-memory
name: 记忆共享模式
description: 基于创造模式的全能力副本,并接入 octop 共享记忆:
user prompt submit 自动检索相关记忆注入上下文,session stop 自动上报本会话的对话。
order: 5
plugins:
# Same persona as `standard`: tool descriptions and the skill catalog carry
# the operating detail, and the skills own the preset-authoring rules.
- id: persona
name: '@deepseek-ai/dsh-persona'
config:
suffix: Your working directory is {{cwd}}.
prefix: >-
You are a coding agent powered by the {{model}} model.
- id: agent-instructions
name: '@deepseek-ai/dsh-agent-instructions'
config:
maxBytes: 65536
- id: tool-bash
name: '@deepseek-ai/dsh-tool-bash'
disabled: !!js process.platform === 'win32'
- id: tool-pwsh
name: '@deepseek-ai/dsh-tool-pwsh'
disabled: !!js process.platform !== 'win32'
- id: tool-fs
name: '@deepseek-ai/dsh-tool-fs'
- id: tool-fs-search
name: '@deepseek-ai/dsh-tool-fs-search'
config:
sampleOverCapGlobResults: false
- id: tool-jobs
name: '@deepseek-ai/dsh-tool-jobs'
- id: command-goal
name: '@deepseek-ai/dsh-command-goal'
- id: tool-goal
name: '@deepseek-ai/dsh-tool-goal'
- id: planning
name: cordis:group
group: true
isolate:
planMode: true
config:
- id: plan-mode
name: '@deepseek-ai/dsh-plan-mode'
config:
section: |
You are in plan mode. Stay in plan mode until exit_plan_mode succeeds or the user switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.

Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.

The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.

Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.

Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; identify public API, schema, and data-flow changes; cover edge cases, failure modes, tests, acceptance criteria, and explicit assumptions. Keep it concise enough to review but detailed enough that another engineer can implement it without making design decisions.

When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
- id: compaction
name: cordis:group
group: true
isolate:
compaction: true
toolResultPruner: true
config:
- id: compaction-basic
name: '@deepseek-ai/dsh-compaction-basic'
- id: command-compact
name: '@deepseek-ai/dsh-command-compact'
- id: tool-result-pruner
name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
config:
thresholdChars: 8192
headChars: 4096
tailChars: 1024
- id: delegation
name: cordis:group
group: true
isolate:
workflowEngine: true
config:
- id: tool-subagent-control
name: '@deepseek-ai/dsh-tool-subagent-control'
- id: tool-subagent-list-agents
name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
- id: tool-subagent
name: '@deepseek-ai/dsh-tool-subagent'
config:
provider: spawn
toolName: subagent
modelSelectionSettings: true
backgroundMode: continuable
- id: tool-subagent-fork
name: '@deepseek-ai/dsh-tool-subagent'
config:
provider: fork
toolName: subagent_fork
backgroundMode: continuable
- id: tool-subagent-codex
name: '@deepseek-ai/dsh-tool-subagent'
disabled: true
config:
provider: codex
toolName: subagent_codex
backgroundMode: one-shot
maxDepth: provider-managed
- id: tool-subagent-claude-code
name: '@deepseek-ai/dsh-tool-subagent'
disabled: true
config:
provider: claude-code
toolName: subagent_claude_code
backgroundMode: one-shot
maxDepth: provider-managed
- id: workflow-ptc
name: '@deepseek-ai/dsh-workflow-ptc'
config:
provider: spawn
- id: tool-workflow
name: '@deepseek-ai/dsh-tool-workflow'
- id: tool-ralph
name: '@deepseek-ai/dsh-tool-ralph'
disabled: true
config:
subagentProvider: spawn
maxRounds: 64
- id: tool-ask-user
name: '@deepseek-ai/dsh-tool-ask-user'
- id: tool-todo
name: '@deepseek-ai/dsh-tool-todo'
config:
allowParallelInProgress: true
- id: tool-web
name: '@deepseek-ai/dsh-tool-web'
config:
fetch: true
searchTimeoutMs: 60000
- id: tool-cordis
name: '@deepseek-ai/dsh-tool-cordis'
- id: skill-filesystem
name: '@deepseek-ai/dsh-skill-filesystem'
config:
customSkillDirs:
- !!js process.getBuiltinModule('node:path').join(process.getBuiltinModule('node:path').dirname(process.getBuiltinModule('node:module').createRequire(baseUrl).resolve('@deepseek-ai/dsh-agent-preset/package.json')), 'skills')
- id: tool-skill
name: '@deepseek-ai/dsh-tool-skill'
- id: present
name: '@deepseek-ai/dsh-tool-present'
- id: tool-plugin-manager
name: '@deepseek-ai/dsh-plugin-manager/tools'
disabled: !!js "!ctx.get('profileContext')"

# 共享记忆:UserPromptSubmit 检索注入,Stop 上报(hook 脚本见 ~/.dsh/hooks/dsh)。
- id: hooks-octop-memory
name: '@deepseek-ai/dsh-hooks-claude-code'
config:
configPath: __OCTOP_HOOKS_JSON__
12 changes: 12 additions & 0 deletions src/octop/infra/agents/agent_presets/dsh-memory-share/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "octop-dsh-memory-share",
"version": "0.1.0",
"private": true,
"description": "DSH agent preset 记忆共享模式: the shipped cordis toolset plus octop memory hooks (UserPromptSubmit recall, Stop capture).",
"type": "module",
"dsh": {
"bundle": {
"patch": "./cordis.patch.yml"
}
}
}
Loading