Skip to content

Commit 1a6a066

Browse files
docs(docker): use pgvector image for Postgres compose
Plain postgres:17 cannot load the vector extension required for semantic search (#830). Switch to pgvector/pgvector:pg17 and document the requirement. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: rudi193-cmd <rudi193@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 60ec672 commit 1a6a066

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

docker-compose-postgres.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
# Docker Compose configuration for Basic Memory with PostgreSQL
2-
# Use this for local development and testing with Postgres backend
2+
# Use this for local development and testing with Postgres backend.
3+
#
4+
# The Postgres backend requires the pgvector extension (semantic search).
5+
# This image bundles pgvector; plain postgres:17 will not work for vector search.
36
#
47
# Usage:
58
# docker-compose -f docker-compose-postgres.yml up -d
69
# docker-compose -f docker-compose-postgres.yml down
710

811
services:
912
postgres:
10-
image: postgres:17
13+
image: pgvector/pgvector:pg17
1114
container_name: basic-memory-postgres
1215
environment:
1316
# Local development/test credentials - NOT for production

docs/semantic-search.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ The sqlite-vec extension is loaded per-connection. Vector tables are created laz
263263
### Postgres (cloud)
264264

265265
- **Vector storage**: [pgvector](https://github.com/pgvector/pgvector) with HNSW indexing
266+
- **Local Docker**: use `docker-compose-postgres.yml` (`pgvector/pgvector:pg17`). Plain `postgres:17` lacks the extension; run `CREATE EXTENSION IF NOT EXISTS vector;` on any external instance before first migration.
266267
- **Chunk metadata table**: Created via Alembic migration (`search_vector_chunks` with `BIGSERIAL` primary key)
267268
- **Embedding table**: `search_vector_embeddings` created at runtime (dimension-dependent, same pattern as SQLite)
268269
- **Index**: HNSW index on the embedding column for fast approximate nearest-neighbour queries

tests/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ docker-compose -f docker-compose-postgres.yml up -d
6666
```
6767

6868
This starts:
69-
- Postgres 17 on port **5433** (not 5432 to avoid conflicts)
69+
- Postgres 17 with **pgvector** (`pgvector/pgvector:pg17`) on port **5433** (not 5432 to avoid conflicts)
7070
- Test database: `basic_memory_test`
7171
- Credentials: `basic_memory_user` / `dev_password`
7272

@@ -121,7 +121,7 @@ jobs:
121121
# Postgres service container
122122
services:
123123
postgres:
124-
image: postgres:17
124+
image: pgvector/pgvector:pg17
125125
env:
126126
POSTGRES_DB: basic_memory_test
127127
POSTGRES_USER: basic_memory_user

0 commit comments

Comments
 (0)