
pgvector-index-manager
A command-line tool for keeping your pgvector indexes in line with a configuration you control. It checks what exists, shows you what needs changing, and can build and replace HNSW indexes when you apply those changes.
About pgvector-index-manager
Having an index is one thing. Knowing it still has the right settings, covers the right data and finished building properly takes a little more attention. That gets more interesting when you have several indexes for different parts of the same table.
pgvector-index-manager compares the database with your configuration. It checks the vector dimensions, distance metric, HNSW settings, filters and index health, then works out what needs to happen.
The workflow starts with inspection. You can check the current state, review a plan or do a dry run before applying anything. The inspection commands can use read-only credentials; applying changes needs permission to manage indexes.
When a replacement is needed, it builds the new index concurrently alongside the existing one and verifies its structure before giving it the expected name. The previous managed index is then retired. You can set a grace period before that cleanup, and the remaining wait survives a restart.
It also keeps track of which indexes belong to which configuration. That matters when different configurations manage different subsets of the same table. A job looking after one group of documents should stay within its own set of indexes. Conflicting indexes outside its ownership are protected by default.
You can run it once when you need a change, or explicitly enable continuous mode to keep checking and correcting differences from the configuration.
It’s written in Go, with a Docker demo for trying the workflow on synthetic data. It also sits quite naturally alongside pgvector-filterbench: Filterbench helps you measure how your searches behave, while Index Manager handles the indexes you choose to maintain.
Release history
Version 0.1.1
Fixed
- Persist retirement grace deadlines in structured index metadata so a restart cannot bypass the remaining grace period.
- Refuse to replace a same-name index owned by another managed family or ownership tag, even when
drop_unownedis enabled. - Verify the catalog structure of managed indexes, including the key layout, vector source/cast, stored type and dimensions, operator class, HNSW parameters, referenced columns, and an attested fingerprint of the complete expression and predicate.
- Detect schema namespace conflicts before building a replacement when the desired index name is already occupied by another index, table, view, materialized view, sequence, or foreign table.
- Apply configured statement and lock timeouts when recovering retirement state from an earlier release.
Changed
- Ownership metadata version 2 records the verified structural fingerprint and, for retiring indexes, an absolute UTC retirement deadline.
- Indexes carrying
0.1.0ownership metadata are rebuilt once so they acquire the stronger structural attestation. - Raise the build requirement from Go 1.21 to patched Go 1.25.12 and update pgx to the release that fixes GO-2026-5004.
Tests
- Add PostgreSQL/pgvector integration coverage for durable grace recovery, cross-family ownership conflicts, copied-comment structural drift, and namespace-conflict preflight.
- Add GitHub Actions checks for unit tests, the race detector, vet, builds, Staticcheck, Govulncheck, and PostgreSQL/pgvector 16, 17, and 18 integration tests.
External download
Version 0.1.0
- Initial release of pgvector-index-manager.
- Go CLI with
status,plan,apply, andversioncommands. - Catalog inspection for pgvector HNSW indexes on target tables.
- Drift detection comparing current indexes against desired configuration.
- Concurrent index builds with unique temporary names.
- Ownership tracking via index definition comments.
- Advisory lock serialization across multiple manager instances.
- Verification of index health (valid, ready, live) before retirement.
- Protection against dropping unowned indexes by default.
- Configurable HNSW parameters (m, ef_construction).
- Support for vector and halfvec types with cosine, l2, and ip metrics.
- Configurable build timeouts and grace periods.
- One-shot and continuous reconciliation modes.
- Privacy-safe JSON reports with redacted connection strings and 0600 file permissions.
- Strict YAML configuration validation with helpful error messages.
- Docker Compose demo with PostgreSQL and pgvector.
- Synthetic dataset with 10,000 documents at multiple filter selectivity levels.
- Focused tests for configuration, catalog inspection, drift detection, advisory locks, and reporting.
- Go 1.21-compatible module graph and Docker build.
- Apache-2.0 license.
External download

















