MemoryCore 已在运行时如何单独启动 TencentDB Agent Memory 的 Memory Hub 面板
2026/9/13 10:28:06 网站建设 项目流程

MemoryCore 已在运行时如何单独启动 TencentDB Agent Memory 的 Memory Hub 面板

【免费下载链接】TencentDB-Agent-MemoryTencentDB Agent Memory is a team-level memory hub for AI Agents — turning conversations, docs, and code into four reusable memory assets (Chat Memory, Skill, LLM-Wiki, Code-Graph) that are governed, shared, and equipped across agents and frameworks.项目地址: https://gitcode.com/GitHub_Trending/te/TencentDB-Agent-Memory

TencentDB Agent Memory 的 Memory Hub 面板(Panel UI)平时常和memory-core由一条命令一起拉起。但如果你本机的 Memory Core 已经在运行、只想单独把团队记忆管理面板开起来,或者面板挂掉后需要单独恢复,就不必重新跑整套start-all.sh——文档提供了两种"只起 Memory Hub"的路径。Memory Hub 是一个合并镜像:一个容器内同时运行两个服务——Panel(端口8125,管理团队 / Agent / Knowledge 资源的控制台)和 Knowledge Service(端口8424,Wiki / Code Graph 知识服务),镜像为agentmemory/memory-hub

本文的操作路径来自 INSTALL.md 的 "Memory Hub only" 章节、deploy/global-images/README.md 的"独立使用每个组件"章节和 deploy/panel-knowledge-combined/README.md。

适用前提

  • 本机 Memory Core 已在8420端口运行。这是 "Memory Hub only" 模式的前置条件(见 INSTALL.md:"When Memory Core is already running on port8420")。可以先确认:

    docker ps --format '{{.Names}}' | grep -qx tdai-memory-core curl -s http://localhost:8420/health | jq .services.pipelineWorker

    第二条来自 INSTALL.md "Step 5: Watch memory grow",/health同时能确认 pipeline worker 是否在干活。

  • Docker 可用(Docker Desktop / colima / OrbStack 任一)、bash 4+,macOS / Linux 环境,见 deploy/global-images/README.md "环境要求"。

  • 一个 OpenAI 兼容的 LLM 端点(base URL、API key、模型 ID),供 Knowledge Service 的 wiki ingest / 总结使用。

  • Panel 登录用 user_key:如果 core 是经start-all.sh首次启动的,admin 的sk-mem-...key 写在deploy/global-images/.admin-key;单独用 core 脚本启动过、或该文件不存在时,在面板里用 core 管理员的 user_key 登录。

依赖关系说明(见 deploy/global-images/README.md "依赖关系"):memory-hub 能独立启动(LLM_MODE=custom直连 LLM),但容器内的 knowledge 调 memory-core 做 RAG 时会失败,所以建议 memory-core 先起来、且保持运行。

方式一:直接 docker run(文档最短主路径)

来自 INSTALL.md "Memory Hub only"。下面命令中的<OPENAI_COMPATIBLE_BASE_URL><YOUR_API_KEY><MODEL_ID>是文档保留的占位符,替换成你的 LLM 端点、API key 和模型 ID:

docker pull docker.io/agentmemory/memory-hub:latest
docker run -d --name tdai-memory-hub \ --add-host=host.docker.internal:host-gateway \ -p 8125:8125 -p 8424:8424 \ -v tdai-panel-data:/data/knowledge \ -e REMOTE_INSTANCE_URL=http://host.docker.internal:8420 \ -e REMOTE_INSTANCE_KEY=local \ -e KNOWLEDGE_PUBLIC_BASE_URL=http://host.docker.internal:8424/v3 \ -e LLM_MODE=custom \ -e LLM_BASE_URL=<OPENAI_COMPATIBLE_BASE_URL> \ -e LLM_API_KEY=<YOUR_API_KEY> \ -e LLM_MODEL=<MODEL_ID> \ docker.io/agentmemory/memory-hub:latest

各关键配置的作用:

  • REMOTE_INSTANCE_URL=http://host.docker.internal:8420:Panel 后端 → Kernel 的转发始终走这个地址,指向本机 memory-core;--add-host=host.docker.internal:host-gateway让容器内能回环到宿主机。
  • REMOTE_INSTANCE_KEY=local:与 memory-core Gateway 的内部凭据一致。start-all.sh脚本默认值是local(见 deploy/global-images/README.md "内部凭据");如果你的 core 是在.env里覆盖了MEMORY_CORE_GATEWAY_API_KEY的非默认值,这里要改成相同的值。
  • KNOWLEDGE_PUBLIC_BASE_URL:KS 对外暴露的地址,必须含/v3前缀(见 deploy/panel-knowledge-combined/README.md "前置准备")。
  • LLM_MODE=custom+LLM_BASE_URL/LLM_API_KEY/LLM_MODEL:不走 Memory Gateway 的 LLM 转发,直连你自有的 LLM 端点;此时LLM_API_KEYLLM_BASE_URL为必填项。

镜像版本默认latest;想固定版本时把 tag 换成具体版本(如:1.0.0-beta.1),见 deploy/global-images/README.md。

方式二:start-memory-hub.sh 脚本(可选,需自备 .env)

deploy/global-images/README.md 说明三个 start 脚本可以单独执行:./start-memory-hub.sh只跑面板 + 知识(8125 + 8424),需要MEMORY_LLM_*参数。

deploy/global-images目录下准备.env(参考同目录 .env.example),至少要填 memory 组三个参数——MEMORY_LLM_BASE_URL/MEMORY_LLM_API_KEY/MEMORY_LLM_MODEL,不能保留REPLACE_ME;端口、KNOWLEDGE_PUBLIC_BASE_URLPANEL_VOLUME用默认值即可。然后:

cd deploy/global-images ./start-memory-hub.sh

脚本的实际行为(见 start-memory-hub.sh):

  • load_env+require_vars:缺必填参数时一次性列出所有缺失项并exit 1,不会跑到一半才失败;
  • tdai-memory-core容器未在运行,打[warn]但不阻塞;
  • 若已存在同名容器tdai-memory-hub,会先docker rm -f移除再重建(副作用仅针对该容器,数据卷保留),需要说明后再执行;
  • 容器接到tdai-memory-stack网络,REMOTE_INSTANCE_URL默认写成http://memory-core:8420(走网络别名),LLM_MODE=custom并把MEMORY_LLM_*透传给 KS;
  • 最长等待 120s 直到容器 healthy / running,成功后打印 Panel UI 与 KS Health 地址。

两种方式二选一即可,下文验证对两种方式都适用。

启动后验证

  1. 打开浏览器访问 http://localhost:8125/,能打开面板即 Panel 已起;输入 user_key 登录后应能看到资产(Team / Agent / Skill / Wiki 等)页面。

  2. 检查 Knowledge Service 健康端点(来自 deploy/panel-knowledge-combined/README.md "访问地址"):

    curl -s http://localhost:8424/health
  3. 查看容器状态与日志:

    docker ps --format '{{.Names}}\t{{.Status}}' docker logs tdai-memory-hub

    脚本方式则以tdai-memory-hub 已启动+ 两个地址输出作为成功标志;docker logs同时是后面排查问题的入口。

常见问题排查

Q: 面板显示 "Panel API 8125 not started"?

docker ps检查tdai-memory-hub是否 healthy;不 healthy 看docker logs tdai-memory-hub,文档给出的常见原因是REMOTE_INSTANCE_URLLLM_BASE_URL配错(见 INSTALL.md FAQ)。脚本方式下还要先确认.envKNOWLEDGE_PUBLIC_BASE_URL是否含/v3——缺/v3面板会报错(见 deploy/global-images/README.md 常见问题)。

Q: tools/list 返回 404?

KNOWLEDGE_PUBLIC_BASE_URL必须包含/v3前缀,正确格式是http://host:port/v3(见 deploy/panel-knowledge-combined/README.md 常见问题)。

Q: 容器内访问宿主机上其它服务(如 Langfuse)?

172.17.0.1(docker0 网桥)代替localhost,或加--add-host=host.docker.internal:host-gateway后用host.docker.internal

Q: wiki ingest 报 timeout?

reasoning 模型对大文件可能需要超过 20 分钟(LLM_TIMEOUT_MS默认1200000即 20 分钟),可按文档加大:

-e LLM_TIMEOUT_MS=1800000 # 30 分钟

Q: 切换 LLM 协议后报错?

LLM_PROTOCOLLLM_MODEL必须配套:OpenAI 协议(默认)配Memory-Modeldeepseek-v4-pro等走/chat/completions的模型;Anthropic 模型(claude-sonnet-4-5等)配LLM_PROTOCOL=anthropic/messages

清理与数据

  • 面板数据(KS 的 SQLite、git clone、wiki 文件、日志)持久化在/data/knowledge,本文用 named volumetdai-panel-data;只要不删卷,数据一直保留。
  • 只停面板不影响 core:docker stop tdai-memory-hub。如需移除容器:docker rm -f tdai-memory-hub,副作用仅限该容器,数据卷保留;彻底清理再docker volume rm tdai-panel-data(该命令会删掉面板数据,执行前确认不再需要)。

面板单独起好后,后续怎么用 admin/业务账号、建 Team / Agent、观察记忆增长,见 INSTALL.md 的 "After deploy: making it useful" 章节。

【免费下载链接】TencentDB-Agent-MemoryTencentDB Agent Memory is a team-level memory hub for AI Agents — turning conversations, docs, and code into four reusable memory assets (Chat Memory, Skill, LLM-Wiki, Code-Graph) that are governed, shared, and equipped across agents and frameworks.项目地址: https://gitcode.com/GitHub_Trending/te/TencentDB-Agent-Memory

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询