Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 1 addition & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,7 @@ This plugin captures session activity and stores it in your Deeplake workspace:
| `HIVEMIND_SUMMARY_EVERY_HOURS` | `2` | Time-based summary cadence, used when at least one new event has arrived since the last summary. |
| `HIVEMIND_WIKI_WORKER` | _(none)_ | Set to `1` to disable the background session-summary worker entirely (no `claude -p` summary runs). Also set automatically inside the worker as a recursion guard. Capture and recall keep working. |
| `HIVEMIND_GRAPH_ON_STOP` | _(none)_ | Set to `0` to disable the code-graph rebuild that runs on `Stop` / `SessionEnd`. |
| `HIVEMIND_EMBEDDINGS` | `true` | Set to `false` to force lexical-only mode |
| `HIVEMIND_PROACTIVE_RECALL_DISABLED` | _(none)_ | Set to `1` to disable **proactive recall** (auto-searching team memory on each recall-worthy prompt and injecting a relevant snippet into the agent's context). On by default. Does **not** affect capture or the agent's own grep/skill recall. Alt form: `HIVEMIND_PROACTIVE_RECALL=0`. |
| `HIVEMIND_RECALL_MIN_OVERLAP` | `2` | Proactive recall (lexical mode): min distinct prompt keywords a summary must share to be injected. Higher = stricter. |
| `HIVEMIND_RECALL_TIMEOUT_MS` | `1000` | Proactive recall: hard cap on the synchronous search path; on timeout it skips rather than delay the turn. |
| `HIVEMIND_EMBEDDINGS` | _(none)_ | Read once, when `~/.deeplake/config.json` has no `embeddings.enabled` yet: unset or `false` seeds it off, any other value (`true`, `1`, ...) seeds it on. Afterwards only `hivemind embeddings install`/`enable` (persist on) and `disable`/`uninstall` (persist off) change it. |
| `HIVEMIND_DEBUG` | _(none)_ | Set to `1` for verbose hook debug logs |

## Per-directory config (`.hivemind`)
Expand Down Expand Up @@ -439,18 +436,6 @@ Hivemind ships with a local embedding daemon (nomic-embed-text-v1.5) for hybrid

Full guide: **[docs/EMBEDDINGS.md](docs/EMBEDDINGS.md)**.

## Proactive recall

On a recall-worthy prompt (errors, "how did we…", substantive requests — acks and short follow-ups are skipped), Hivemind automatically searches the team's summaries and, if the top hit clears a relevance bar, injects one attributed snippet (`recalled from <teammate> · <date>`) into the agent's context — so prior work shows up *unprompted*, not only when the agent decides to search. Semantic when embeddings are installed, otherwise lexical (ILIKE keyword overlap), so it works without the embedding model. The search is latency-bounded and skips silently on any miss or error.

**On by default.** To turn it off (capture and the agent's own grep/skill recall are unaffected):

```bash
HIVEMIND_PROACTIVE_RECALL_DISABLED=1 claude # or HIVEMIND_PROACTIVE_RECALL=0
```

Tune precision/latency with `HIVEMIND_RECALL_MIN_OVERLAP` and `HIVEMIND_RECALL_TIMEOUT_MS` (see the table above). Every recall-worthy invocation is recorded to `~/.deeplake/recall-events.jsonl` for usage/hit-rate analysis.

## Summaries

After each session, a background worker generates an AI-written wiki summary and stores it in the `memory` table alongside its 768-dim embedding. Long sessions checkpoint mid-session every 50 messages or 2 hours (configurable). The wiki worker shells out to the host agent's own CLI (`claude -p`, `codex exec`, `pi --print`, …) so no separate API key is needed. Browse summaries at `~/.deeplake/memory/summaries/`.
Expand Down
1 change: 0 additions & 1 deletion esbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ const ccHooks = [
{ entry: "dist/src/hooks/session-start-setup.js", out: "session-start-setup" },
{ entry: "dist/src/hooks/session-notifications.js", out: "session-notifications" },
{ entry: "dist/src/hooks/capture.js", out: "capture" },
{ entry: "dist/src/hooks/recall.js", out: "recall" },
{ entry: "dist/src/hooks/pre-tool-use.js", out: "pre-tool-use" },
{ entry: "dist/src/hooks/session-end.js", out: "session-end" },
{ entry: "dist/src/hooks/plugin-cache-gc.js", out: "plugin-cache-gc" },
Expand Down
5 changes: 0 additions & 5 deletions harnesses/claude-code/hooks/hooks.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
"command": "node \"${CLAUDE_PLUGIN_ROOT}/bundle/capture.js\"",
"timeout": 10,
"async": true
},
{
"type": "command",
"command": "node \"${CLAUDE_PLUGIN_ROOT}/bundle/recall.js\"",
"timeout": 2
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion src/deeplake-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export class DeeplakeApi {
private async _queryWithRetry(sql: string, externalSignal?: AbortSignal): Promise<Record<string, unknown>[]> {
let lastError: Error | undefined;
for (let attempt = 0; attempt <= MAX_RETRIES; attempt++) {
// A caller-supplied signal (e.g. recall's latency budget) aborts the
// A caller-supplied signal (e.g. a hook's latency budget) aborts the
// whole operation — including between retries — so in-flight work is
// actually cancelled, not just abandoned.
if (externalSignal?.aborted) throw new Error("Query aborted");
Expand Down
4 changes: 2 additions & 2 deletions src/dir-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export interface ResolvedDirConfig {
*
* The two concerns are INDEPENDENT:
* - `orgId` / `workspaceId` are IDENTITY — they apply to reads (memory
* search, recall, the VFS) as well as capture. Omitted fields fall back to
* search, the VFS) as well as capture. Omitted fields fall back to
* the global identity in `base`.
* - `collect` is the CAPTURE switch — writes only. It never suppresses the
* identity overlay, so `{ "collect": false, "workspaceId": "x" }` reads
Expand Down Expand Up @@ -156,7 +156,7 @@ export function resolveDirConfig(
* THE single entry point for a workspace-scoped Config.
*
* Any code path that builds a `DeeplakeApi` against per-directory workspace data
* — CLI commands (goals, rules, skills), memory read/write hooks, recall — MUST
* — CLI commands (goals, rules, skills), memory read/write hooks — MUST
* get its config from here, never from a bare `loadConfig()`. It folds the
* nearest `.hivemind` (and the `HIVEMIND_*` env locks, via resolveDirConfig)
* into one place, so routing can never again be half-wired across call sites.
Expand Down
7 changes: 4 additions & 3 deletions src/embeddings/embed-summary.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// Robust summary embedding for the finalize (wiki-worker) path.
//
// Background: ~75% of production summary rows have a NULL summary_embedding,
// so proactive recall silently degrades to weak lexical matching for most of
// the corpus. A large share of those NULLs are NOT "embeddings disabled" — they
// are ENABLED users whose embed daemon was cold at the one moment finalize ran.
// so semantic memory search silently degrades to weak lexical matching for
// most of the corpus. A large share of those NULLs are NOT "embeddings
// disabled" — they are ENABLED users whose embed daemon was cold at the one
// moment finalize ran.
//
// EmbedClient.embed() is built for the latency-critical capture hook: on a cold
// daemon it returns null IMMEDIATELY while spawning the daemon in the
Expand Down
256 changes: 0 additions & 256 deletions src/hooks/recall.ts

This file was deleted.

Loading