How simijain23/insurance-ai-sql-assistant works
Insurance AI SQL Assistant is a Spring Boot backend for natural-language insurance queries and customer data management. Its principal workflow accepts a chat prompt, uses Groq to generate read-only SQL, executes the query against MySQL, and returns results through REST. It also exposes customer management and stores/retrieves chat history. The README documents these capabilities and the high-level flow; source excerpts were not available, so internal call ownership and finer validation details cannot be verified.
Main entry points: GroqController.java REST API · SqlQueryService.java SQL Execution · CustomerController.java Customer API · CustomerService.java Customer Service
Components 14
REST and Chat
- REST API
src/main/java/com/example/demo/ai/GroqController.java - Chat DTOs
src/main/java/com/example/demo/dto - Chat History
src/main/java/com/example/demo/repository/ChatHistoryRepository.java
AI Query Flow
- Groq LLM
- SQL Execution
src/main/java/com/example/demo/service/SqlQueryService.java
Insurance Data
- MySQL
- Customer API
src/main/java/com/example/demo/controller/CustomerController.java - Customer Service
src/main/java/com/example/demo/service/CustomerService.java - Customer Repository
src/main/java/com/example/demo/repository/CustomerRepository.java - Policy Repository
src/main/java/com/example/demo/repository/PolicyRepository.java - Insurance Entities
src/main/java/com/example/demo/entity
Application Support
- App Configuration
src/main/java/com/example/demo/config/AppConfig.java - Exception Handling
src/main/java/com/example/demo/exception/GlobalExceptionHandler.java
Other components
- User
Connections 13
- User → REST API: sends prompt
README.md - REST API → Groq LLM: requests SQL
README.md - Groq LLM → SQL Execution: generates SQL
README.md - SQL Execution → MySQL: executes read-only
README.md - MySQL → REST API: returns results
README.md - REST API → Chat DTOs: uses DTOs
README.md - REST API → Chat History: stores and retrieves
README.md - User → Customer API: creates customer
README.md - Customer API → Customer Service: delegates
- Customer Service → Customer Repository: uses repository
- Customer Repository → MySQL: persists data
- Policy Repository → MySQL: accesses data
- MySQL → Insurance Entities: stores records