J.A.R.V.I.S. is an intelligent assistant designed to leverage Retrieval-Augmented Generation (RAG) for delivering accurate and context-aware responses. This project integrates technologies like Spring AI, Llama3, Vaadin, and PGvector to build a scalable, efficient, and secure AI-powered assistant.
- Responsive Chat UI: Built with Vaadin for a modern and user-friendly interface.
- Retrieval-Augmented Generation (RAG): Combines contextual information and memory for precise responses.
- Private Language Model Hosting: Powered by Llama3 hosted via Ollama.
- Vector Search: Utilizes PostgreSQL with PGvector for fast and accurate similarity searches.
- Structured Ingestion Pipeline: Processes and stores documents with Spring AI ETL tools.
- Prompt Engineering: Implements robust system and user prompts for consistent and accurate interactions.
- Frontend: Vaadin
- Backend: Java, Spring AI
- Language Model: Llama3 (via Ollama)
- Database: PostgreSQL with PGvector
- Containerization: Docker Compose
- ETL Tools: Spring AI components
- Docker and Docker Compose
- Java 23 or later
- PostgreSQL with the PGvector extension
- Maven for building the project
-
Clone the Repository
git clone https://github.com/the-sloth-dev/jarvis.git cd jarvis
-
Start PostgreSQL with PGvector
docker-compose up -d pgvector
-
Start Ollama with Llama3
docker-compose up -d ollama
Pull the Llama3 model:
docker exec -it ollama ollama pull llama3
-
Configure the Application Update the
application.yml
file with your environment variables:spring: datasource: url: jdbc:postgresql://localhost:5433/postgres username: postgres password: postgres ai: ollama: base-url: http://localhost:11434 vectorstore: pgvector: index-type: HNSW distance-type: COSINE_DISTANCE dimensions: 768
-
Build and Run the Application
mvn clean install java -jar target/jarvis-0.0.1-SNAPSHOT.jar
-
Access the Application Open http://localhost:8080 in your browser.
Place your documents in the directory specified in the configuration (/tmp/jarvis/documents
by default) and trigger ingestion using the API:
curl -X POST http://localhost:8080/ingest/run
Use the chat interface to ask questions based on the ingested documents.
Defines the assistant's behavior and rules for context and memory usage:
You are an intelligent assistant specialized in retrieval-augmented tasks.
Your primary goal is to provide accurate, concise, and relevant answers strictly based on the provided context and memory.
Guides each query to ensure responses adhere to system rules:
<context>
{question_answer_context}
</context>
User question: {user_question}
We welcome contributions to improve J.A.R.V.I.S.! Please submit pull requests or report issues via GitHub.
This project is licensed under the MIT License. See the LICENSE file for details.
Author: The Sloth Dev
"Building smarter systems, one step at a time!"