https://github.com/javaaidev/simple-text-to-sql
Simple Text to SQL (No RAG), Spring AI Implementation
https://github.com/javaaidev/simple-text-to-sql
java spring-ai spring-boot springframework text-to-sql
Last synced: 3 months ago
JSON representation
Simple Text to SQL (No RAG), Spring AI Implementation
- Host: GitHub
- URL: https://github.com/javaaidev/simple-text-to-sql
- Owner: JavaAIDev
- License: apache-2.0
- Created: 2024-10-09T03:35:59.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-09-19T10:04:57.000Z (4 months ago)
- Last Synced: 2025-09-19T11:31:36.893Z (4 months ago)
- Topics: java, spring-ai, spring-boot, springframework, text-to-sql
- Language: Java
- Homepage: https://javaaidev.com/docs/rag/samples/text-to-sql
- Size: 1.36 MB
- Stars: 3
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Simple Text to SQL (No RAG)
[](https://github.com/JavaAIDev/simple-text-to-sql/actions/workflows/build.yaml)
> See JavaAIDev [article](https://javaaidev.com/docs/rag/samples/text-to-sql) for more details.
Test data: [Netflix data](https://github.com/neondatabase/postgres-sample-dbs?tab=readme-ov-file#netflix-data)
How to run:
1. Requires Java 21 to build and run.
2. Start Postgres database using Docker Compose.
3. Start the server and use [Chat Agent UI](http://localhost:8080/webjars/chat-agent-ui/index.html)
to run query.
Sample query:
```text
How many movies were produced in the United States?
```
Output:
```text
The total number of movies produced in the United States is 2058.
```
See the screenshot below.

## Full Text-to-SQL Implementation
For a complete Text-to-SQL implementation, check out my [course](https://www.udemy.com/course/spring-ai-text-to-sql/?referralCode=6180D9A02FA8BA9D4F60).