Skip to content
Self-hosting

RAG indexing

RAG adds relevant existing code and docs to the AI reviewer prompt. It is additive and fail-safe.

Prerequisites

Repo activation
GITTENSORY_REVIEW_RAG=true and the repo in GITTENSORY_REVIEW_REPOS, or a private per-repo feature toggle.
Vector backend
SQLite vectors by default, Qdrant with the qdrant profile, or Postgres/pgvector where configured.
Embedding provider
An OpenAI-compatible embeddings endpoint with a model whose dimension matches the vector collection.

Qdrant and Ollama example

.env
GITTENSORY_REVIEW_RAG=true
GITTENSORY_REVIEW_REPOS=owner/repo
QDRANT_URL=http://qdrant:6333
QDRANT_DIM=1024
AI_EMBED_BASE_URL=http://ollama:11434/v1
AI_EMBED_MODEL=bge-m3
docker compose --profile qdrant --profile ollama up -d
docker compose exec ollama ollama pull bge-m3
bash

Indexing

RAG needs an index before it can retrieve useful context. A cold or missing index degrades to no context; the review still runs.

curl -X POST http://localhost:8787/v1/internal/jobs/rag-index \
  -H "authorization: Bearer $INTERNAL_JOB_TOKEN" \
  -H "content-type: application/json" \
  -d '{"repoFullName":"owner/repo"}'
bash

Operational checks

  • Boot logs should include selfhost_embed_provider when an embedding provider is configured.
  • Qdrant mode should log selfhost_vectorize with backend qdrant.
  • Empty RAG context usually means the repo is not indexed, the embed model is unavailable, or dimensions do not match.
RAG is context, not authority. The AI reviewer still has to verify every claim against the diff, grounding, and review rules.

Pair RAG with AI providers and optionally REES.