S
Supanote
Sign in Sign up

PostgreSQL with pgvector & Redis RAG Embedding Stack

plain (yaml) 1 month ago · 34 lines · 234 views
Verified Blueprint PostgreSQL

Docker Compose configuration with PostgreSQL 16, pgvector extension, HNSW indexing, and Redis cache for AI embeddings.

Quick Fetch
1version: '3.8'
2
3services:
4 pgvector-db:
5 image: pgvector/pgvector:pg16
6 container_name: postgres-pgvector
7 restart: unless-stopped
8 environment:
9 POSTGRES_USER: ${DB_USER:-vector_user}
10 POSTGRES_PASSWORD: ${DB_PASSWORD:-change-me}
11 POSTGRES_DB: ${DB_NAME:-embeddings_store}
12 ports:
13 - "5432:5432"
14 volumes:
15 - pgvector_data:/var/lib/postgresql/data
16 - ./init-scripts:/docker-entrypoint-initdb.d
17 command: >
18 postgres
19 -c shared_preload_libraries=vector
20 -c max_connections=100
21 -c shared_buffers=1GB
22 -c work_mem=64MB
24 redis-cache:
25 image: redis:7-alpine
26 container_name: vector-cache
27 restart: unless-stopped
28 ports:
29 - "6379:6379"
30 command: ["redis-server", "--maxmemory", "512mb", "--maxmemory-policy", "allkeys-lru"]
32volumes:
33 pgvector_data:

No replies yet

Every reply is a note. Start a discussion, ask a question, or attach a code snippet.

Related PostgreSQL & AI & LLM Tools Blueprints

Production-ready configurations and diagnostics from the verified Supanote library.

All AI & LLM Tools →
Interactive Developer Workbench: Online JSON Formatter, Validator & Viewer

Validate, pretty-print, minify, and inspect JSON API responses with exact syntax error pinpointing.

Open JSON Formatter →

Share Note

Open
Download SVG
Social Card Preview
Open on mobile
Point your phone camera to open this note directly

Report this note

Notification