query_partner_memory_graph
Run the same graph query language across the caller's org and a partner org.
Use this when the user asks how their own memory relates to a linked partner
team's. Do not use it to read the partner alone; use `search_partner_memory` for
that. Do not use it when the starting point is a sentence and no pattern is
stated; use `find_partner_memory_connections` for that.
Reads the partner org and writes nothing to either side. Calls are handled
one at a time per org: a second link call issued while one is in flight comes
back with `reason: busy` without running.
Name match: `WHERE e.name CONTAINS $part` works here too, on `Entity.name`
and `Tag.name`, ignoring letter case and full-width forms, two characters for
a piece that is all ASCII and one for Hangul or Han. It runs on the rows the
walk already returned, so an empty result over a `truncated` walk means the
piece was not seen, not that it is absent. Entities the link has aliased fold
into one node under the home spelling, so the partner's own spelling of a
name is not what this compares against.
Scoped start: `entity:` or `tag:` together with `text:`, and `tag:` alone,
work here too and resolve in the caller's org only, as do name lists (any),
`entity_all:` or `tag_all:` (all) and `entity:` with `tag:` (both), with
nothing beyond that shape. `a.score`, `scoped_mode`, `filled`, `has_more`,
`unresolved`, `entities_truncated` and `budget.caps` mean what they mean on
`query_memory_graph`. `exact` measures every candidate but returns
only the top `k`, and `has_more: true` says more candidates remain in
scope. An uncovered scope adds `stage: start` to `truncated`,
and `a.score` is null on hop-reached events and sorts last, so use
`ORDER BY a.score DESC, a.id` for a stable order. 0 rows with
`filled: false` means not confirmed, not absent. `MATCH` can be left out
when the start itself is the answer, as in `START a = events(entity: $name,
text: $q, k: 20) RETURN a, a.score ORDER BY a.score DESC, a.id`; with no
walk it returns only the caller's own events. A missing arrow on a
directed relation is filled in as on `query_memory_graph`, with a line in
`notes`.
Args:
link_id: Which link to read through, from `list_partner_links`.
query: The graph query text, same grammar and vocabulary as
`query_memory_graph`. `START` resolves in the caller's org only; the
walk crosses into the partner's events through entities the link has
aliased, which count as one entity for `PARTICIPATED_IN` and
`SHARES`. `NEXT`, `MEMBER_OF`, `CONNECTED`, and `RESOLVED_BY` stay
within a side.
params: Values for `$name` references.
Returns:
`{status, link_id, remote_org, columns, rows, row_count, start, partial,
truncated, plan, budget, notes}`, or `{status: error, error, reason,
detail}` where `error` repeats the reason code. A query the grammar
rejects also carries `{blocked_by: syntax|grammar|params, hint?,
allowed_*}`, as on the home path. Returned events carry `side`
(`remote` = partner), and partner content opens with
`get_partner_memory_content`. A `reason` names
the state of the link, not a failure of the caller's own memory.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The graph query text, same grammar and vocabulary as `query_memory_graph`. `START` resolves in the caller's org only; the walk crosses into the partner's events through entities the link has aliased, which count as one entity for `PARTICIPATED_IN` and `SHARES`. `NEXT`, `MEMBER_OF`, `CONNECTED`, and `RESOLVED_BY` stay within a side. | |
| params | No | Values for `$name` references. | |
| link_id | Yes | Which link to read through, from `list_partner_links`. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||