---
name: connect
description: "Finds the bridge between two topics or entities in the operator's graph via shared neighbors and semantic overlap. Run when the operator types `/connect <topic-A> <topic-B>` or asks 'what connects X and Y in my notes', 'find a path between X and Y', 'how are X and Y related in my graph'. Read-only."
---

# Connect

This skill finds bridging nodes between two topics or entities in the operator's graph. It names the bridge and lists the nodes that form it. It reads only — it never writes.

## When to run

Run when the operator wants to discover unexpected connections: `/connect <topic-A> <topic-B>`, "what connects X and Y in my notes", "find a path between X and Y", "how are X and Y related in my graph". Read-only. Does not write.

## Method

Issue two `memory-search` calls, one per topic:

- Query A: `<topic-A>`, `limit=5, expandHops=1`
- Query B: `<topic-B>`, `limit=5, expandHops=1`

Collect the 1-hop neighborhood for each: the seed nodes and their directly connected neighbors.

Look for intersection: nodes that appear in both neighborhoods, or nodes sharing a label or property cluster (same `:Concept`, same `:Project`, same `:Person`).

**If a direct intersection exists:** name the bridge in one sentence. List the bridging node(s) with their element IDs.

**If no direct intersection exists:** identify the closest approach — the pair of nodes (one from each neighborhood) with the highest semantic overlap. Report this as a proposed bridge: "These nodes are not directly connected, but `<node-A>` and `<node-B>` are the closest approach. The bridge you could draw: [one sentence]."

## Output

If a direct bridge exists:
```
## Bridge found

`<bridging node title>` (ID: `<elementId>`) connects both topics.
It links to `<topic-A>` via [relationship type] and to `<topic-B>` via [relationship type].

Bridge: [one sentence naming what the two topics share]
```

If no direct bridge:
```
## No direct bridge found

Closest approach: `<node-A-title>` (topic A side, ID: `<elementId>`) and `<node-B-title>` (topic B side, ID: `<elementId>`).
Proposed bridge: [one sentence]
```

## Observability

Emit one log line on invocation:
```
[memory-thinking] skill=connect seedA=<id> seedB=<id> bridgePath=[<id1>,<id2>,...] elapsedMs=<N>
```

`seedA` and `seedB` are the top-ranked seed nodes for each topic (first result from each search). `bridgePath` lists the IDs of bridging nodes found in the neighborhood intersection, or an empty array if no direct bridge was found.
