Przejdź do treści
Biblioteka skilli
Dane i analityka · Budowanie i kod

pgvector

/pgvector

Obsługuje rozszerzenie pgvector dla PostgreSQL: typy wektorowe, operatory odległości, indeksy HNSW i IVFFlat, wyszukiwanie najbliższych sąsiadów oraz biblioteki klienckie.

Repozytorium
llm-code ↗
Licencja
MIT
Ostatnia zmiana repozytorium
24.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
12
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
7
Przestarzałość

Brak sygnałów. Repozytorium zmienione 24.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Obsługuje rozszerzenie pgvector dla PostgreSQL: typy wektorowe, operatory odległości, indeksy HNSW i IVFFlat, wyszukiwanie najbliższych sąsiadów oraz biblioteki klienckie.

Oryginalny opis (EN)

pgvector Postgres extension. Covers vector types, distance operators, indexing (HNSW/IVFFlat), and client library usage. Use when storing vectors in PostgreSQL, running nearest-neighbor searches, or configuring HNSW/IVFFlat indexes. Keywords: pgvector, PostgreSQL, vector search, HNSW, IVFFlat.

Jak działa

  1. Quick Navigation
  2. When to Use
  3. Quick Start (already installed)
  4. Critical Prohibitions / Gotchas
  5. Release Notes
  6. Links
Sekcje z nagłówków SKILL.md, w oryginale · 79 linii, 402 słów
Podgląd SKILL.md
---
name: pgvector
description: "pgvector Postgres extension. Covers vector types, distance operators, indexing (HNSW/IVFFlat), and client library usage. Use when storing vectors in PostgreSQL, running nearest-neighbor searches, or configuring HNSW/IVFFlat indexes. Keywords: pgvector, PostgreSQL, vector search, HNSW, IVFFlat."
metadata:
  version: "0.8.7"
  release_date: "2026-10-01"
---

# pgvector

PostgreSQL extension for storing vectors and running exact/approximate nearest-neighbor search in SQL.

## Quick Navigation

- Installation: `references/installation.md`
- Core concepts and SQL recipes: `references/core.md`
- Indexing (HNSW / IVFFlat) and tuning: `references/indexing.md`
- Filtering, iterative scans, and performance: `references/performance-and-filtering.md`
- Types and functions reference (vector/halfvec/bit/sparsevec): `references/types-and-functions.md`
- Troubleshooting: `references/troubleshooting.md`
- Client libraries (priority):
  - Python: `references/python.md`
  - Go: `references/go.md`
  - Node (JS/TS): `references/node.md`
  - Java: `references/java.md`
  - Swift: `references/swift.md`

## When to Use

- You need vector similarity search inside Postgres (keep vectors with relational data).
- You want SQL-native ANN indexes (HNSW or IVFFlat) with tunable recall/speed.
- You want consistent patterns to store/query embeddings across multiple application languages.

## Quick Start (already installed)

Prerequisite: pgvector is installed on the Postgres server. See: `references/installation.md`.

Enable per database and run a first query:

```sql
CREATE EXTENSION vector;

CREATE TABLE items (id bigserial PRIMARY KEY, embedding vector(3));
INSERT INTO items (embedding) VALUES ('[1,2,3]'), ('[4,5,6]');

SELECT * FROM items ORDER BY embedding <-> '[3,1,2]' LIMIT 5;
```

### Choosing distance operators

- L2 (Euclidean): use `<->`
- Inner product: use `<#>` (note: returns negative inner product)
- Cosine distance: use `<=>`
- L1: use `<+>`
- Binary vectors: Hamming `<~>` / Jaccard `<%>`

### Indexing rules of thumb

- Exact search: no pgvector index; may use parallel scan on large tables.
- ANN search:
  - Prefer HNSW for better speed/recall, higher build time/memory.
  - Use IVFFlat when you need faster builds/lower memory.
- Create one index per distance function/operator class you plan to use.

## Critical Prohibitions / Gotchas

- Approximate indexes can change results (recall vs speed).
- Index usage typically requires `ORDER BY <distance-op> ... LIMIT ...`.
- `<#>` returns negative inner product; multiply by `-1` to get the actual value.
- `NULL` vectors are not indexed; for cosine distance, zero vectors are not indexed.

## Release Notes

- `0.8.7` (2026-10-01) is a fix release: a race between HNSW `INSERT` and `VACUUM` that could return duplicate neighbors, a buffer overflow in IVFFlat index builds with hardened index entry points, improved `vector_combine`, and a fix for the `avg` aggregate when no rows match. Casts between `vector`, `halfvec`, and `sparsevec` were tightened and safety-checked, and `-ffp-contract=fast` was added to `PG_CFLAGS` to enable multiply-and-add.

## Links

- Docs / repo: https://github.com/pgvector/pgvector
- Client libs:
  - Python: https://github.com/pgvector/pgvector-python
  - Go: https://github.com/pgvector/pgvector-go
  - Node: https://github.com/pgvector/pgvector-node
  - Java: https://github.com/pgvector/pgvector-java
  - Swift: https://github.com/pgvector/pgvector-swift
- Releases/tags: https://github.com/pgvector/pgvector/tags
Pliki w paczce (12)
  • SKILL.md 3 KB
  • references/core.md 2 KB
  • references/go.md 1 KB
  • references/indexing.md 3 KB
  • references/installation.md 2 KB
  • references/java.md 1 KB
  • references/node.md 1 KB
  • references/performance-and-filtering.md 4 KB
  • references/python.md 2 KB
  • references/swift.md 1 KB
  • references/troubleshooting.md 2 KB
  • references/types-and-functions.md 3 KB

Wersje

RepozytoriumWynikLicencja
Ta strona · itechmeat/llm-code100MIT
TerminalSkills/skills100Apache-2.0

Migawka bazy z 13.11.2026 · wersja paczki c046bc50d2fc (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100pgvector-advanced
    Obejmuje pgvector 0.7+ w PostgreSQL: strojenie HNSW i IVFFlat, typy halfvec, bit i sparsevec, kwantyzację binarną, wyszukiwanie hybrydowe z pg_trgm i tsvector oraz wzorce Supabase.
  • 100vector-databases-pgvector-pinecone
    Przechowuje osadzenia wielowymiarowe i wykonuje przybliżone wyszukiwanie najbliższych sąsiadów w pgvector i Pinecone.
  • 100vector-store-stinger
    Projektuje przechowywanie wektorów: schematy pgvector, HNSW i IVFFlat, indeksy hybrydowe, migracje i wybór magazynu.
  • 100vector-database
    Projektuje i strojenie baz wektorowych: schematy pgvector, kolekcje Weaviate, indeksy HNSW, modele embeddingów i RAG.
  • 100laravel-vector-search
    Wdraża wyszukiwanie semantyczne i wektorowe w Laravel 13 z użyciem PostgreSQL i pgvector.
  • 80role-database:vector-databases
    Pomaga wybrać i wdrożyć bazy wektorowe, np. pgvector, Qdrant, Pinecone czy Weaviate, do wyszukiwania semantycznego i RAG.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.