See Building FullStack LangChain4J Application using SpringBoot and React for more details.
Ensure OpenAI API Key is available as env variable:
export AI_OPENAI_API_KEY=$(AI_OPENAI_API_KEY)
And Docker desktop is running. To start the application
./mvnw spring-boot:run
We can now query our internal data using RAG:
GET http://localhost:8080/chat?question=Please list the current applications
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: text/plain;charset=UTF-8
Content-Length: 1002
Here are the current applications:
| Correlation ID | Email | First Name | Last Name | Address | Claim Type | Amount | Status |
|----------------|-----------------|------------|-----------|-------------------------------|--------------|--------|------------------|
| 18666A | [email protected] | Brock | Curtis | 76 Chalmers Ave, Redfern 2119 | FLOODS | 2000 | SUBMITTED |
| 19966A | [email protected] | Brock | Curtis | 76 Chalmers Ave, Redfern 2119 | BUSH_FIRE | 550 | SUBMITTED |
| 21966A | [email protected] | Brock | Curtis | 76 Chalmers Ave, Redfern 2119 | HAIL_DAMAGE | 250 | SUBMITTED |
| 36559B | [email protected] | Joe | Blogg | 40 Bridge Road, Sydney, 2000 | BUSH_FIRE | 300 | APPROVED |
| 91137D | [email protected] | Leandro | Duran | 199 George Street, Newtown, 2000 | HAIL_DAMAGE | 300 | PAYMENT_SUBMITTED |
Response code: 200 (OK); Time: 5417ms (5 s 417 ms); Content length: 1002 bytes (1 kB)
A chatbot interacting with the agent above and built using React is available in following repository: