Jakarta EE 11 enables RAG implementation using only JDK and standard specifications
Developers can implement Retrieval-Augmented Generation (RAG) within Jakarta EE 11 applications using standard APIs and the JDK, avoiding the need for external Python services or dedicated vector databases.
Summary
A new technical demonstration from the Eclipse Foundation shows how to build a Retrieval-Augmented Generation (RAG) pipeline using the Jakarta EE 11 platform. The approach eliminates the common enterprise requirement for additional Python-based microservices, specialized AI orchestration frameworks, and dedicated vector databases.
By leveraging Java 21 and the Jakarta EE 11 specification suite, the architecture uses standard components to handle model inference via Ollama and data persistence via PostgreSQL. This allows the entire AI-augmented logic to reside within a standard WAR deployment, simplifying the deployment pipeline and reducing the complexity of the distributed system.
Technical implementation of RAG in Jakarta EE 11
- Persistence Layer: Uses Jakarta Persistence 3.2 to store vector embeddings as byte arrays (byte[]) within standard database columns, such as PostgreSQL's bytea, rather than requiring a specialized vector database.
- Data Access: Employs Jakarta Data 1.0 to replace traditional Data Access Objects (DAOs) with declarative repository interfaces, significantly reducing boilerplate code for CRUD operations.
- Concurrency and Networking: Utilizes Jakarta Concurrency 3.1 for managed executors backed by Java 21 virtual threads, while using the built-in java.net.http.HttpClient from the JDK for outbound communication with model servers.
- Search Logic: Implements similarity searches through linear scans and cosine similarity calculations performed directly in Java, which is sufficient for bounded datasets without external search engines.
- Configuration and Injection: Relies on MicroProfile Config for managing AI parameters like model names and temperature, and Jakarta CDI 4.1 for dependency injection and bean lifecycle management.
Why it matters
This approach demonstrates that enterprise Java teams can integrate AI capabilities into existing workflows without adopting entirely new language stacks or complex infrastructure. It reduces the operational overhead for sysadmins by consolidating deployment pipelines and simplifies the development lifecycle for software engineers by staying within the Jakarta EE ecosystem.
Original reference: newsroom.eclipse.org →