Status: [UNTESTED] Endpoints found: http://localhost:8080/api/admin/ingest http://localhost:8080/api/admin/status http://localhost:8080/api/rag/ask?question=Which+pilgrimage+site+has+a+free+community+kitchen Source: https://github.com/debdip03/langchain4j-rag-embeddings-poc # langchain4j-rag-embeddings-poc A Retrieval-Augmented Generation (RAG) pipeline built with **Langchain4j** and **Spring Boot**, using **Ollama** as a completely free, local LLM and embedding-model provider — no API key, no billing, no rate limits. ## Why Ollama for the "free LLM" - Runs entirely on your machine — no signup, no cost, no usage caps. - Langchain4j has first-class support (`langchain4j-ollama`) for both chat and embedding models. - Swappable later: the config class is the only place you'd touch to point at a hosted provider (e.g. Groq, Gemini free tier) instead. ## Prerequisites 1. **Java 21** and **Maven 3.9+** 2. **Ollama** installed — https://ollama.com/download 3. Pull the two models this app uses: ```bash ollama pull llama3.1 ollama pull nomic-embed-text ``` 4. Make sure Ollama is running (it starts a local server on `http://localhost:11434` automatically after install, or run `ollama serve`). ## Project structure ``` langchain4j-rag-embeddings-poc ├── src/main/java/com/gen/ai │ ├── RagEmbeddingsApplication.java # Spring Boot entrypoint │ ├── config/RagEmbeddingsConfig.java # Ollama chat/embedding model + vector store beans │ ├── controller/ │ │ ├── RagEmbeddedChunksRetrievalController.java # GET /api/rag/ask │ │ └── RagEmbeddingsAdminController.java # POST /api/admin/ingest, GET /api/admin/status │ ├── exception/RagEmbeddingsControllerAdvice.java # centralized error handling │ ├── model/ │ │ ├── RagRetrievalResponse.java │ │ └── RetrievedChunk.java │ └── service/ │ ├── RagEmbeddedChunksRetrievalService.java # embed query -> search -> prompt -> LLM answer │ └── RagEmbeddingsAdminService.java # load/split/embed/store source documents ├── src/main/resources/application.yml ├── pilgrimage-tourist-sites/ # sample so