RAG4J (and its Python counterpart RAG4P) is a framework focused on making Retrieval Augmented Generation accessible and easy to understand. While many RAG frameworks exist in the Python ecosystem, Java developers have far fewer options. RAG4J fills that gap with a clean, modular codebase that you can read in about an hour.
The project is built around a modular Maven architecture with separate modules for core abstractions, embeddings (local and OpenAI), vector stores (in-memory and Weaviate), text splitters, and quality evaluation. It supports running entirely locally using ONNX-based embeddings and Ollama for LLMs, making it ideal for workshops and learning without needing external API keys.
A distinguishing feature is its built-in quality assessment module, inspired by the TruLens project, which lets you evaluate the effectiveness of your RAG pipeline. The framework has been used in workshops at conferences like JFall, JFokus, and Teqnation.
- Website: rag4j.org
- Java source: github.com/RAG4J/rag4j
- Python source: github.com/RAG4J/rag4p