Railway

Deploy langserve-pgvector-rag

LangServe RAG API starter with Postgres and pgvector.

Deploy langserve-pgvector-rag

Just deployed

Just deployed

/var/lib/postgresql/data

Deploy and Host LangServe + Postgres/pgvector on Railway

Deploy a useful LangServe RAG API starter on Railway with FastAPI, Postgres, pgvector, ingestion/search endpoints, and optional OpenAI answer generation.

About Hosting LangServe + Postgres/pgvector

LangServe turns LangChain runnables into HTTP APIs. This template provides a real starter rather than a toy prompt demo: it includes document ingestion, pgvector-backed retrieval, a LangServe /rag/invoke route, API-key protection, and an optional OpenAI model call.

Why Deploy LangServe + Postgres/pgvector on Railway

Railway provides the app service, private Postgres networking, persistent pgvector storage, generated API keys, and a public HTTPS endpoint. The app is useful immediately for retrieval testing and can become a production RAG API by adding a provider key.

Common Use Cases

  • RAG API starter
  • Internal document retrieval service
  • LangServe endpoint demo with durable storage
  • OpenAI-compatible context retrieval backend
  • FastAPI/LangChain starter for Railway

Dependencies for LangServe + Postgres/pgvector Hosting

The app requires Postgres with pgvector for document storage and vector search. OPENAI_API_KEY is optional for validation but should be supplied for LLM-generated answers.

Deployment Dependencies

  • DATABASE_URL: private Postgres connection string
  • APP_API_KEY: generated bearer token for protected endpoints
  • OPENAI_API_KEY: deployer-provided provider key for generated answers
  • OPENAI_MODEL: chat model to use when a provider key is supplied

Template Content

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

okisdev
View Template
Hermes Agent | OpenClaw Alternative with Dashboard
Self-improving AI agent with memory, skills, and web dashboard 🤖

codestorm
View Template
EchoDeck
Generate a mp4 from powerpoint with TTS

Fixed Scope