Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docker-compose-postgres.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# Docker Compose configuration for Basic Memory with PostgreSQL
# Use this for local development and testing with Postgres backend
# Use this for local development and testing with Postgres backend.
#
# The Postgres backend requires the pgvector extension (semantic search).
# This image bundles pgvector; plain postgres:17 will not work for vector search.
#
# Usage:
# docker-compose -f docker-compose-postgres.yml up -d
# docker-compose -f docker-compose-postgres.yml down

services:
postgres:
image: postgres:17
image: pgvector/pgvector:pg17
container_name: basic-memory-postgres
environment:
# Local development/test credentials - NOT for production
Expand Down
1 change: 1 addition & 0 deletions docs/semantic-search.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ The sqlite-vec extension is loaded per-connection. Vector tables are created laz
### Postgres (cloud)

- **Vector storage**: [pgvector](https://github.com/pgvector/pgvector) with HNSW indexing
- **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.
- **Chunk metadata table**: Created via Alembic migration (`search_vector_chunks` with `BIGSERIAL` primary key)
- **Embedding table**: `search_vector_embeddings` created at runtime (dimension-dependent, same pattern as SQLite)
- **Index**: HNSW index on the embedding column for fast approximate nearest-neighbour queries
Expand Down
4 changes: 2 additions & 2 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ docker-compose -f docker-compose-postgres.yml up -d
```

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

Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:
# Postgres service container
services:
postgres:
image: postgres:17
image: pgvector/pgvector:pg17
env:
POSTGRES_DB: basic_memory_test
POSTGRES_USER: basic_memory_user
Expand Down