pgvector control plane
pgvector is the default BaseVectorStore adapter for the KB layer.
PgVectorStore wraps the extracted
alphaswarm_kb.rag.pgvector_store.PgVectorStore behind the
BaseVectorStore port so the standard KBRuntime can target the
existing pgvector control plane without leaking adapter specifics.
Migration
alembic/versions/0045_pgvector_phase3.py— pgvector indexes on the three allow-listed tables (rag_chunks,codebase_symbol_embeddings,ml_feature_vectors).alembic/versions/0088_alphaswarm_kb_specs.py— the nine KB tables (kb_corpora,kb_runs,kb_subscriptions, ...).
Agent surface
| Tool | Purpose |
|---|---|
data.vector.search | Free-text or pre-computed embedding ANN over the allow-listed tables. |
data.vector.upsert | (Step-up gated) write through PgVectorStore.upsert. |
data.vector.delete | (Step-up gated) targeted delete by id. |
data.embeddings.compute | Compute an embedding via the central embedder. |
Adding a new pgvector-backed table
- Add the migration under
alembic/versions/with aVector(N)column + an HNSW index. - Extend the
_ALLOWED_TABLESwhitelist inalphaswarm/data/mcp/tools/vector.py. - Add an
EntityPicker kindfor the table toalphaswarm/cache/keys.py. - Add a
BaseDatasetkind underalphaswarm/data/datasets/kinds/if the table is also surfaced through the dataset catalog.