This project is an API built using Java, Java Spring, Langchain4j and LM Studio.
The app was developed for my Youtube Tutorial, to demonstrate how to create a simple AI Assistant using RAG technique.
- Clone the repository:
git clone https://github.com/Fernanda-Kipper/ai-assistant-java
- Install dependencies with Maven
- Start the application with Maven
- The API will be accessible at http://localhost:8080
- Install LM Studio
- Download model Google's Gemma 2B Instruct
- Start LM Server
The API provides the following endpoints:
GET USERS
POST /api/chat - Retrieve a list of all users.
{
"message": "List 4 movies of the catalog that have Category Romance"
}
{
"response": "The movies that have Category Romance are: - La La Land - Titanic"
}
The Knowledge base used for retrieve context to RAG technique is the movies.txt located inside src/main/resources
path
Movie Catalog
---
Movie: The Godfather
Year: 1972
Director: Francis Ford Coppola
Actors: Marlon Brando, Al Pacino, James Caan
Category: Action
Synopsis: The saga of the Corleone family in the Italian mafia of New York.
---
Movie: Fight Club
Year: 1999
Director: David Fincher
Actors: Brad Pitt, Edward Norton, Helena Bonham Carter
Category: Action
Synopsis: A disillusioned white-collar worker forms an underground fight club.
---
Movie: Forrest Gump
Year: 1994
Director: Robert Zemeckis
Actors: Tom Hanks, Robin Wright, Gary Sinise
Category: Comedy
Synopsis: The story of a man with low IQ who witnessed or influenced significant events of the 20th century in America, maintaining hope and love for his childhood passion, Jenny.
---
Movie: Titanic
Year: 1997
Director: James Cameron
Actors: Leonardo DiCaprio, Kate Winslet, Billy Zane
Category: Romance
Synopsis: A poor artist and a rich young woman meet and fall in love on the fateful voyage of the RMS Titanic.
---
Movie: La La Land
Year: 2016
Director: Damien Chazelle
Actors: Ryan Gosling, Emma Stone, John Legend
Category: Romance
Synopsis: A jazz musician and an aspiring actress fall in love while pursuing their dreams in a city known for crushing hopes and breaking hearts.
---
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request to the repository.
When contributing to this project, please follow the existing code style, commit conventions, and submit your changes in a separate branch.