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
vectorandvectorscaleextensions insql/init.sql, indexingops_noteswithStreamingDiskANN(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 (1536dimensions) 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_URLcredentials in all logs, and validates behavior with 16 pytest tests and Ruff CI.
Built With
- github-actions
- pgvector
- postgresql
- psycopg
- pytest
- python
- timescaledb