# pgvector

pgvector is a retrieval option for building AI agents. Vector search inside the Postgres you already run.

## Facts

- Layer: Retrieval (What it knows)
- Vendor: pgvector (github.com/pgvector/pgvector)
- Licence: open source
- Pricing: open source
- Self-hostable: yes
- Docs: https://github.com/pgvector/pgvector
- Last verified: 2026-08-21

## When to reach for it

- You are choosing a retrieval component — what it knows.
- You need to run it on your own infrastructure, or your procurement process requires source access.
- You want to start without a commercial conversation.

## Worth knowing

Correct default under roughly ten million vectors. Reach for a dedicated store when it stops being.

## Alternatives in the retrieval layer

| Option | What it does | Licence | Self-host |
| --- | --- | --- | --- |
| Qdrant | Rust vector database with strong payload filtering, self-host or cloud. | open source | yes |
| Pinecone | Fully managed vector database. No index to operate. | proprietary | no |
| Chroma | Embedded vector store that runs in-process. Ideal first index. | open source | yes |
| turbopuffer | Vector and full-text search on object storage — very cheap at rest. | proprietary | no |
| LanceDB | Embedded multimodal store backed by the Lance columnar format. | open source | yes |

Head to head:

- https://newagent.build/compare/pgvector-vs-qdrant
- https://newagent.build/compare/pgvector-vs-pinecone
- https://newagent.build/compare/pgvector-vs-chroma
- https://newagent.build/compare/pgvector-vs-turbopuffer
- https://newagent.build/compare/pgvector-vs-lancedb

## Curated stacks using it

- Regulated / on-prem: Nothing leaves the estate. Every component runs on infrastructure you control.
- Browser automation: Drives real web apps that have no API, on behalf of a specific signed-in user.

## Add it to a stack

```bash
curl -fsSL "https://newagent.build/api/stack?retrieval=pgvector&format=sh" | sh
```

## Machine interfaces

- `GET https://newagent.build/api/registry` — every component as JSON
- `GET https://newagent.build/api/vendors` — vendors, with the repo and releases feed to watch
- `GET https://newagent.build/api/advise?q=<plain english>` — recommended stack for a description
- `GET https://newagent.build/api/stack?<layer>=<id>&format=sh|json|md|yml|agents|env` — a stack as files
- `GET https://newagent.build/llms.txt` — the whole registry in one fetch

Any page here also returns markdown if you send `Accept: text/markdown`.