logo
R

RAG Service

Deploy your own RAG (Retrieval-Augmented Generation) service with admin dashboard. Hybrid search (semantic + BM25), API key management, query analytics, and knowledge learning API. Powered by PostgreSQL with pgvector and an OpenAI-compatible AI provider.

Deploy your own RAG (Retrieval-Augmented Generation) service with admin dashboard. Hybrid search (semantic + BM25), API key management, query analytics, and knowledge learning API. Powered by PostgreSQL with pgvector and an OpenAI-compatible AI provider.

PlataformaZeabur
Implementado4
EditorzeaburZeabur
Implementado4 veces
EditorzeaburZeabur
Creado2026-04-04
Etiquetas
AIRAGSearch

RAG Service

A complete RAG service with admin dashboard for managing your knowledge base.

Source code: github.com/zeabur/rag-service

Getting Started

Step 1: Create a Zeabur Project

Go to Zeabur Dashboard and create a new project.

Step 2: Deploy

Add RAG Service from the Marketplace and provide a Zeabur AI Hub API Key for answer generation plus a Gemini API Key for embeddings. The template creates a private PostgreSQL 17 service with pgvector and injects its connection string into the RAG service automatically.

Schema migrations run automatically on first startup — no manual setup needed.

Features

  • Hybrid search: semantic (pgvector) + BM25 keyword with RRF fusion
  • Streaming RAG answers via configurable LLM model
  • Admin dashboard: chunk browser, query signals, reports, audit log
  • API key management with scopes and expiry
  • Knowledge learning API: add new chunks via /api/learn
  • Feedback collection on query results

API Endpoints

EndpointMethodAuthDescription
/api/queryPOSTAPI keySearch knowledge base + optional RAG answer
/api/learnPOSTAPI keyAdd new knowledge chunks
/api/reportPOSTAPI keyReport content issues
/api/feedbackPOSTAPI keySubmit result feedback
/api/admin/*GET/POSTAPI key (admin)API key management, signals, reports, chunks
/dashboardGETBasic AuthAdmin dashboard

Quick Test

curl -X POST "https://your-domain/api/query" \
  -H "Authorization: Bearer $RAG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "how to deploy", "mode": "hybrid", "top_k": 5}'

Agent Integration (Claude Code Plugin)

Install the plugin to let Claude Code agents search and contribute to your knowledge base:

claude plugins marketplace add zeabur/rag-service
claude plugins install rag-service@rag-service
claude
# Inside Claude Code, run: /zeabur-rag-setup

The plugin provides 8 skills: search, learn, report for everyday use, and triage, inspect, edit, curate for admin curation. Agents automatically search the KB when answering questions and can contribute new knowledge after solving problems.

Environment Variables

VariableRequiredDescription
DATABASE_URLAutoPrivate PostgreSQL connection string
ZEABUR_AI_HUB_API_KEYYesZeabur AI Hub key for LLM inference
GEMINI_API_KEYYesGemini API key for embeddings
EMBEDDING_MODELNoEmbedding model (default: gemini-embedding-2)
EMBEDDING_DIMENSIONSNopgvector dimension (default: 1536)
RAG_API_KEYAutoAPI key for service access (auto-generated)
RAG_BASIC_AUTHAutoDashboard auth (auto-generated, format admin:password)
RAG_MODELNoLLM model (default: gemini-2.5-flash-lite)
CORS_ORIGINNoCORS origin (default: service URL)

Embeddings use gemini-embedding-2 (1536d) through the Gemini API by default.

Schema migrations run automatically on first startup.

License

MIT — Built by Zeabur