Inspiration

Grid telemetry tables record voltage drops and load spikes, while operator logs record the human cause. Keeping both in separate systems forces engineers to cross-reference timestamps manually during incident triage.

What it does

grid-ops-search stores 1536-dimensional embeddings of substation operational notes alongside VoltStream grid_readings telemetry in one Tiger Data (TimescaleDB/PostgreSQL) database. A single CLI command runs cosine ANN search over operational notes and joins each match to time_bucket('5 minutes', ts) load and voltage rollups around that timestamp.

How I built it

  • Unified PostgreSQL schema: Bootstrapped vector and vectorscale extensions in sql/init.sql, indexing ops_notes with StreamingDiskANN (diskann / vector_cosine_ops) and automatic HNSW fallback.
  • Provider-agnostic embeddings: Supports OpenAI-compatible embedding endpoints (text-embedding-3-small) and a deterministic keyless feature-hashing fallback (1536 dimensions) so the full pgvector query path runs without external API keys.
  • Substation alignment & safety: Automatically aligns corpus slugs against numeric or differently formatted telemetry IDs, masks DATABASE_URL credentials in all logs, and validates behavior with 16 pytest tests and Ruff CI.

Built With

Share this project:

Updates