vector column.
pgvector uses your existing PostgreSQL infrastructure — no separate vector database server required. Standard SQL can be used to combine vector similarity search with traditional filters.
Configuration
Supported File Types
For structured data (CSV, JSON, XML), use the standard PostgreSQL database destination instead.
Vault Secrets
PostgreSQL connection (for pgvector)
This is separate from the pipeline’s standard
oss/postgres secret so the vector store can target a different database or server.
Embedding API
The embedding secret is server-level (ai.embedding.secretName, default oss/embedding) and is seeded automatically by docker/vault-init.sh. See AI Configuration and the Qdrant docs for the full picture.
bge-m3 and vault-init.sh seeds the embedding secret to point at it — no OpenAI key required.
Chunking Strategies
Documents are split into chunks before embedding. Each chunk becomes a row in the PostgreSQL table with the document’s metadata columns pluschunk_index, filename, and source_pipeline.
chunkSize(default 500): maximum characters per chunkchunkOverlap(default 50): characters of overlap between consecutive chunks
Metadata
Static metadata is stored as dedicated columns in the PostgreSQL table:id— deterministic UUID (idempotent upserts)text— the chunk textchunk_index— position of the chunk in the documentfilename— original uploaded filenamesource_pipeline— pipeline nameembedding— vector column for similarity search
How It Works
- Upload — an unstructured file is uploaded via
POST /api/v1/pipeline/upload - Extract — text is extracted from the document
- Chunk — text is split into chunks using the configured strategy
- Embed — each chunk is sent to the embedding API to generate a vector
- Upsert — chunks are upserted into PostgreSQL with
INSERT ... ON CONFLICT DO UPDATE - Notify — a pipeline notification is published on completion
Running PostgreSQL with pgvector
The bundled Compose PostgreSQL already runs thepgvector/pgvector:pg16 image, and docker/vault-init.sh seeds oss/pgvector to point at it, so no extra server is needed. To run a separate instance instead, note that the standard PostgreSQL Docker image does not include pgvector; use the pgvector image:
Searching from Datris
The Assistant (and any MCP client) can search this store semantically without leaving Datris: the server embeds the query with the configured embedding provider and returns the closest chunks with scores.
The REST endpoint is
POST /api/v1/search/pgvector (Search API); a key needs the search:vector capability (included in the read-only, reporting and rag-builder templates). The CLI equivalent is datris search "question" --store pgvector --collection financial_documents --top-k 5. The MCP tool and REST body also take an optional schema (default public).
Verifying
Advantages Over Dedicated Vector Databases
- No separate server — uses your existing PostgreSQL infrastructure
- Standard SQL — combine vector search with traditional WHERE clauses, JOINs, aggregations
- ACID transactions — full transactional guarantees on vector data
- Familiar tooling — use psql, pgAdmin, any PostgreSQL client
- No new dependencies — uses the existing PostgreSQL JDBC driver
