---
title: "Deploy Spring AI RAG Starter"
description: "Ask questions about your PDFs and docs. Java, Spring AI and pgvector."
category: "AI/ML"
url: https://railway.com/deploy/spring-ai-rag-starter
---

# Deploy Spring AI RAG Starter

Ask questions about your PDFs and docs. Java, Spring AI and pgvector.

**[Deploy Spring AI RAG Starter on Railway](https://railway.com/template/spring-ai-rag-starter)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/spring-ai-rag-starter/manifest.json

- **Creator:** morpheous7's Projects
- **Category:** AI/ML

## Template content

### pgvector https://devicons.railway.app/postgres

- **Image:** pgvector/pgvector:pg18
- **Start command:** `/bin/sh -c "unset PGPORT; docker-entrypoint.sh postgres --port=5432"`

### API https://raw.githubusercontent.com/Morpheous7/Spring-AI-RAG-Starter/main/assets/icon.png

- **Source:** https://github.com/Morpheous7/Spring-AI-RAG-Starter
- **Health check:** /actuator/health
- **Public domain:** Yes

## Documentation

# Deploy and Host Spring AI RAG Starter on Railway

Spring AI RAG Starter is a ready-to-run Java service for asking questions about your own documents. Upload PDFs, text or Markdown files, then search them in plain English from a built-in web page or a REST API. It is built on Spring Boot 4, Spring AI 2 and Postgres with pgvector.

## About Hosting Spring AI RAG Starter

The template deploys two services: the API, built from source with a Dockerfile, and a pgvector database with a persistent volume, connected over Railway's private network. The embedding model is bundled inside the app, so search works without any outside AI service or API key. Each deployment generates its own access key (APP_API_KEY in the API service's Variables tab) that protects every endpoint. Give the API at least 1 GB of memory. For written answers with citations, set AI_CHAT=openai and add your OPENAI_API_KEY.

## Common Use Cases

- Search a team handbook, policies or internal docs in plain English
- Add question answering over PDFs to an existing app through the REST API
- Start a Java RAG project from a working, deployed baseline

## Dependencies for Spring AI RAG Starter Hosting

- Postgres with the pgvector extension (included in this template)
- Optional: an OpenAI API key for written answers

### Implementation Details 

[Include any code snippets or implementation details. This section is optional. Exclude if nothing to add.]

## Why Deploy Spring AI RAG Starter on Railway?


Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Spring AI RAG Starter on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [Weaviate](https://railway.com/deploy/weaviate-1) — Vector database with hybrid search and an API key-protected API
- [Möbius Personal AI OS](https://railway.com/deploy/mobius-v01-personal-ai-os) — Self-hosted AI agent that builds and runs apps for you, with memory.

Open this page in a browser: https://railway.com/deploy/spring-ai-rag-starter
