- db/Dockerfile: postgis:16-3.4 + postgresql-16-pgvector (works around the EOL bullseye release files: disable Check-Valid-Until, add pgdg repo) - 20-vector.sql: CREATE EXTENSION vector on first boot - embed/main.go (embedpoi): build poi_vec from poi — zembed embeddings of 'name — kind' (2560-d), resumable, HNSW cosine index at the end - main.go: /semantic endpoint (embeds q with the local model, cosine <=> over poi_vec, returns lat/lng/score); add lat/lng to /near /nearest /corridor so the UI can pin results; bind the vector as a text literal + ::vector cast (lib/pq has no []float32 codec) - mock/app.js: poi_semantic tool + poi_near now returns coords; agent loop drops poi_near/poi_semantic results as map pins (showSpatialPins) - mock/styles.css: .sp-dot / .sp-card pin + popup styles - README: document the pgvector stack + embedpoi
16 lines
800 B
Docker
16 lines
800 B
Docker
# PostGIS + pgvector.
|
|
#
|
|
# postgis/postgis images for PG16 are bullseye-based and their Debian release
|
|
# files have expired (EOL), so a plain apt update fails. Two fixes baked in:
|
|
# - Acquire::Check-Valid-Until=false (the repos are still served)
|
|
# - the pgdg signing key (trusted.gpg.d accepts ASCII-armored keys)
|
|
# then postgresql-16-pgvector from pgdg gives us the `vector` extension.
|
|
FROM postgis/postgis:16-3.4
|
|
COPY pgdg.asc /etc/apt/trusted.gpg.d/pgdg.asc
|
|
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main' \
|
|
> /etc/apt/sources.list.d/pgdg.list \
|
|
&& echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/99noexpire \
|
|
&& apt-get update -qq \
|
|
&& apt-get install -y -qq --no-install-recommends postgresql-16-pgvector \
|
|
&& rm -rf /var/lib/apt/lists/*
|