Agentic AI on the JVM
Centralize error handling behind one contract, trace requests across services and LLM calls with OpenTelemetry, then build a multi-agent investigation system with LangChain4j, Neo4j, and Qdrant.
- Step 1 of 3 Centralized exception handling in REST APIs with Spring and FastAPI One global exception handler logs the full stack trace and returns a small JSON error with a code, a message and a timestamp. The same design in Spring with @RestControllerAdvice and in FastAPI with exception handlers.
- Step 2 of 3 One trace ID across Spring Boot, FastAPI and LangChain on Kubernetes with OpenTelemetry and Grafana OpenTelemetry gives every request a trace ID and sends it to every service it calls. The same ID goes into every log line, so one Loki query returns all the logs of a request and links to its trace in Tempo. The demo runs three services on Minikube.
- Step 3 of 3 InvestigatorAI: a multi-agent investigation system with LangChain4j, Neo4j and Qdrant A supervisor agent splits an investigation question into parts and calls five specialist agents. The agents query a company ownership graph in Neo4j and a document collection in Qdrant, and Langfuse traces every step. One investigation takes 30 to 70 seconds on a local model. Built with LangChain4j and Spring Boot.