Skip to content

Vector Databases & Vector Stores

A vector database stores high-dimensional embedding vectors and supports approximate-nearest-neighbor (ANN) search. Embeddings come from LLM-Providers.md; the math is in AI-Concepts.md.

The portfolio strongly favors pgvector — Postgres + an extension — because it collapses the vector store and the transactional store into one piece of infrastructure. The exceptions are deliberate.

Portfolio map

Vector store Products Reason for the choice
pgvector (Postgres extension) 12 products Default. One DB to operate. ACID + ANN in the same engine.
Qdrant 2 products DOC-AI and AI Concierge: payload filters, on-disk indexes, hybrid search with RRF.
Postgres JSONB as vector 2 products SmartForms and Sell Me A Pen: embeddings in a JSONB column, cosine in app code. No extension.
MySQL JSON as vector 2 products VotigoPro and HouseKey are on MySQL; avoids a second DB.
Pinecone 1 product (optional) AutoDiag AI: optional semantic store beside TF-IDF.
In-memory 0 products Not used in the portfolio; covered for comparison.
Neo4j vector 0 products Neo4j is present (AutoDiag AI, OpenSentinel) but as a graph, not a vector store.
Weaviate / Chroma / Milvus / FAISS 0 products Not used; covered below for comparison.

GoGreen Verify's compose file pulls the pgvector/pgvector image, but no vector column was found in its schema (its RAG is a client-side term-frequency hash), so it is not counted. SuperCabs, BidIt, GameTrakker, Go Green Transit, Maximus Pet Store and Pecos River Traders have no vector store.


pgvector

What it is. A PostgreSQL extension that adds the vector(N) column type, the <-> (L2), <=> (cosine), and <#> (inner-product) distance operators, and IVFFlat / HNSW index types. Search runs as a regular SQL ORDER BY embedding <=> $1 LIMIT 10.

Why we use it. One database for everything. Joins between vector search results and relational metadata happen in the same query — SELECT chunks.* FROM chunks JOIN documents WHERE documents.tenant_id = $1 ORDER BY chunks.embedding <=> $2 LIMIT 10. Backups, transactions, point-in-time recovery, RLS — all the Postgres machinery you already trust.

Used in: - Toolbelt Handyman — vector(1536), cosine <=> (pg15); admin KB RAG indexed at container start. - Workflow Hub — packages/rag (pg17). - Sourcing AI — vector(1536) (pg16); embedding model via RAG_EMBEDDING_MODEL. - Marketing AI — ai-orchestrator RAG (pg16). - GoGreen Seller AI — rag.service.ts (pg16). - OpenSentinel — vector(1536) plus a tsvector GIN column for hybrid search (pg16). - GGPI website — hybrid pgvector + full-text KB, ContactMemory second brain (pg16). - APEX Sales Training — RAG knowledge (pg15). - Recruiting AI — AI Brain RAG (pg15). - PoligoPro — five RAG stores (pg15). - Tutor AI — vector(1536) on DocumentEmbedding and MemoryFragment (pg15, pgvector/pgvector:pg15). - Jarvis (Tauri) — memories.embedding vector(1536), cosine <=> recall (pg16, compose host port 127.0.0.1:5455, plain SQL migrations).

Tradeoffs. - Index choice. IVFFlat is fast to build but needs retraining as data grows. HNSW is the modern default — better recall, larger memory footprint. - Scale ceiling. Single-instance Postgres handles ~5M vectors comfortably; beyond ~50M you start fighting it. Most portfolio apps are <100K vectors — nowhere near the limit. - No native filter-aware ANN. You can WHERE tenant_id = $1 before the ORDER BY, but the index can't always use both — sometimes degenerates to a scan.


Qdrant

What it is. Open-source dedicated vector database written in Rust. HTTP/gRPC API. Strong payload filtering (filters baked into the ANN traversal, not bolted on after), HNSW indexing, on-disk vector storage (don't need to fit corpus in RAM), good multi-tenancy via collections.

Why some apps picked it over pgvector. - Faster filter-aware ANN at scale. - On-disk vectors — important for DOC-AI's 3072-dim text-embedding-3-large (each vector is 12 KB, so 1M vectors = 12 GB). - Decoupled from the transactional DB — the document service can scale separately.

Used in: - AI Concierge — Crawlee or upload → chunk → embed (1536 dims) → Qdrant v1.12.5 via @qdrant/js-client-rest. Hybrid vector + Postgres FTS with RRF; source citations. - DOC-AI — one cosine collection, filtered by org (Qdrant v1.17.1 prod, v1.18.3 dev). Three answer engines (default, LangChain, Graph RAG) share it; semantic results merge with Postgres tsvector via RRF.

Tradeoffs. Second piece of infrastructure to deploy and back up. Worth it when corpus size or filter complexity actually justifies it.


MySQL JSON as vector

What it is. Embeddings stored as a JSON array in a LONGTEXT/JSON column, similarity computed in application code or via SQL math. No real ANN — it's a brute-force scan with cosine similarity.

Why we use it. Some apps are on MySQL (Laravel / PHP, Node) and adding a second store wasn't worth it for the corpus size.

Used in: - VotigoPro — JSON column on ai_knowledge_documents in MySQL; php artisan rag:generate-embeddings. RagRetriever.php with 9 retrieval strategies including HyDE. - HouseKey — 1536-d JSON in MySQL, brute-force cosine in Node. 16 RAG types (53 docs / 69 chunks).

Tradeoffs. O(n) every query. Fine up to ~10K vectors; awful past that. The right move when adding a vector DB would double your operational footprint for marginal benefit.


Postgres JSONB as vector

What it is. Embeddings stored as a JSONB array on an ordinary Postgres table; similarity computed in application code. No extension needed, but also no ANN index.

Why we use it. The app already has Postgres and the corpus is small, so installing pgvector was not worth it.

Used in: - SmartForms — rag_documents (JSONB), cosine in Python, scoped by user_id / source_type, with HyDE (gpt-4o-mini) and re-rank. - Sell Me A Pen — document_embeddings (JSONB), table created by raw SQL at runtime; hydeSearch over nine source types.

Tradeoffs. O(n) per query; fine for small tenant-scoped corpora.


In-memory vectors (not used in portfolio)

Embeddings live in a Python list / JS Array and similarity is computed at query time. Nothing persists across restarts. The nearest thing in the portfolio is GoGreen Seller AI's LRU embedding cache, which caches query embeddings but is not the store.

Used in: Not used in the portfolio — covered for comparison.

Tradeoffs. Cold-start cost, RAM cost, zero infrastructure.


Pinecone (optional)

What it is. Managed cloud vector database. Strong on horizontal scale, weak on running locally.

Used in: - AutoDiag AI — optional pinecone-client (>=3.0) in src/ai/rag/pinecone_store.py, default embedding text-embedding-3-small; falls back to HuggingFace embeddings or TF-IDF hashing. The LangChain RAG pipeline pairs TF-IDF with Pinecone semantic search.

Why it isn't the default. Per-month index pricing, an external service that can't be backed up alongside Postgres, and pgvector being good enough.


  • Neo4j 5 (community) — graph, not vectors: AutoDiag AI (knowledge graph) and OpenSentinel (ecosystem graph).
  • Meilisearch — BidIt catalog search (v1.10 prod / v1.7 dev).
  • Elasticsearch — optional full-text in AutoDiag AI.

Comparison terms (not currently used in the portfolio)

These are included so the wiki can answer "why did we pick X over Y."

Weaviate

What it is. Open-source vector DB written in Go. Built-in vectorizers (the DB itself can call OpenAI/Cohere to embed), GraphQL API, hybrid search out of the box. Schema-first.

Why we don't use it. Built-in vectorizers add lock-in we don't need; we already centralize embedding in app code. GraphQL was friction for teams that wanted plain HTTP/SQL.

Chroma

What it is. Embedded-friendly Python-first vector DB. Easiest "import chromadb; collection.add(...)" experience. Originally LangChain's go-to backing store.

Why we don't use it. When the same app already runs Postgres, pgvector beats it on ops. Chroma shines for notebooks and prototypes; the portfolio is past that stage.

Milvus

What it is. Heavy-duty distributed vector DB, originally from Zilliz. GPU acceleration, billion-scale corpora, multiple index types (IVF, HNSW, ANNOY, DiskANN).

Why we don't use it. Wildly oversized for any portfolio corpus. Operational footprint is enterprise-scale.

FAISS

What it is. Facebook AI Similarity Search. A library (not a server) for ANN — you load it in-process, build an index in RAM/disk, query it. The technology underlying many of the above.

Why we don't use it directly. No persistence layer, no auth, no remoting. Use it inside a service if you've outgrown pgvector but don't want a managed product.

What it is. Redis Stack adds FT.SEARCH and vector indexing. Same Redis instance you cache with can host an HNSW index.

Why we don't use it. Plain redis:7 is what's running across the portfolio (no Redis Stack module). Adding it would be a deliberate upgrade — pgvector has been the path of least resistance.

Elasticsearch / OpenSearch dense_vector

What it is. ES has had a dense_vector field type since 7.x. Native hybrid search (BM25 + vector with RRF) is its strength.

Why we don't use it. Only AutoDiag AI lists Elasticsearch, as an optional full-text store. The closest portfolio analog for hybrid search is OpenSentinel's pgvector + tsvector full-text hybrid (also DOC-AI and AI Concierge, which pair vectors with Postgres FTS via RRF).

What it is. MongoDB's vector index, available on Atlas (managed Mongo). HNSW, payload filters via Mongo's normal query language.

Why we don't use it. No Mongo in the portfolio.

LanceDB

What it is. Embedded columnar vector DB written in Rust. Apache Arrow native. Good for ML notebooks and edge devices.

Why we don't use it. Newer, less mature; JSON-column embeddings have been "good enough" at the small end.

Vespa, Qdrant Cloud, Vald, MyScale

Mentioned for completeness — not evaluated, not used.


How embeddings are produced

See LLM-Providers.md for the OpenAI embedding tier (the portfolio default is text-embedding-3-small, 1536 dimensions; DOC-AI uses text-embedding-3-large, 3072 dim). HuggingFace embeddings are an alternate path in GoGreen Seller AI and AutoDiag AI.

Decision tree

Already running Postgres?
├── Yes → pgvector (default).
│         └── Corpus > ~10M vectors OR heavy filter-aware ANN?
│             └── Yes → Add Qdrant alongside.
└── No
    ├── Tiny tenant-scoped corpus on Postgres, no extension? → Postgres JSONB + app cosine.
    ├── Already on MySQL?            → MySQL JSON column.
    └── Greenfield, want a managed service? → Qdrant (self-host) or Pinecone (managed).