You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Viz.ChatGrid currently passes raw SQL query results directly into the LLM prompt when generating chat responses.
When result sets are large (multi-state, multi-year, etc.), this causes:
Biased answers caused by SQL ordering (e.g. only the first state like Alabama appears in a multi-state query)
This makes chat responses incorrect, misleading, or incomplete.
The system currently relies on auto-generated SQL filtering and ordering to control what fits into the LLM prompt, which is fragile and unsupervised.
Issue type
Feature Request
Issue applies to:
Summary
Viz.ChatGrid currently passes raw SQL query results directly into the LLM prompt when generating chat responses.
When result sets are large (multi-state, multi-year, etc.), this causes:
This makes chat responses incorrect, misleading, or incomplete.
The system currently relies on auto-generated SQL filtering and ordering to control what fits into the LLM prompt, which is fragile and unsupervised.
CC @Walter462
Description how to reproduce the issue
There is no explicit layer responsible for:
The LLM receives raw database output, not curated context.
ExaGO version
developat 6c082a0System and environment details
All supported
Additional information
No response
Proposed solution
Add a Context Management Module between the database and ChatResponsePrep.
flowchart TB user>"USER"] user --"natural lang query"--> chat subgraph "Front__End" chat[["CHAT"]] end subgraph "BackEnd" LangChain[\"LangChain"/] DB[("DB")] LangChain --"srl request"-->DB ChatResponsePrep[\"Generate Natural language AI response for chat"/] OpenAIChatResponse["OpenAI"] chat --"natural lang query"--> LangChain ChatResponsePrep --"context enriched OpenAI request"--> OpenAIChatResponse OpenAIChatResponse --"sql-return context-powered reply"--> ChatResponsePrep ContextManagementModule(("Context Management Module")) DB --"raw data"--> ContextManagementModule ContextManagementModule --> ChatResponsePrep LangChain --"natural lang query"--> ChatResponsePrep ChatResponsePrep --"human-readable reply"-----> chat end style ContextManagementModule fill:#000,stroke:#f55,stroke-width:4px,color:#fff,stroke-dasharray: 5 5This module should:
Goals / Acceptance Criteria
The system should guarantee that:
Possible Implementations (non-binding)