activeloopai / activeloopai/hivemind

Investigate converging the memory + graph tool surface onto the shared MCP server

未关闭
#235 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
1.6k
派生
107
平均合并
17 小时 30 分钟
30 天内合并 PR
6

描述

## Context

The plugin exposes the same capability (recall org memory; query the code graph) through **three different mechanisms**, one per agent-runtime extension model:

- **claude-code / codex / cursor** — a PreToolUse hook intercepts `grep`/`cat` on the `~/.deeplake/memory/` mount and rewrites it to SQL (the "virtual filesystem" trick). No MCP. Evidence: `src/hooks/pre-tool-use.ts` (imports `grep-direct`, `handleGraphVfs`); `src/cli/install-cursor.ts:48` ("rewrites grep/rg against the memory mount").
- **hermes** — a real **MCP server** for memory recall (`hivemind_search/read/index`), installed via `src/cli/install-hermes.ts:196` (`ensureMcpServerInstalled`) + `config.yaml mcp_servers`. Plus a `terminal`-tool intercept for the graph.
- **openclaw / pi** — native plugin API (`registerTool` via `definePluginEntry`), reimplementing the same tools by hand. Evidence: `openclaw/src/index.ts:953,1049,1087`.

## Problem

Three mechanisms for one capability = maintenance tax, inconsistent coverage, and adding any feature (e.g. the code graph) means deciding per-agent how to wire it. Today only **4/6** agents can query the graph; **pi/openclaw cannot**.

## Proposal to investigate

Converge the tool surface onto the **shared MCP server** (`mcp/bundle`) where agents support MCP, keeping the hook-intercept only as the "feels-like-a-filesystem" UX sugar / fallback. MCP is the standard, discoverable, first-class path — and the only thing pi/openclaw could *share* with the others instead of native reimplementations.

Investigate:
- Which of the 6 runtimes can connect to an MCP server today, and how mature.
- Whether the graph endpoints (`find/query/show/neighborhood/impact/path/tour`) can be exposed as MCP tools backed by `handleGraphVfs`.
- What can be deleted (per-agent hook intercepts, native `registerTool` reimplementations) vs what must stay (the filesystem-style `cat` UX over the memory mount).
- Migration risk + per-agent fallback.

## Non-goal

Do **not** add MCP as a *fourth* mechanism just for the graph. Either converge, or leave as-is.

_Filed from the code-graph cross-agent audit (Python cross-file resolution PR)._

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。