A reference project that demonstrates how to:
- build a Spring Boot 3.5 application on Java 21
- read pdf documents from local storage
- transform it based on the TokenTextSplitter
- call OpenAI models through spring-ai
- store and retrieve embeddings in Chroma
- read and chunk documents with the Pdf Reader document reader
- expose simple REST end-points for data ingestion
- Spring Boot
- Spring AI
- OpenAI Integration
- Chroma as Vector Store
- Java 21
- Docker
- Maven
- JDK 21
- Maven
- OpenAI API key
- IDE (IntelliJ IDEA, Eclipse, or VS Code)
All secrets are read from environment variables or the .env file in the
project root (use the provided .env.template as a starting point):
| Variable | Purpose |
|---|---|
OPENAI_API_KEY |
key for OpenAI completions / chat |
Example:
bash
# .env
OPENAI_API_KEY=sk-********************************
API_NINJAS_KEY=ninjas_********************************
- Clone the repository:
git clone [repository-url]
cd spring-ai-etl-vector-store- Configure OpenAI:
Create
application.propertiesinsrc/main/resources/and add:
spring.ai.openai.api-key=your-api-key-here- Build and run:
docker-compose up
mvn clean install
mvn spring-boot:runEndpoint: GET /api/v1/etl/run-ingestion
spring-ai-etl-vecgtor-store/
├── src/
│ ├── main/
│ │ ├── java/
│ │ └── resources/
│ └── test/
└── pom.xml
mvn clean installmvn test- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
For support and questions, please open an issue in the repository.