Skip to content

impl/psql-vector-store#244

Merged
mbakgun merged 32 commits into
mainfrom
impl/psql-vector-store
Jun 22, 2026
Merged

impl/psql-vector-store#244
mbakgun merged 32 commits into
mainfrom
impl/psql-vector-store

Conversation

@mbakgun

@mbakgun mbakgun commented Jun 22, 2026

Copy link
Copy Markdown
Contributor
  • Implement pgvector backend support and enhance UI integration

mbakgun added 30 commits June 22, 2026 12:44
Skip vector_store_items creation (with a warning) if the 'vector' extension
is not available on the target Postgres, so an external/managed DB without
pgvector cannot abort 'alembic upgrade head' and block the deploy. Qdrant RAG
is unaffected; the table is created normally wherever pgvector is present.
… image

Swapping an existing postgres:16 data dir onto pgvector/pgvector:pg16 (Debian 12
/ glibc 2.36) triggers a collation-version mismatch vs the official postgres:16
(Debian 13 / glibc 2.41), risking text index corruption. Build pgvector on top of
the same postgres:16 base instead, so the data dir's glibc/collation is unchanged
and existing databases open with the same credentials and no warning.
The request schema has its own CredentialType enum, separate from the DB model
enum. pgvector was only added to the model, so POST /api/credentials with
type=pgvector failed Pydantic validation with 422. Add it to the schema enum and
guard with a test asserting both enums stay in sync.
The panel only loaded qdrant credentials, so a pgvector vector store could not be
created. Add a Database (Qdrant / Postgres) selector that filters credentials by
backend, load both credential types, and replace Qdrant-only copy.
…l errors

Per the requirement to never change existing users' Postgres image or data:
- Revert run.sh, docker-compose.yml, run_e2e.sh, CI to the official postgres:16
  image (no custom image, no glibc/collation change to existing data dirs).
- Auto-install the postgresql-16-pgvector package at startup (run.sh/run_e2e.sh
  via docker exec; compose via an entrypoint wrapper) so the Postgres RAG backend
  works out of the box. Non-fatal: if it cannot install, Qdrant RAG keeps working
  and the migration skips the pgvector table.
- PgVectorStoreService now degrades gracefully when the table is missing: reads
  return empty, writes/search raise VectorStoreBackendUnavailableError, and the
  API returns a clear 400 message (for the ghcr image pointed at a BYO database
  without pgvector) instead of a raw 500.
- Remove docker/postgres.Dockerfile; update docs.
Truncate the store name and keep the badge + action buttons from shrinking so the
backend badge does not push the action icons (and their tooltips) past the card edge.
The name box now grows (flex-1) so short names render fully; it only ellipsizes
when genuinely longer than the available space, instead of collapsing.
- delete_points compared the UUID id column against text point ids, causing
  'operator does not exist: uuid = text'. Cast with id::text = ANY(:ids).
- DSL prompt: document the RAG node works with Qdrant or Postgres (pgvector)
  vector stores and the optional dbType field.
mbakgun added 2 commits June 22, 2026 16:04
Modern Qdrant deprecates vectors_count (returns None), so the card showed 0/N/A.
Fall back to points_count in both the Qdrant stats service and formatVectorCount.
CollectionInfo.vectors_count is deprecated/removed in modern qdrant-client, so
accessing it raised and the card fell back to N/A even when the collection was
reachable. Use client.count() (reliable, same path that scroll/list uses) for the
total and wrap get_collection for cosmetic fields. Also log previously-swallowed
stats errors so failures are diagnosable.
@mbakgun mbakgun enabled auto-merge June 22, 2026 14:21
@mbakgun mbakgun merged commit 253b8ff into main Jun 22, 2026
2 checks passed
@mbakgun mbakgun deleted the impl/psql-vector-store branch June 22, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant