Skip to content

GML-2019 handle more table view display content types#22

Merged
prinskumar-tigergraph merged 2 commits into
mainfrom
GML-2019-Table-View
Nov 26, 2025
Merged

GML-2019 handle more table view display content types#22
prinskumar-tigergraph merged 2 commits into
mainfrom
GML-2019-Table-View

Conversation

@chengbiao-jin

@chengbiao-jin chengbiao-jin commented Nov 26, 2025

Copy link
Copy Markdown
Collaborator

PR Type

Enhancement, Bug fix


Description

  • Standardize context key to result

  • Add empty-result check for queries

  • Expand table to new data formats

  • Improve routing prompt and UX toggles


Diagram Walkthrough

flowchart LR
  AG["generate_cypher: execute query"] --> IR["is_query_result_empty()"]
  IR -- "empty" --> ERR["state.context = {error: True, result: json_str}"]
  IR -- "not empty" --> CTX["state.context = {result, cypher, reasoning}"]
  CTX --> GA["generate_answer uses context.result"]
  ERR --> GA
  GA --> UICM["CustomChatMessage: Show Table requires result"]
  GA --> INTER["Interact: disable Graph/Table without data"]
  CTX --> KT["KnowledgeTablePro: render"]
  KT --> FT["SupportAI final_retrieval to chunk/text"]
  KT --> STR["String content as single-column table"]
  KT --> CKV["Cypher object values to Key/Value table"]
  PR["Route prompt tuned for history routing"] --> AG
Loading

File Walkthrough

Relevant files
Enhancement
base_llm.py
Tune routing prompt for history vs functions/vectorstore 

common/llm_services/base_llm.py

  • Clarified routing prompt language and criteria.
  • Emphasized using history for similar/referenced questions.
  • Minor wording and grammar improvements.
+3/-2     
Interact.tsx
Guard UI actions based on available data                                 

graphrag-ui/src/components/Interact.tsx

  • Disable Graph button without result.edges.
  • Disable Table button without result.
  • Preserve feedback and explain actions.
+20/-2   
KnowledgeTablePro.tsx
Add table support for multiple result formats                       

graphrag-ui/src/components/tables/KnowledgeTablePro.tsx

  • Support final_retrieval (chunk/text) display.
  • Render string content as single-column table.
  • Handle Cypher object values as Key/Value rows.
  • Improve early returns and empty-state handling.
+131/-10
Bug fix
agent_graph.py
Robust result handling and empty-result checks                     

graphrag/app/agent/agent_graph.py

  • Use result instead of answer in context.
  • Add is_query_result_empty and gate on non-empty results.
  • Update logs and answer generation to use result.
  • Minor UX text tweak for progress message.
+21/-9   
CustomChatMessage.tsx
Align table visibility with `result`-only data                     

graphrag-ui/src/components/CustomChatMessage.tsx

  • Require result and exclude history for tables.
  • Remove fallback to answer for table rendering.
  • Keep graph/markdown behavior unchanged.
+1/-3     

@prinskumar-tigergraph
prinskumar-tigergraph merged commit 4d28f89 into main Nov 26, 2025
1 check failed
@chengbiao-jin
chengbiao-jin deleted the GML-2019-Table-View branch November 26, 2025 17:42
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.

2 participants