Samples showing architectural patterns for Modular RAG using Spring AI and Ollama.
- Java 25
- Podman/Docker
The application consumes models from an Ollama inference server. You can either run Ollama locally on your laptop, or rely on the Arconia Dev Services to spin up an Ollama service automatically. If you choose the first option, make sure you have Ollama installed and running on your laptop. Either way, Spring AI will take care of pulling the needed Ollama models when the application starts, if they are not available yet on your machine.
The application consumes the Tavily Search API.
Visit app.tavily.com and sign up for a new account. You can choose the "Researcher" plan to get started for free.
In the Tavily AI console, navigate to Overview. Then, in the API Keys section, generate a new API key. Copy and securely store your API key on your machine as an environment variable. The application will use it to access the Tavily Search API.
export TAVILY_SEARCH_API_KEY=<YOUR-API-KEY>If you're using the native Ollama application, run the application as follows:
./gradlew bootRunAlternatively, you can use the Arconia CLI:
arconia devUnder the hood, the Arconia framework will automatically spin up a PostgreSQL database and a Grafana LGTM observability platform using Testcontainers (see Arconia Dev Services for more information).
If instead you want to rely on the Ollama Dev Service via Testcontainers, run the application as follows.
./gradlew bootRun -Darconia.dev.services.ollama.enabled=trueEither way, the application will be accessible at http://localhost:8080.
The application logs will show you the URL where you can access the Grafana observability platform.
...o.t.grafana.LgtmStackContainer: Access to the Grafana dashboard: http://localhost:38125
By default, logs, metrics, and traces are exported via OTLP using the HTTP/Protobuf format.
In Grafana, you can query the telemetry from the "Drilldown" and "Explore" sections.