agentleFS
salmandevsalmandev/everything-gemini/skills/alloydb-omni-vector/SKILL.md

alloydb-omni-vector

Skill2 starsChanged 29 days agoApache-2.0View on GitHub

Configures AlloyDB Omni with pgvector and the Columnar Engine for ultra-fast HNSW vector similarity search and analytical queries. Use when self-hosting high-performance PostgreSQL vector databases on-premises, in Docker, or across multi-cloud environments.

  • Pipes a download into a shell

The file

Files
SKILL.md

AlloyDB Omni with pgvector & Columnar Acceleration (alloydb-omni-vector)

This skill provides configuration guidelines, schema blueprints, and HNSW index tuning for running Google Cloud AlloyDB Omni with pgvector and the vectorized columnar engine for scalable, high-throughput vector search.


⚡ Architecture: Columnar Engine + pgvector

graph TD
    Client[Agent / Client Application] --> QueryEngine[AlloyDB Omni Query Engine]
    QueryEngine --> ColumnarStore[In-Memory Columnar Engine: Fast Filter & Aggregation]
    QueryEngine --> HNSWIndex[pgvector HNSW Graph Index: Sub-5ms Vector KNN]
    HNSWIndex --> StorageEngine[AlloyDB Optimized Storage Subsystem]

🛠️ Docker Deployment with Omni CLI

# 1. Install AlloyDB Omni CLI
curl -fsSL https://alloydb-omni.cloud.google.com/install.sh | bash

# 2. Launch AlloyDB Omni container with pgvector and 8GB RAM
alloydb-omni-cli launch prod-omni \
  --memory 8GB \
  --cpu 4 \
  --storage-dir /var/lib/alloydb-data \
  --port 5432

💾 Database Configuration & HNSW Schema

-- 1. Enable required extensions
CREATE EXTENSION IF NOT EXISTS vector;
CREATE EXTENSION IF NOT EXISTS google_columnar_engine;

-- 2. Configure columnar engine allocations
ALTER SYSTEM SET google_columnar_engine.enabled = 'on';
ALTER SYSTEM SET google_columnar_engine.memory_size_in_mb = 4096;
SELECT pg_reload_conf();

-- 3. Create Vector Table
CREATE TABLE KnowledgeEmbeddings (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  chunk_text TEXT NOT NULL,
  metadata JSONB,
  embedding vector(768) NOT NULL
);

-- 4. Create HNSW Vector Index with high-recall parameters
CREATE INDEX ON KnowledgeEmbeddings 
USING hnsw (embedding vector_cosine_ops)
WITH (m = 24, ef_construction = 128);

🔍 Hybrid Vector Query with Columnar Filtering

SELECT 
  id, 
  chunk_text, 
  metadata->>'source' AS doc_source,
  1 - (embedding <=> '[0.012, -0.045, ...]'::vector) AS similarity
FROM KnowledgeEmbeddings
WHERE metadata->>'category' = 'security_runbook'
ORDER BY embedding <=> '[0.012, -0.045, ...]'::vector
LIMIT 10;

🛡️ Production Tuning Invariants

  1. ef_search Tuning: Dynamically set SET hnsw.ef_search = 64; during read queries for optimal speed vs. recall Pareto efficiency.
  2. Columnar Engine Synergy: Pre-filter categorical metadata using AlloyDB Columnar Engine before computing vector cosine distances.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.