Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1088 commits
Select commit Hold shift + click to select a range
a177781
Refine grounded SQL prompt flow
hbalasubramanya-rgb Aug 4, 2026
21a9929
Compact SQL generation context
hbalasubramanya-rgb Aug 4, 2026
d154f72
Clarify SQL literal and comparison grounding
hbalasubramanya-rgb Aug 4, 2026
d45a703
Reject template SQL in generation prompts
hbalasubramanya-rgb Aug 4, 2026
0944113
Handle missing restored ask tasks
hbalasubramanya-rgb Aug 4, 2026
d5f5b59
Stabilize SQL generation failure handling
hbalasubramanya-rgb Aug 4, 2026
5dd5ebf
Prevent metadata placeholder SQL generation
hbalasubramanya-rgb Aug 4, 2026
0b26b50
Prevent SQL generation from merging retrieved candidates
hbalasubramanya-rgb Aug 4, 2026
a9a0a57
Ground SQL generation in metadata contract
hbalasubramanya-rgb Aug 4, 2026
3187077
Fail fast on ungrounded SQL correction
hbalasubramanya-rgb Aug 4, 2026
895fca6
Allow correction for grounded intent mismatches
hbalasubramanya-rgb Aug 4, 2026
a7f23a5
Tighten grounded SQL correction
hbalasubramanya-rgb Aug 4, 2026
5f2d006
Stop ungrounded SQL correction retries
hbalasubramanya-rgb Aug 4, 2026
ac6d218
Improve SQL dialect grounding and add fine-tuning tools
hbalasubramanya-rgb Aug 5, 2026
ea7e1e2
Keep data questions in SQL answer flow
hbalasubramanya-rgb Aug 5, 2026
bec07a6
Revert "Keep data questions in SQL answer flow"
hbalasubramanya-rgb Aug 5, 2026
d808137
Repair ranked measure SQL generation
hbalasubramanya-rgb Aug 5, 2026
563edc8
Update engine for MSSQL aggregate warnings
hbalasubramanya-rgb Aug 5, 2026
5a8bce2
Repair filtered detail SQL generation
hbalasubramanya-rgb Aug 5, 2026
a7ec430
Enrich deployed metadata for semantic retrieval
hbalasubramanya-rgb Aug 5, 2026
1f2d0e2
Add stable Codestral MSSQL config
hbalasubramanya-rgb Aug 5, 2026
a159465
Reject placeholder SQL before wildcard repair
hbalasubramanya-rgb Aug 5, 2026
3c5695c
Add PO invoice semantic overlay support
hbalasubramanya-rgb Aug 5, 2026
b086092
Improve deployed schema retrieval grounding
hbalasubramanya-rgb Aug 5, 2026
edcb47b
Support all-model semantics generation
hbalasubramanya-rgb Aug 5, 2026
a95fd2a
Stop modeling assistant on missing result
hbalasubramanya-rgb Aug 5, 2026
e9bb51e
Revert branch to grounded SQL fast path commit
hbalasubramanya-rgb Aug 5, 2026
dda6ca7
Avoid restarting active semantic deployments
hbalasubramanya-rgb Aug 5, 2026
e31562a
Recover deployment sync status
hbalasubramanya-rgb Aug 5, 2026
bbd01ca
Clear missing AI deployments
hbalasubramanya-rgb Aug 5, 2026
1bf6577
Start schema deploys asynchronously
hbalasubramanya-rgb Aug 5, 2026
cc19bff
Fix semantic deploy status handling
hbalasubramanya-rgb Aug 5, 2026
a887434
Revert branch to commit 3ad59687
hbalasubramanya-rgb Aug 5, 2026
f4d1953
Improve metadata-grounded SQL generation
hbalasubramanya-rgb Aug 5, 2026
0486b6c
Improve deterministic answer and chart generation
hbalasubramanya-rgb Aug 5, 2026
24b5d03
Return prose explanations for deterministic answers
hbalasubramanya-rgb Aug 5, 2026
080d34b
Improve result explanations and categorical charts
hbalasubramanya-rgb Aug 5, 2026
194da8e
Improve relationship-grounded SQL generation
hbalasubramanya-rgb Aug 5, 2026
4c71edc
Improve exact table retrieval and SQL shaping
hbalasubramanya-rgb Aug 5, 2026
915bee5
Stabilize relationship recommendation generation
hbalasubramanya-rgb Aug 5, 2026
d61166d
Prevent relationship recommendation spinner from hanging
hbalasubramanya-rgb Aug 5, 2026
d984771
Improve metadata-based relationship suggestions
hbalasubramanya-rgb Aug 5, 2026
8d1be15
Remove heuristic SQL and relationship fallbacks
hbalasubramanya-rgb Aug 5, 2026
3d3e5a3
Stabilize relationship generation timeout handling
hbalasubramanya-rgb Aug 5, 2026
9a5bc73
Fix duplicate model column preview SQL
hbalasubramanya-rgb Aug 5, 2026
7348188
Improve ask SQL and chart generation flow
hbalasubramanya-rgb Aug 6, 2026
34a12d9
Restore grounded SQL fast path
hbalasubramanya-rgb Aug 6, 2026
ed22007
Revert branch to grounded SQL fast path commit
hbalasubramanya-rgb Aug 6, 2026
8b7a057
Handle missing restored ask task results
hbalasubramanya-rgb Aug 6, 2026
9cc2457
Improve semantic retrieval and grounded SQL generation
hbalasubramanya-rgb Aug 6, 2026
b62765b
Remove hardcoded retrieval and SQL heuristics
hbalasubramanya-rgb Aug 6, 2026
cc52277
Fix Codestral ask pipeline retrieval and indexing
ranjitha-sm7 Aug 6, 2026
de58cb6
Fix semantic deploy and remove embedding char caps
ranjitha-sm7 Aug 6, 2026
a118201
Handle malformed retrieval and recommendation outputs
ranjitha-sm7 Aug 6, 2026
13fa9d0
Reduce MDL duplicate column log noise
ranjitha-sm7 Aug 6, 2026
53a051d
Normalize manifests and harden local LLM JSON handling
ranjitha-sm7 Aug 6, 2026
997cfcc
Build duplicate-safe MDL source projections
ranjitha-sm7 Aug 6, 2026
eca2237
Remove heuristic ask pipeline layers
ranjitha-sm7 Aug 6, 2026
67017ee
Align ask schema retrieval with legacy fallback
ranjitha-sm7 Aug 6, 2026
cf458d2
Remove extra SQL generation contract layer
ranjitha-sm7 Aug 6, 2026
634e646
Make local LLM response format config driven
ranjitha-sm7 Aug 6, 2026
acd7de3
Fix schema retrieval context and deploy preparation
ranjitha-sm7 Aug 6, 2026
fb74f3b
Fix ask SQL generation grounding flow
ranjitha-sm7 Aug 6, 2026
4d892eb
Fix grounded SQL generation with standard aggregates
ranjitha-sm7 Aug 7, 2026
4862f08
Respect provider timeout for SQL generation
ranjitha-sm7 Aug 7, 2026
4a4648c
Restore SQL generation output budget
ranjitha-sm7 Aug 7, 2026
f0be918
Restore legacy table retrieval size
ranjitha-sm7 Aug 7, 2026
3518c7a
Preserve SQL JSON response format for local LLMs
ranjitha-sm7 Aug 7, 2026
ba3b174
Require table descriptions before Ask readiness
ranjitha-sm7 Aug 7, 2026
b48e032
Use selected columns in SQL schema context
ranjitha-sm7 Aug 7, 2026
00508cc
Prevent SQL generation truncation
ranjitha-sm7 Aug 7, 2026
27b7e67
Make SQL generation token limits config driven
ranjitha-sm7 Aug 7, 2026
f631630
Use configured LiteLLM model and preserve SQL correction flow
ranjitha-sm7 Aug 7, 2026
1b248b2
Fix SQL generation legacy flow
ranjitha-sm7 Aug 7, 2026
20e9162
Enforce SQL generation JSON contract
ranjitha-sm7 Aug 7, 2026
6265f16
Fix SQL grounding across ask pipeline
ranjitha-sm7 Aug 7, 2026
980a005
Fix hashed manifest lookup for SQL validation
ranjitha-sm7 Aug 7, 2026
838aec8
Ground SQL generation in retrieved schema
ranjitha-sm7 Aug 7, 2026
32a556e
Restore ask dry-plan validation default
ranjitha-sm7 Aug 7, 2026
a9e0f64
Ground SQL generation prompt in retrieved schema
ranjitha-sm7 Aug 7, 2026
72b4fdd
Fix deploy manifest serialization
ranjitha-sm7 Aug 7, 2026
25e5d77
Restore SQL sample grounding in ask prompts
ranjitha-sm7 Aug 7, 2026
12986e7
Ground SQL generation to retrieved schema
ranjitha-sm7 Aug 7, 2026
67562f6
Keep physical source metadata out of table retrieval
ranjitha-sm7 Aug 7, 2026
1acd303
Fix missing ask result logging
hbalasubramanya-rgb Aug 8, 2026
6ce6b8e
Propagate SQL dialect knowledge into generation
hbalasubramanya-rgb Aug 8, 2026
986a307
Finalize stale restored ask tasks
hbalasubramanya-rgb Aug 8, 2026
15534b9
Validate generated SQL against retrieved schema
hbalasubramanya-rgb Aug 8, 2026
5b44e7f
Regenerate SQL after schema grounding failures
hbalasubramanya-rgb Aug 8, 2026
1ac6f5f
Regenerate schema-grounded SQL before correction
hbalasubramanya-rgb Aug 8, 2026
56b29d3
Keep schema-grounded recovery isolated
hbalasubramanya-rgb Aug 8, 2026
ad07afe
Sanitize schema-grounding ask failures
hbalasubramanya-rgb Aug 8, 2026
7a5446d
Add engine SQL manifest validation patch
hbalasubramanya-rgb Aug 8, 2026
1539289
Enforce metadata-scoped SQL generation
hbalasubramanya-rgb Aug 8, 2026
c61e440
Tighten metadata-grounded SQL validation
hbalasubramanya-rgb Aug 8, 2026
3c08edb
Recover deployed MDL context for SQL generation
hbalasubramanya-rgb Aug 8, 2026
9958eb9
Recover Ask flow after grounded SQL retry failure
hbalasubramanya-rgb Aug 8, 2026
84341ea
Ground raw SQL replies before correction
hbalasubramanya-rgb Aug 8, 2026
e752c7e
Add RetrievedSchemaContext and use in services
ranjitha-sm7 Aug 8, 2026
9435568
Merge branch 'organization-feature' of https://github.com/hbalasubram…
ranjitha-sm7 Aug 8, 2026
bbc7b98
Restore legacy SQL generation post-processing flow
ranjitha-sm7 Aug 8, 2026
1106980
Restore legacy Ask SQL correction flow
ranjitha-sm7 Aug 8, 2026
3a0564e
Preserve SQL generation structured response schema
ranjitha-sm7 Aug 8, 2026
98a8f1a
Remove unused Ask SQL regeneration helpers
ranjitha-sm7 Aug 8, 2026
bb9815d
Restore legacy SQL generation response contract
ranjitha-sm7 Aug 8, 2026
4f6d693
Align SQL post-processing with legacy flow
ranjitha-sm7 Aug 8, 2026
5b756be
Align ask SQL flow with legacy contract
ranjitha-sm7 Aug 8, 2026
ec867eb
Restore legacy ask SQL flow
ranjitha-sm7 Aug 8, 2026
0be05d4
Align ask schema context with legacy SQL flow
ranjitha-sm7 Aug 8, 2026
7e70101
Restore popped stashed commits
ranjitha-sm7 Aug 10, 2026
ae2280d
Fix schema-grounded SQL generation
ranjitha-sm7 Aug 10, 2026
66a2a6a
Restore legacy schema context pruning
ranjitha-sm7 Aug 10, 2026
f3bd423
Revert "Restore legacy schema context pruning"
ranjitha-sm7 Aug 10, 2026
3d7a7ef
Restore legacy schema pruning behavior
ranjitha-sm7 Aug 10, 2026
be6df2c
Restore legacy table reference precedence
ranjitha-sm7 Aug 10, 2026
27c698f
Prepare asks with current manifest
ranjitha-sm7 Aug 10, 2026
49e7e83
Use deployment manifest and remove mdlService
ranjitha-sm7 Aug 12, 2026
e36e032
Ensure ask uses prepared deployment hash
ranjitha-sm7 Aug 12, 2026
58855c3
Align intent classification context with legacy flow
ranjitha-sm7 Aug 12, 2026
7d8fb8b
Preserve intent classification JSON schema
ranjitha-sm7 Aug 12, 2026
1171a05
Revert "Preserve intent classification JSON schema"
ranjitha-sm7 Aug 12, 2026
f2809d1
Restore table reference recovery for imported models
ranjitha-sm7 Aug 12, 2026
305d04f
Align Ask SQL correction with legacy schema recovery
hbalasubramanya-rgb Aug 13, 2026
b907fa9
Ground generated SQL in retrieved schema identifiers
hbalasubramanya-rgb Aug 13, 2026
e9b16f2
Validate generated SQL against retrieved schema
hbalasubramanya-rgb Aug 13, 2026
621337e
Ground SQL prompts in deployment scope
ranjitha-sm7 Aug 13, 2026
8bf7ab7
Inject MDL service into AskingService
ranjitha-sm7 Aug 13, 2026
30af010
Tighten schema-grounded reasoning prompts
ranjitha-sm7 Aug 13, 2026
ffd57be
Preserve intent classification schema
ranjitha-sm7 Aug 13, 2026
5aba03d
Ground SQL generation with full schema context
hbalasubramanya-rgb Aug 13, 2026
8df658a
Fix SQL correction validation context type
hbalasubramanya-rgb Aug 13, 2026
b54f9a3
Sanitize schema-grounded reasoning output
hbalasubramanya-rgb Aug 13, 2026
80e3e8b
Route general intent through schema retrieval
hbalasubramanya-rgb Aug 13, 2026
3863497
Let schema-backed user guide intent reach SQL
hbalasubramanya-rgb Aug 13, 2026
4b6dd77
Reject ungrounded generated columns before dry run
hbalasubramanya-rgb Aug 13, 2026
be41ad1
Remove hardcoded function names from schema grounding
hbalasubramanya-rgb Aug 13, 2026
56208c2
Use complete retrieved schema for SQL generation
hbalasubramanya-rgb Aug 13, 2026
5a45626
Revert "Use complete retrieved schema for SQL generation"
hbalasubramanya-rgb Aug 13, 2026
86f708c
Revert "Remove hardcoded function names from schema grounding"
hbalasubramanya-rgb Aug 13, 2026
d8f4b79
Use manifest columns for pruned schema grounding
hbalasubramanya-rgb Aug 13, 2026
40c16df
Constrain business labels to verified SQL columns
hbalasubramanya-rgb Aug 13, 2026
94fecfb
Make verified columns the SQL prompt contract
hbalasubramanya-rgb Aug 13, 2026
9c9045f
Fallback to full schema when column pruning is ungrounded
hbalasubramanya-rgb Aug 13, 2026
92aa803
Ignore ungrounded reasoning during SQL generation
hbalasubramanya-rgb Aug 13, 2026
394bbe3
Rebuild correction from schema on grounding failure
hbalasubramanya-rgb Aug 13, 2026
9c1c541
Bind SQL prompts to verified schema columns
hbalasubramanya-rgb Aug 13, 2026
77c98b6
Fix semantics description chunking
hbalasubramanya-rgb Aug 13, 2026
c82e614
Retry semantic chunks after malformed JSON
hbalasubramanya-rgb Aug 13, 2026
1f86889
Extend modeling assistant polling window
hbalasubramanya-rgb Aug 13, 2026
592abcd
Fix modeling assistant generation flow
hbalasubramanya-rgb Aug 14, 2026
9de6914
Speed up modeling semantics generation
hbalasubramanya-rgb Aug 14, 2026
9f8c26b
Align ask SQL flow with legacy defaults
hbalasubramanya-rgb Aug 14, 2026
f8dc3c7
Ground SQL generation prompts in retrieved schema
hbalasubramanya-rgb Aug 14, 2026
cd1e71a
Preserve exact retrieved relation names in SQL prompts
hbalasubramanya-rgb Aug 14, 2026
a7d9766
Align SQL generation with legacy schema flow
hbalasubramanya-rgb Aug 14, 2026
dd5833d
Align ask orchestration with legacy flow
hbalasubramanya-rgb Aug 14, 2026
00b699d
Align SQL generation prompts with legacy flow
hbalasubramanya-rgb Aug 14, 2026
5d6380b
Restore legacy SQL ask orchestration
hbalasubramanya-rgb Aug 15, 2026
68249b8
Align SQL reasoning with schema-grounded legacy flow
hbalasubramanya-rgb Aug 15, 2026
eb8f955
Restore schema-grounded SQL post processing
hbalasubramanya-rgb Aug 15, 2026
61e6544
Remove heuristic SQL grounding layer
hbalasubramanya-rgb Aug 15, 2026
1997c9d
Enforce schema-grounded SQL & improve chunking
ranjitha-sm7 Aug 15, 2026
f535695
Tighten SQL generation grounding and defaults
ranjitha-sm7 Aug 15, 2026
64fb00f
Use litellm.aembedding; simplify LLM/embedder logic
ranjitha-sm7 Aug 15, 2026
e6de312
Revert "Use litellm.aembedding; simplify LLM/embedder logic"
ranjitha-sm7 Aug 15, 2026
c5834df
Enable SQL reasoning, retries, and fallbacks
ranjitha-sm7 Aug 15, 2026
d930165
Simplify SQL prompts and schema retrieval output
ranjitha-sm7 Aug 15, 2026
05967c3
Align SQL generation grounding with legacy flow
hbalasubramanya-rgb Aug 15, 2026
62a9d2d
Align grounded SQL generation with retrieved semantics
hbalasubramanya-rgb Aug 15, 2026
a7206a4
Align SQL generation with grounded reasoning flow
hbalasubramanya-rgb Aug 15, 2026
1d39800
Reduce no-sql refusals for grounded schema matches
hbalasubramanya-rgb Aug 15, 2026
b2e3182
Switch prompts to ANSI SQL and simplify grounding rules
ranjitha-sm7 Aug 15, 2026
301ca92
Relax schema validation and adjust SQL/DB pipeline
ranjitha-sm7 Aug 15, 2026
c9d63ba
Refine SQL prompts, rules, and semantics handling
ranjitha-sm7 Aug 15, 2026
42d28fc
Require JSON output; always format response
ranjitha-sm7 Aug 15, 2026
f5a6936
Validate and retry on incomplete semantics output
ranjitha-sm7 Aug 15, 2026
1b7a2b4
Update modeling
ranjitha-sm7 Aug 15, 2026
e2a6108
Align SQL grounding with legacy flow
hbalasubramanya-rgb Aug 16, 2026
eb62abe
Preserve schema columns in semantic generation
hbalasubramanya-rgb Aug 16, 2026
bff7dd8
Preserve semantics schema on truncated LLM output
hbalasubramanya-rgb Aug 16, 2026
7261d61
Improve modeling semantic generation metadata
hbalasubramanya-rgb Aug 16, 2026
16dc1b8
Make semantic description generation resilient to timeouts
hbalasubramanya-rgb Aug 16, 2026
1e5a54a
Keep semantic timeout handling config driven
hbalasubramanya-rgb Aug 16, 2026
2e3628d
Fill missing semantic aliases and descriptions generically
hbalasubramanya-rgb Aug 16, 2026
4e9319e
Ensure generated semantic aliases are populated
hbalasubramanya-rgb Aug 16, 2026
8ebcbb4
Require complete generated semantic metadata
hbalasubramanya-rgb Aug 16, 2026
473f797
Validate and preserve generated semantic aliases
hbalasubramanya-rgb Aug 16, 2026
e9df882
Allow generated semantic column types
hbalasubramanya-rgb Aug 16, 2026
f892b49
Tolerate extra semantic response fields
hbalasubramanya-rgb Aug 16, 2026
70c0167
Bind generated semantics to selected schema
hbalasubramanya-rgb Aug 16, 2026
aea34e9
Simplify semantics description pipeline and service
ranjitha-sm7 Aug 16, 2026
694a046
Simplify semantics description config
ranjitha-sm7 Aug 16, 2026
a0b71c2
Handle missing 'models' key in normalize
ranjitha-sm7 Aug 16, 2026
df95e4b
Simplify DB schema retrieval and DDL builders
ranjitha-sm7 Aug 16, 2026
30d25cd
Handle missing SQL generation fields
ranjitha-sm7 Aug 16, 2026
82fe9c7
Update semantics generation
ranjitha-sm7 Aug 16, 2026
64fde90
Validate SQL generation before execution
hbalasubramanya-rgb Aug 16, 2026
3b8b086
Align ask SQL generation with legacy grounding
hbalasubramanya-rgb Aug 16, 2026
09f9489
Restore legacy grounded ask flow
hbalasubramanya-rgb Aug 16, 2026
ca5ea63
Tighten grounded SQL generation contract
hbalasubramanya-rgb Aug 16, 2026
4c80dbf
Validate generated SQL against retrieved schema
hbalasubramanya-rgb Aug 16, 2026
1f3016b
Align SQL generation with retrieved schema context
hbalasubramanya-rgb Aug 16, 2026
fbbda6c
Refresh SQL generation prompts and retries
ranjitha-sm7 Aug 16, 2026
9606d40
Simplify LiteLLM request kwargs handling
ranjitha-sm7 Aug 16, 2026
878d0fb
Simplify DB schema retrieval and DDL builders
ranjitha-sm7 Aug 16, 2026
7879c7f
Revert "Simplify LiteLLM request kwargs handling"
ranjitha-sm7 Aug 16, 2026
5c53dce
prompt updates
ranjitha-sm7 Aug 16, 2026
e43a554
Align ask SQL grounding with legacy flow
hbalasubramanya-rgb Aug 16, 2026
5639506
Fix SQL generation startup import
hbalasubramanya-rgb Aug 16, 2026
4eea2ed
Restore grounded SQL reasoning handoff
hbalasubramanya-rgb Aug 16, 2026
e8279e2
Keep ask SQL grounded in selected schema
hbalasubramanya-rgb Aug 16, 2026
5622cc5
Restore deployed view context in ask retrieval
hbalasubramanya-rgb Aug 16, 2026
ec277dc
Stop SQL generation from using planning text
hbalasubramanya-rgb Aug 16, 2026
3682160
Remove SQL generation prompt test file
hbalasubramanya-rgb Aug 16, 2026
7a4c15d
Ground SQL generation in retrieved schema
hbalasubramanya-rgb Aug 16, 2026
2abccff
Fix SQL correction graph document type
hbalasubramanya-rgb Aug 16, 2026
0817a68
Add exact schema catalog to SQL prompts
hbalasubramanya-rgb Aug 17, 2026
c106d93
Align ask retrieval flow with legacy
hbalasubramanya-rgb Aug 17, 2026
639571f
Align ask schema retrieval with legacy scope
hbalasubramanya-rgb Aug 17, 2026
a3a9710
Enforce Wren SQL dialect in generation prompts
hbalasubramanya-rgb Aug 17, 2026
9722f7d
Strengthen Wren SQL schema contract
hbalasubramanya-rgb Aug 17, 2026
c6c69ea
Prioritize Wren identifier contract in SQL prompts
hbalasubramanya-rgb Aug 17, 2026
0c26452
Preserve retrieved schema grounding
hbalasubramanya-rgb Aug 17, 2026
16ce5a1
Remove non-schema SQL examples from prompts
hbalasubramanya-rgb Aug 17, 2026
73cd700
Add 1000 test questions
hbalasubramanya-rgb Aug 17, 2026
923fa09
Handle malformed SQL tokens in grounding
hbalasubramanya-rgb Aug 17, 2026
8ffe9b1
Restore diagnostic context for SQL correction
hbalasubramanya-rgb Aug 17, 2026
510b938
Parse retrieved schema contracts for SQL grounding
hbalasubramanya-rgb Aug 17, 2026
e7b6e5a
Ground ask SQL generation in schema contract
hbalasubramanya-rgb Aug 17, 2026
d9f7b84
Fix semantics description chunk retry handling
hbalasubramanya-rgb Aug 18, 2026
239edf5
Enhance MDL semantic metadata grounding
hbalasubramanya-rgb Aug 18, 2026
cc55d1e
Improve Ask schema grounding
snjkmrd233etag Aug 20, 2026
aa3ee73
Update Ask grounding handoff with PR status
snjkmrd233etag Aug 20, 2026
3e8d3c6
Clarify PR head in Ask grounding handoff
snjkmrd233etag Aug 20, 2026
4a199fc
Broaden Ask semantic grounding coverage
snjkmrd233etag Aug 20, 2026
b84d4b4
Update Ask grounding verification handoff
snjkmrd233etag Aug 20, 2026
d137601
Record final Ask verification blocker
snjkmrd233etag Aug 20, 2026
ea8127c
Fix same-thread Ask lifecycle and metric grounding
snjkmrd233etag Aug 20, 2026
4a040c8
Improve ticket status grounding
snjkmrd233etag Aug 20, 2026
cb6b70a
Remove hardcoded Ask schema grounding maps
snjkmrd233etag Aug 20, 2026
6fdfac2
Fix schema-driven Ask fallback grounding
snjkmrd233etag Aug 20, 2026
2f4d8f3
Tighten schema-driven Ask semantic validation
snjkmrd233etag Aug 20, 2026
e890ac4
Improve Ask schema grounding
snjkmrd233etag Aug 20, 2026
a3df06d
Optimize schema-grounded Ask pipeline
snjkmrd233etag Sep 1, 2026
b979b65
Resolve Ask pipeline integration conflicts
snjkmrd233etag Sep 1, 2026
f604eb6
Fix SQL correction startup annotation
snjkmrd233etag Sep 1, 2026
4344c61
Restore retrieval column pruning node
snjkmrd233etag Sep 1, 2026
57e5f75
Fix retrieval no-pruning result return
snjkmrd233etag Sep 1, 2026
d359025
Fix SQL generation validation context plumbing
snjkmrd233etag Sep 1, 2026
67dd42f
Restore SQL generation identifier catalog imports
snjkmrd233etag Sep 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
256 changes: 256 additions & 0 deletions WRENAI_LOCAL_ASK_HANDOFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,256 @@
# WrenAI Ask Schema Grounding Handoff

Date: 2026-09-01

## Current Branch

- Workspace: `D:\WrenAI`
- Branch: `organization/ask-schema-grounding-20260820`
- Local HEAD before this handoff commit: `0ff1e6e23 Improve Ask schema grounding`
- Direct push from `D:\WrenAI` was rejected because the local branch was behind the remote branch.
- The push was prepared from clean integration worktree `D:\WrenAI-push-ask-20260901`.
- Integration base: remote `organization/ask-schema-grounding-20260820` at `2f4d8f360 Tighten schema-driven Ask semantic validation`.
- Local commits replayed onto the remote tip: `0ff1e6e23` and `5179591df`.
- Merge-resolution fixes were applied in the integration worktree and validated before push.
- Do not use `.codex-tmp` as runtime source. The AI service was restarted from `D:\WrenAI\wren-ai-service`.

## Goal Continued

Continue the WrenAI Ask schema-grounding work for CWPay and CW_GL while preserving Orders and PCB_DB behavior. The focus of this continuation was Ask speed and correctness on large schemas:

- add timing logs for Ask stages
- identify slow stages
- reduce unnecessary LLM calls
- cache schema-derived metadata and ranking inputs
- keep SQL generation schema-verified
- return clear unsupported results instead of hallucinated SQL
- validate CWPay, CW_GL, Orders, and PCB_DB

## What Was Done

### Timing and Observability

Ask timing logs now cover the key path across UI and AI service:

- frontend request
- task creation
- schema retrieval support context
- schema retrieval
- candidate ranking
- LLM intent generation
- SQL generation / deterministic fast path
- SQL validation
- SQL execution
- answer formatting request and polling
- cancel request and cancellation point

Relevant logs reviewed:

- `.codex-tmp\ai-dev-after13.err.log`
- `.codex-tmp\ai-dev-after14.err.log`
- `.codex-tmp\ai-dev-after15.err.log`
- `.codex-tmp\ai-dev-after17.err.log`
- `.codex-tmp\ai-dev-after19.err.log`
- `.codex-tmp\ai-dev-after20.err.log`

Final stage summary from `.codex-tmp\ai-dev-after20.err.log`:

- `sql_generation_fast_path`: avg about 1.4s, max about 2.8s
- `schema_retrieval`: avg about 0.5s, max about 1.5s
- `schema_retrieval_support_context`: avg about 19ms
- task creation and frontend markers were effectively negligible
- no LLM intent generation was used by the final Ask validation tasks except the explicit cancel test

There is one non-Ask background outlier in the same AI log: `schema_retrieval_total` around 142s from a column-pruning/question-recommendation path. It was not part of the final Ask task timing set.

### Performance Improvements

- Added deterministic schema-driven fast paths for clear count, grouping, top-N, latest, date/month bucket, distribution, listing, and same-thread group-result follow-up shapes.
- Added pre-intent unsupported handling for simple analytics requests when active-project schema coverage is missing.
- Added schema metadata/token/index caching for table/column/description-derived matching.
- Changed large-schema retrieval to broad candidate gathering and small top-K reranking.
- Changed generation-context limiting to skip oversized candidates and continue looking for smaller valid candidates within the token budget.
- Tightened same-thread follow-up grounding to use compact latest verified SQL/table identifiers instead of accumulating stale or oversized history.
- Preserved schema validation and dry-run validation. Unsupported cases return `NO_RELEVANT_SQL` instead of invalid SQL.
- Fixed SQL literal offset handling so extracted filter values are validated against the right columns.
- Fixed top record/listing behavior so row-level date questions order by verified date columns instead of unrelated numeric fields.
- Tightened answer formatting prompts to use executed SQL result rows only and not invent analysis, values, code, or examples.
- Added transient MSSQL deadlock retry around Ibis query execution.

### Count Shape Fix

The CWPay question `How many invoice records are there?` now returns a scalar aggregate:

```sql
SELECT
COUNT(*) AS "record_count"
FROM
"dbo_View_Open_Invoices"
```

The result shape is one column, `record_count`, and one row. It no longer returns invoice detail columns for that simple count shape.

### Same-Thread Follow-Ups

Follow-up questions now retrieve exact prior verified tables from the latest SQL and use a compact grounding query. This fixed the slow same-thread path that previously fell back to LLM calls on large schemas.

Final targeted follow-up waits:

- CWPay: about 3.0s
- CW_GL: about 3.0s
- Orders: about 3.1s
- PCB_DB: about 2.0s

## Validation Results

Final artifacts:

- `.codex-tmp\ask_perf_benchmark_after_final.json`
- `.codex-tmp\resume_schema_grounding_validation_after_final.json`
- `.codex-tmp\cancel_check_after20.json`

Before/after benchmark:

- Before avg Ask wait: 61,818.6ms
- Before max Ask wait: 143,366ms
- After avg Ask wait: 3,388ms
- After max Ask wait: 5,056ms

Observed CWPay examples:

- `How many invoice records are there?`
- before: 84,653ms
- after: 3,031ms
- final SQL uses scalar `COUNT(*) AS "record_count"`
- `Show invoices by business unit`
- before: 112,881ms
- after: 3,036ms
- final SQL groups by verified `bunit`

Final full validation:

- Project checks: 4/4
- Ask cases: 18/18
- Same-thread follow-ups: 4/4

Project checks:

- CWPay: 364 datasource tables, 350 models, modeling page passed, preview 3/3, deploy `SUCCESS`, sync `SYNCRONIZED`
- CW_GL: 223 datasource tables, 223 models, modeling page passed, preview 3/3, deploy `SUCCESS`, sync `SYNCRONIZED`
- Orders: 103 datasource tables, 101 models, modeling page passed, preview 3/3, deploy `SUCCESS`, sync `SYNCRONIZED`
- PCB_DB: 76 datasource tables, 68 models, modeling page passed, preview 3/3, deploy `SUCCESS`, sync `SYNCRONIZED`

Regression status:

- Orders by customer: passed
- Orders revenue/date/month/latest families: passed
- PCB_DB repairs/status/priority/month/latest families: passed
- Unsupported cross-project questions: passed with `NO_RELEVANT_SQL`
- No observed schema leakage between projects
- No observed `Failed to create asking task`
- No observed hallucinated tables or columns in final validation

Cancel validation:

- CWPay cancel task: `7a2e1247-2a73-4a52-9fdd-d41004afc3c7`
- cancel mutation returned `true`
- final status: `STOPPED`
- elapsed to terminal status: 520ms

## Tests Run

From `D:\WrenAI\wren-ai-service`:

```powershell
.\venv\Scripts\python.exe -m pytest tests/pytest/services/test_ask.py tests/pytest/pipelines/generation/test_sql_schema_grounding.py tests/pytest/pipelines/retrieval/test_db_schema_retrieval.py -q
```

Result: 114 passed.

Additional focused Ask service test:

```powershell
.\venv\Scripts\python.exe -m pytest tests/pytest/services/test_ask.py -q
```

Result: 4 passed.

Post-integration focused test from `D:\WrenAI-push-ask-20260901\wren-ai-service` using the existing `D:\WrenAI` virtualenv:

```powershell
D:\WrenAI\wren-ai-service\venv\Scripts\python.exe -m pytest tests/pytest/services/test_ask.py tests/pytest/pipelines/generation/test_sql_schema_grounding.py tests/pytest/pipelines/retrieval/test_db_schema_retrieval.py tests/pytest/pipelines/generation/test_sql_answer_prompt.py tests/pytest/pipelines/indexing/test_db_schema.py tests/pytest/pipelines/generation/test_prompt_grounding_contracts.py -q
```

Result: 139 passed, 1 skipped.

Targeted Jest command was attempted through the repo Yarn release:

```powershell
node .yarn/releases/yarn-4.5.3.cjs test src/apollo/server/services/tests/queryService.test.ts --runInBand
```

It did not reach the changed `QueryService` tests because TypeScript compilation failed first in existing `src/apollo/server/repositories/baseRepository.ts` type errors.

Warnings were pre-existing Pydantic deprecation warnings and existing coroutine cleanup warnings in semantics-preparation tests.

## Files To Include In Handoff Commit

Include the Ask/UI source and focused tests:

- `wren-ai-service/src/pipelines/generation/data_assistance.py`
- `wren-ai-service/src/pipelines/generation/followup_sql_generation.py`
- `wren-ai-service/src/pipelines/generation/followup_sql_generation_reasoning.py`
- `wren-ai-service/src/pipelines/generation/intent_classification.py`
- `wren-ai-service/src/pipelines/generation/sql_answer.py`
- `wren-ai-service/src/pipelines/generation/sql_correction.py`
- `wren-ai-service/src/pipelines/generation/sql_generation.py`
- `wren-ai-service/src/pipelines/generation/sql_generation_reasoning.py`
- `wren-ai-service/src/pipelines/generation/utils/sql.py`
- `wren-ai-service/src/pipelines/indexing/db_schema.py`
- `wren-ai-service/src/pipelines/indexing/utils/helper.py`
- `wren-ai-service/src/pipelines/retrieval/db_schema_retrieval.py`
- `wren-ai-service/src/web/v1/routers/ask.py`
- `wren-ai-service/src/web/v1/services/ask.py`
- `wren-ai-service/src/web/v1/services/ask_feedback.py`
- `wren-ai-service/src/web/v1/services/sql_answer.py`
- `wren-ai-service/tests/pytest/pipelines/generation/test_prompt_grounding_contracts.py`
- `wren-ai-service/tests/pytest/pipelines/generation/test_sql_answer_prompt.py`
- `wren-ai-service/tests/pytest/pipelines/generation/test_sql_schema_grounding.py`
- `wren-ai-service/tests/pytest/pipelines/indexing/test_db_schema.py`
- `wren-ai-service/tests/pytest/pipelines/retrieval/test_db_schema_retrieval.py`
- `wren-ai-service/tests/pytest/services/test_ask.py`
- `wren-ui/src/apollo/server/adaptors/wrenAIAdaptor.ts`
- `wren-ui/src/apollo/server/backgrounds/textBasedAnswerBackgroundTracker.ts`
- `wren-ui/next.config.js`
- `wren-ui/src/apollo/server/resolvers/askingResolver.ts`
- `wren-ui/src/apollo/server/resolvers/modelResolver.ts`
- `wren-ui/src/apollo/server/services/askingService.ts`
- `wren-ui/src/apollo/server/services/askingTaskTracker.ts`
- `wren-ui/src/apollo/server/services/queryService.ts`
- `wren-ui/src/apollo/server/services/tests/queryService.test.ts`
- `wren-ui/src/apollo/server/utils/manifest.ts`
- `WRENAI_LOCAL_ASK_HANDOFF.md`

Do not include:

- `.codex-tmp`
- local configs
- logs
- venv folders
- extracted datasource dumps
- Qdrant/storage runtime data
- `wren-engine` submodule pointer
- `wren-ui/.yarn/releases/yarn-4.5.3.cjs` mode-only churn
- `wren-ui/package-lock.json` unless intentionally changing package management

## Remaining Blockers

- Modeling AI Assistant generate semantics/relationships for CW_GL remains unresolved. Earlier evidence showed semantics omitted the selected model and relationships timed out. Final Ask performance validation skipped assistant generation checks.
- Direct push from the original dirty workspace was rejected as non-fast-forward; the final push was prepared by replaying the work onto the remote tip in a clean integration worktree.

## Guardrails Preserved

- No app logic hardcodes datasource, project, organization, table, column, filter-value, or prompt-specific mappings.
- SQL is generated only from verified retrieved schema and then validated.
- Answer formatting is grounded in executed SQL results only.
- Unsupported or weakly covered questions fail quickly with a clear unsupported/clarification result.
6 changes: 5 additions & 1 deletion deployment/kustomizations/base/cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,17 @@ data:
column_indexing_batch_size: 50
table_retrieval_size: 10
table_column_retrieval_size: 100
allow_intent_classification: true
allow_intent_classification: false
allow_sql_generation_reasoning: true
allow_sql_functions_retrieval: true
enable_column_pruning: false
max_sql_correction_retries: 3
query_cache_maxsize: 1000
query_cache_ttl: 3600
semantics_description_max_models_per_batch: 4
semantics_description_max_columns_per_batch: 50
semantics_description_max_concurrent_tasks: 4
semantics_description_generation_timeout_seconds: 120
langfuse_host: https://cloud.langfuse.com
langfuse_enable: true
logging_level: DEBUG
Expand Down
20 changes: 12 additions & 8 deletions docker/config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,42 @@ models:
model: gpt-4.1-nano-2025-04-14
context_window_size: 1000000
kwargs:
max_tokens: 4096
max_tokens: 8192
n: 1
seed: 0
temperature: 0
- model: gpt-4.1-mini-2025-04-14
context_window_size: 1000000
kwargs:
max_tokens: 4096
max_tokens: 8192
n: 1
seed: 0
temperature: 0
- model: gpt-4.1-2025-04-14
context_window_size: 1000000
kwargs:
max_tokens: 4096
max_tokens: 8192
n: 1
seed: 0
temperature: 0
- model: gpt-5-nano-2025-08-07
context_window_size: 380000
kwargs:
max_completion_tokens: 4096
max_completion_tokens: 8192
n: 1
seed: 0
reasoning_effort: minimal
- model: gpt-5-mini-2025-08-07
context_window_size: 380000
kwargs:
max_completion_tokens: 4096
max_completion_tokens: 8192
n: 1
seed: 0
reasoning_effort: minimal
- model: gpt-5-2025-08-07
context_window_size: 380000
kwargs:
max_completion_tokens: 4096
max_completion_tokens: 8192
n: 1
seed: 0
reasoning_effort: minimal
Expand Down Expand Up @@ -176,12 +176,16 @@ settings:
table_retrieval_size: 10
table_column_retrieval_size: 100
allow_intent_classification: true
allow_sql_generation_reasoning: true
allow_sql_generation_reasoning: false
allow_sql_functions_retrieval: true
enable_column_pruning: false
max_sql_correction_retries: 3
query_cache_maxsize: 1000
query_cache_ttl: 3600
semantics_description_max_models_per_batch: 4
semantics_description_max_columns_per_batch: 50
semantics_description_max_concurrent_tasks: 4
semantics_description_generation_timeout_seconds: 120
langfuse_host: https://cloud.langfuse.com
langfuse_enable: true
logging_level: DEBUG
Expand All @@ -190,4 +194,4 @@ settings:
sql_pairs_similarity_threshold: 0.7
sql_pairs_retrieval_max_size: 10
instructions_similarity_threshold: 0.7
instructions_top_k: 10
instructions_top_k: 10
Loading
Loading