Skip to content

fix: normalize search hits and share KA GraphML/CSV export adapters - #2

Merged
cursor[bot] merged 3 commits into
mainfrom
cursor/search-hits-export-ka-bd8a
Sep 13, 2026
Merged

cursor[bot] merged 3 commits into
mainfrom
cursor/search-hits-export-ka-bd8a

Conversation

@Frankie-Xu

Copy link
Copy Markdown
Owner

Summary

  • CLI he search and MCP search now go through one SearchHits adapter (hyperextract/utils/search_results.py). Graph 2-tuples count nodes + edges, not len(tuple) == 2. Empty ([], []) prints No results found. instead of two opaque lists.
  • graph_rag 3-tuples no longer crash MCP (nodes, edges = results). JSON always includes community_context, including null. cog_rag-style dicts recursively model_dump.
  • GraphML / CSV CLI and MCP call export_ka_graphml / export_ka_csv. Non-graph KAs share one graph-type error. default_edge_id lives in exporters/common.py; GraphML/CSV drop their local copies.
  • resolve_export_file is in common.py for later formats. This PR does not add GraphML --force (fix: require --force before overwriting GraphML exports yifanfeng97/Hyper-Extract#123 owns that).

Closes yifanfeng97#118
Closes yifanfeng97#120
Supersedes yifanfeng97#119 and yifanfeng97#121 — those PRs each fixed one surface; this replaces both.

Out of scope

Test plan

  • uv run pytest tests/utils tests/cli tests/types tests/test_mcp_server.py
  • Empty 2-tuple CLI: No results found., no Result 1
  • MCP 3-tuple includes community_context: null and does not raise
  • Existing tests/utils/test_exporters.py expectations unchanged
Open in Web Open in Cursor 

cursoragent and others added 3 commits September 13, 2026 07:49
CLI and MCP search now go through SearchHits so graph tuples count
nodes+edges and graph_rag 3-tuples no longer crash. GraphML/CSV export
calls export_ka_* with one graph-type error; default_edge_id lives in
exporters/common.py.

Co-authored-by: Frankie-Xu <Frankie-Xu@users.noreply.github.com>
Co-authored-by: Frankie-Xu <Frankie-Xu@users.noreply.github.com>
Reuse yifanfeng97#123 wording and banner: refuse a non-empty GraphML file unless
--force / MCP overwrite is set. The guard lives in resolve_export_file
so CLI and MCP share one path.

Co-authored-by: Frankie-Xu <Frankie-Xu@users.noreply.github.com>
@cursor
cursor Bot merged commit bc4d42c into main Sep 13, 2026
5 checks passed
@Frankie-Xu

Copy link
Copy Markdown
Owner Author

Opened on the fork by mistake; tracked upstream as yifanfeng97#144 (now merged). Closing.

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.

MCP search crashes on graph_rag 3-tuples he search prints graph tuples as two opaque lists instead of nodes/edges

2 participants