Skip to content

Conversation

@jqnatividad
Copy link
Collaborator

as one-shot SQL generation is hit and miss
also, allows user to request changes to a working SQL query

- make clippy happy
- rust fmt
- clean up weird rustfmt linebreak choices
- add some more comments
- more language/dialect examples
- space out language special behavior in --prompt (chat) mode
- unconditionally pass analysis_results when generating description and tags
@jqnatividad jqnatividad requested a review from Copilot December 18, 2025 11:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces stateful session support for iterative SQL query refinement through RAG (Retrieval-Augmented Generation). It adds --session and --session-len flags to enable multi-turn conversations where the LLM can refine SQL queries based on execution results and errors, improving upon the limitations of one-shot SQL generation.

Key Changes:

  • Added session state management with persistence to markdown files containing conversation history, baseline SQL, results, and errors
  • Implemented sliding window mechanism for managing session context length with automatic summarization of older messages
  • Enhanced SQL execution tracking to capture and store results (10-row samples) and errors for refinement context

@jqnatividad jqnatividad merged commit 47d3b2f into master Dec 18, 2025
12 of 15 checks passed
@jqnatividad jqnatividad deleted the describegpt-prompt-sessions branch December 18, 2025 12:38
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