feat(customer1): add pgvector RAG knowledge base with embedding service
- Custom PostgreSQL 15.2 image with pgvector 0.8.0 extension - Updated pg-cluster-hermes.yaml: custom image, sharedPreloadLibraries, maintenance_work_mem - RAG schema: documents table with vector(768) embeddings + HNSW index - RAG init job: ConfigMap + Job to apply schema to agent_memory db - Embedding service: FastAPI with nomic-embed-text-v1.5 - OpenAI-compatible /v1/embeddings endpoint - Deployment (1 replica, 2Gi-4Gi memory) + Service manifests - Updated kustomization.yaml to include new resources
This commit is contained in:
parent
99a864171b
commit
4df7450461
13 changed files with 463 additions and 1 deletions
29
apps/base/customer1/hermes-db/Dockerfile.postgres-pgvector
Normal file
29
apps/base/customer1/hermes-db/Dockerfile.postgres-pgvector
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# Custom PostgreSQL 15 image with pgvector extension
|
||||
# Based on CNPG's official image - must preserve OS user, entrypoint, and PGDATA
|
||||
FROM ghcr.io/cloudnative-pg/postgresql:15.2
|
||||
|
||||
# pgvector version (latest stable as of 2026-05)
|
||||
ARG PGVECTOR_VERSION=0.8.0
|
||||
|
||||
# Install build dependencies for compiling pgvector from source
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
git \
|
||||
&& \
|
||||
cd /tmp && \
|
||||
git clone --branch "v${PGVECTOR_VERSION}" --depth 1 https://github.com/pgvector/pgvector.git && \
|
||||
cd pgvector && \
|
||||
make && \
|
||||
make install && \
|
||||
apt-get remove -y build-essential git && \
|
||||
apt-get autoremove -y && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/pgvector
|
||||
|
||||
# Verify pgvector is installed
|
||||
RUN pg_config --version && \
|
||||
ls -la /usr/lib/postgresql/*/lib/vector.so
|
||||
|
||||
# CNPG requirements: same OS user (1000), same entrypoint, same PGDATA
|
||||
# The base image already sets these correctly, so no changes needed.
|
||||
Loading…
Reference in a new issue