Skip to content

fix neighbors_v2 edge-type filter for Kuzu (closes #119)#121

Merged
HumanBean17 merged 1 commit into
masterfrom
bugfix/kuzu-drops-labels-predicate
May 14, 2026
Merged

fix neighbors_v2 edge-type filter for Kuzu (closes #119)#121
HumanBean17 merged 1 commit into
masterfrom
bugfix/kuzu-drops-labels-predicate

Conversation

@HumanBean17
Copy link
Copy Markdown
Owner

Summary

Fixes incorrect neighbors_v2 results when edge_types is a strict subset of a node’s incident edge labels. Kuzu 0.11.x can ignore label(e) IN $list in WHERE.

Approach

  • Replace label(e) IN $edge_types with OR of scalar equalities (label(e) = $l0 OR …) using bound parameters after Pydantic allowlisting.
  • Do not use typed union patterns like -[e:CALLS|HTTP_CALLS]- here: RETURN reads columns that do not exist on every rel type in the union, which triggers Kuzu binder errors.

Tests

  • tests/test_mcp_v2.py -k neighbor (includes new strict-subset regression test).

Docs

  • Kuzu Cypher pitfalls added to AGENTS.md, kuzu_queries.py module docstring, and tests/README.md.

Closes #119

Made with Cursor

- Replace label(e) IN $list with OR of scalar label(e) = $p (Kuzu 0.11.x).
- Avoid typed union rel patterns here: RETURN columns differ across rel types.
- Add regression test for strict-subset edge_types; adjust FakeGraph stub.
- Document Kuzu Cypher pitfalls in AGENTS.md, kuzu_queries.py, tests/README.

Fixes #119.

Co-authored-by: Cursor <cursoragent@cursor.com>
@HumanBean17 HumanBean17 merged commit d4f7bfa into master May 14, 2026
1 check passed
@HumanBean17 HumanBean17 deleted the bugfix/kuzu-drops-labels-predicate branch May 23, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

neighbors returns wrong-labeled edges: Kuzu 0.11.3 silently drops label(e) IN $list predicate

1 participant