Agent skill · Audited from source
Pgvector Semantic Search
skill · timescale/pg-aiguideApache-2.0 licenceAudited 8 Oct 2026 · source 169951706048
Is it safe? Yes — SAFE, grade B (89/100). We read this skill's source at commit 169951706048 and found no filesystem, network or shell access and no hard-coded secrets. What it does: Use this skill for setting up vector similarity search with pgvector for AI/ML embeddings, RAG applications, or semantic search.
Cite
Cite this page
ModelsAtlas. “Pgvector Semantic Search (timescale/pg-aiguide)”. Retrieved 8 Oct 2026. https://modelsatlas.com/skills/timescale/pgvector-semantic-search
Trust audit
Audit 0.4.1 · source read 8 Oct 2026
SAFE means nothing in the source contradicts what the skill says it does. Grade B is shared by 17,406 of 18,389 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkNone observedNo outbound calls in the source
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | PASS | 5 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | NA | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 0 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (5)
LOWInventory / provenanceinv.symlink · skills/postgres/references/backfill-strategies.md
skills/postgres/references/backfill-strategies.md
- Why
- link not followed
- Fix
- —
LOWInventory / provenanceinv.symlink · skills/postgres/references/complete-example.md
skills/postgres/references/complete-example.md
- Why
- link not followed
- Fix
- —
LOWInventory / provenanceinv.symlink · skills/postgres/references/design-postgis-tables.md
skills/postgres/references/design-postgis-tables.md
- Why
- link not followed
- Fix
- —
LOWInventory / provenanceinv.symlink · skills/postgres/references/design-postgres-tables.md
skills/postgres/references/design-postgres-tables.md
- Why
- link not followed
- Fix
- —
LOWInventory / provenanceinv.symlink · skills/postgres/references/find-hypertable-candidates.md
skills/postgres/references/find-hypertable-candidates.md
- Why
- link not followed
- Fix
- —
Audit 0.4.1 · source sha 169951706048 · 8 Oct 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- Publishertimescale GitHub organizationOwner of the repository this skill is read from
- Source foldertimescale/pg-aiguide/skills/pgvector-semantic-searchThe exact folder we audited
- LicenceApache-2.0As the repository states it
- Commit pinned for this verdict169951706048A new audit runs when the source changes
- Repository statusNot archivedPushed today
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: Use this skill for setting up vector similarity search with pgvector for AI/ML embeddings, RAG applications, or semantic search.
--- name: pgvector-semantic-search description: | Use this skill for setting up vector similarity search with pgvector for AI/ML embeddings, RAG applications, or semantic search. **Trigger when user asks to:** - Store or search vector embeddings in PostgreSQL - Set up semantic search, similarity search, or nearest neighbor search - Create HNSW or IVFFlat indexes for vectors - Implement RAG (Retrieval Augmented Generation) with PostgreSQL - Optimize pgvector performance, recall, or memory usage - Use binary quantization for large vector datasets **Keywords:** pgvector, embeddings, semantic search, vector similarity, HNSW, IVFFlat, halfvec, cosine distance, nearest neighbor, RAG, LLM, AI search Covers: halfvec storage, HNSW index configuration (m, ef_construction, ef_search), quantization strategies, filtered search, bulk loading, and performance tuning. license: Apache-2.0 compatibility: Requires PostgreSQL 15+ with the pgvector extension metadata: author: tigerdata --- # pgvector for Semantic Search Semantic search finds content by meaning rather than exact keywords. An embedding model converts text into high-dimensional vectors, where similar meanings map to nearby points. pgvector stores these vectors in PostgreSQL and uses approximate nearest neighbor (ANN) indexes to find the closest matches quickly—scaling to millions of rows without leaving the database. Store your text alongside its embedding, then query by converting your search text to a vector and returning the rows with the smallest distance. This guide covers pgvector setup and tuning—not embedding model selection or text chunking, which significantly affect search quality. Requires pgvector 0.8.0+ for all features (`halfvec`, `binary_quantize`, iterative scan). ## Golden Path (Default Setup) Use this configuration unless you have a specific reason not to. - Embedding column data type: `halfvec(N)` where `N` is your embedding dimension (must match everywhere). Examples use 1536; replace with your dimension `N`. - Distance: cosine (`<=>`) - Index: HNSW (`m = 16`, `ef_construction = 64`). Use `halfvec_cosine_ops` and query with `<=>`. - Query-time recall: `SET hnsw.ef_search = 100` (good starting point from published benchmarks, increase for higher recall at higher latency) - Query pattern: `ORDER BY embedding <=> $1::halfvec(N) LIMIT k` This setup provides a strong speed–recall tradeoff for most text-embedding workloads. ## Core Rules - **Enable the extension** in each database: `CREATE EXTENSION IF NOT EXISTS vector;` - **Use HNSW indexes by default**—superior speed-recall tradeoff, can be created on empty tables, no training step required. Only consider IVFFlat for write-heavy or memory-bound workloads. - **Use `halfvec` by default**—store and index as `halfvec` for 50% smaller storage and indexes with minimal recall loss. - **Index after bulk loading** initial data for best build performance. - **Create indexes concurrently** in production: `CREATE INDEX CONCURRENTLY ...` - **Use cosine distance by default** (`<=>`): For non-normalized embeddings, use cosine. For unit-normalized embeddings, cosine and inner product yield identical rankings; default to cosine. - **Match query operator to index ops**: Index with `halfvec_cosine_ops` requires `<=>` in queries; `halfvec_l2_ops` requires `<->`; mismatched operators won't use the index. - **Always cast query vectors explicitly** (`$1::halfvec(N)`) to avoid implicit-cast failures in prepared statements. - **Always use the same embedding model for data and queries**. Similarity search only works when the model generating the vectors is the same. ## Type Rules - Store embeddings as `halfvec(N)` - Cast query vectors to `halfvec(N)` - Store binary quantized vectors as `bit(N)` in a generated column - Do not mix `vector` / `halfvec` / `bit` without explicit casts - Never call `binary_quantize()` on table columns inside `ORDER BY`; store it instead - Dimensions must match: a `halfvec(1536)` column requires query vectors cast as `::halfvec(1536)`. ## Standard Pattern ```sql -- Store and index as halfvec CREATE TABLE items ( id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, contents TEXT NOT NULL, embedding halfvec(1536) NOT NULL -- NOT NULL requires embeddings generated before insert, not async ); CREATE INDEX ON items USING hnsw (embedding halfvec_cosine_ops); -- Query: returns 10 closest items. $1 is the embedding of your search text. SELECT id, contents FROM items ORDER BY embedding <=> $1::halfvec(1536) LIMIT 10; ``` For other distance operators (L2, inner product, etc.), see the [pgvector README](https://github.com/pgvector/pgvector). ## HNSW Index The recommended index type. Creates a multilayer navigable graph with superior speed-recall tradeoff. Can be created on empty tables (no training step required). ```sql CREATE INDEX ON items USING hnsw (embedding halfvec_cosine_ops); -- With tuning parameters CREATE INDEX ON items USING hnsw (embedding halfvec_cosine_ops) WITH (m = 16, ef_construction = 64); ``` ### HNSW Parameters | Parameter | Default | Description | |-----------|---------|-------------| | `m` | 16 | Max connections per layer. Higher = better recall, more memory | | `ef_construction` | 64 | Build-time candidate list. Higher = better graph quality, slower build | | `hnsw.ef_search` | 40 | Query-time candidate list. Higher = better recall, slower queries. Should be ≥ LIMIT. | **ef_search tuning (rough guidelines—actual results vary by dataset):** | ef_search | Approx Recall | Relative Speed | |-----------|---------------|----------------| | 40 | lower (~95% on some benchmarks) | 1x (baseline) | | 100 | higher | ~2x slower | | 200 | very-high | ~4x slower | | 400 | near-exact | ~8x slower | ```sql -- Set search parameter for session SET hnsw.ef_search = 100; -- Set for single query BEGIN; SET LOCAL hnsw.ef_search = 100; SELECT id, contents FROM items ORDER BY embedding <=> $1::halfvec(1536) LIMIT 10; COMMIT; ``` #
Excerpt, first 6,000 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit 1699517
git clone https://github.com/timescale/pg-aiguide git -C pg-aiguide checkout 169951706048
The author documents no install command, so this uses the repository directly. Our verdict covers commit 169951706048 only.
Works in
The author has not said which agents this skill supports, and we have not tested it in any.
Audit history
Every audit, every source change
- ✓SAFE B 89 / 100
first audit · source
169951706048
README badge
For maintainers · shows the latest audit
[](https://modelsatlas.com/skills/timescale/pgvector-semantic-search/)
The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.
Similar skills
All coding & review skills →timescale/pg-aiguide
Use this skill when creating database schemas or tables for Timescale, TimescaleDB, TigerData, or Tiger Cloud, especially for time-series, IoT, metrics, events, or log data. Use this to improve the performance of any…
timescale/pg-aiguide
Use this skill to migrate identified PostgreSQL tables to Timescale/TimescaleDB hypertables with optimal configuration and validation.
timescale/pg-aiguide
Use this skill to analyze an existing PostgreSQL database and identify which tables should be converted to Timescale/TimescaleDB hypertables.
timescale/pg-aiguide
Use this skill for general PostgreSQL table design.
timescale/pg-aiguide
Use this skill to implement hybrid search combining BM25 keyword search with semantic vector search using Reciprocal Rank Fusion (RRF).
timescale/pg-aiguide
Comprehensive PostGIS spatial table design reference covering geometry types, coordinate systems, spatial indexing, and performance patterns for location-based applications
Add this badge to your README
[](https://modelsatlas.com/skills/timescale/pgvector-semantic-search/)
<a href="https://modelsatlas.com/skills/timescale/pgvector-semantic-search/"><img src="https://modelsatlas.com/skills/timescale/pgvector-semantic-search/badge.svg" alt="ModelsAtlas: SAFE B"></a>
Questions about Pgvector Semantic Search
What does the Pgvector Semantic Search skill do?
Is Pgvector Semantic Search safe to install?
What can Pgvector Semantic Search access on my machine?
What do I need installed to use Pgvector Semantic Search?
How current is this page?
Sources
- github.com/timescale/pg-aiguide/tree/main/skills/pgvector-semant — the audited source at commit 169951706048 and every finding aboveObserved · 8 Oct 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the Pgvector Semantic Search skill do?
- Is Pgvector Semantic Search safe to install?
- What can Pgvector Semantic Search access on my machine?