Skip to content

GML-2162: route document statistics analysis to vectorstore#51

Open
prinskumar-tigergraph wants to merge 1 commit into
release_2.0.1from
GML-2162-poor-context
Open

GML-2162: route document statistics analysis to vectorstore#51
prinskumar-tigergraph wants to merge 1 commit into
release_2.0.1from
GML-2162-poor-context

Conversation

@prinskumar-tigergraph

@prinskumar-tigergraph prinskumar-tigergraph commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

User description

Keep mandatory functions routing for graph metadata; add a narrow exception for domain analysis that asks for stats instead of narrative text.


PR Type

Enhancement


Description

  • Refines datasource routing precedence

  • Adds document-analysis vectorstore exception

  • Preserves graph metadata function routing


Diagram Walkthrough

flowchart LR
  Q["User question"]
  H["History continuation"]
  F["Functions for graph metadata"]
  V["Vectorstore for document analysis"]
  Q -- "continues prior answer" --> H
  Q -- "graph/schema/count query" --> F
  Q -- "domain document statistics" --> V
Loading

File Walkthrough

Relevant files
Enhancement
base_llm.py
Refine LLM datasource routing prompt                                         

common/llm_services/base_llm.py

  • Strengthens mandatory functions routing priority for graph metadata.
  • Adds structured counts and schema lookups as functions examples.
  • Introduces a narrow document-analysis exception routed to vectorstore.
  • Clarifies exception must not override graph, vertex, edge, or schema
    counts.
+9/-1     

Keep mandatory functions routing for graph metadata; add a narrow exception for domain analysis that asks for stats instead of narrative text.
@tg-pr-agent

tg-pr-agent Bot commented Jul 13, 2026

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Routing Ambiguity

The new document-analysis exception is somewhat broad and could cause domain questions asking for statistics or data to route to vectorstore even when they are answerable through structured graph entities. Consider tightening the wording or adding regression examples/tests for borderline cases.

## Document analysis exception → `vectorstore`
Use `vectorstore` (or `history` if the question clearly continues a prior answer) only for this case:
- Domain / document analysis that asks for statistics or data **instead of** narrative text or description.
- Examples: "backed by statistics of data instead of just reading from the text/description"; same intent plus a document topic (e.g. product stability trends).
- Do **not** use this exception if the question asks for graph / vertex / edge / schema counts.
- Do **not** broaden this exception. If the question could reasonably be a structured graph query, route to `functions`.

Comment on lines +808 to +813
## Document analysis exception → `vectorstore`
Use `vectorstore` (or `history` if the question clearly continues a prior answer) only for this case:
- Domain / document analysis that asks for statistics or data **instead of** narrative text or description.
- Examples: "backed by statistics of data instead of just reading from the text/description"; same intent plus a document topic (e.g. product stability trends).
- Do **not** use this exception if the question asks for graph / vertex / edge / schema counts.
- Do **not** broaden this exception. If the question could reasonably be a structured graph query, route to `functions`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: The new exception is broad enough that questions asking for structured counts or lookups on schema entities could still be routed to vectorstore. Tighten it so vectorstore applies only when the requested statistics are explicitly sourced from document text or document analysis, not from graph entities. [possible issue, importance: 4]

Suggested change
## Document analysis exception → `vectorstore`
Use `vectorstore` (or `history` if the question clearly continues a prior answer) only for this case:
- Domain / document analysis that asks for statistics or data **instead of** narrative text or description.
- Examples: "backed by statistics of data instead of just reading from the text/description"; same intent plus a document topic (e.g. product stability trends).
- Do **not** use this exception if the question asks for graph / vertex / edge / schema counts.
- Do **not** broaden this exception. If the question could reasonably be a structured graph query, route to `functions`.
## Document analysis exception → `vectorstore`
Use `vectorstore` (or `history` if the question clearly continues a prior answer) only when the question explicitly asks to analyze statistics, trends, evidence, or data contained in documents/text for a document topic:
- Examples: "backed by statistics of data instead of just reading from the text/description"; same intent plus a document topic (e.g. product stability trends).
- Do **not** use this exception for counts, lists, lookups, aggregations, or summaries over graph / vertex / edge / schema entities or relationships.
- Do **not** broaden this exception. If the question could reasonably be a structured graph query, route to `functions`.

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