
Grepai Storage Postgres
Point GrepAI semantic code search at a shared PostgreSQL + pgvector index for team repos and large trees.
Overview
grepai-storage-postgres is an agent skill most often used in Build (also Operate infra) that configures PostgreSQL with pgvector as the GrepAI storage backend for shared, scalable semantic code search.
Install
npx skills add https://github.com/yoanbernabeu/grepai-skills --skill grepai-storage-postgresWhat is this skill?
- PostgreSQL 14+ with pgvector as GrepAI storage backend
- Docker one-liner for local pgvector/pg16 dev database
- Team-shared index with concurrent search for 10K+ file codebases
- Documents apt install and compile-from-source pgvector paths
- Compares benefits: persistence, scalability, and familiar SQL tooling
- PostgreSQL 14+ required
- Large codebases: 10K+ files called out as a target use case
Adoption & trust: 1 installs on skills.sh; 17 GitHub stars; 2/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
What problem does it solve?
Your GrepAI index is local-only and breaks down for large repos or when teammates need the same embeddings and concurrent queries.
Who is it for?
Indie teams on monorepos or 10K+ file trees who already run or can spin up Postgres and want one shared semantic index.
Skip if: Solo experiments on tiny repos with no database handy, or production deploy phases where you have not chosen GrepAI at all.
When should I use this skill?
Team environments with shared index, large codebases (10K+ files), need concurrent access, or integration with existing PostgreSQL infrastructure.
What do I get? / Deliverables
GrepAI runs against a persistent pgvector-backed PostgreSQL database your team can share, with documented Docker and extension setup steps.
- Runnable Docker or host Postgres + pgvector configuration
- GrepAI storage connection settings aligned with pgvector backend
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Primary shelf is Build integrations because you wire GrepAI to a storage backend while adopting the tool in your dev stack. Integrations captures database-backed configuration (connection strings, pgvector schema expectations) rather than application feature code.
Where it fits
Wire GrepAI to a team Postgres instance so every developer queries the same embedding index.
Give your coding agent durable retrieval over a 15k-file monorepo without rebuilding local indexes daily.
Move GrepAI storage to managed Postgres so embeddings survive laptop swaps and CI runner resets.
How it compares
Backend configuration skill for GrepAI—not a generic "install Postgres for my app" tutorial unrelated to vector search.
Common Questions / FAQ
Who is grepai-storage-postgres for?
Solo builders and small teams using GrepAI who need PostgreSQL + pgvector for shared indexes, large codebases, or integration with existing database infrastructure.
When should I use grepai-storage-postgres?
During Build when wiring GrepAI into your stack, when onboarding teammates to one index, or during Operate infra work when you migrate off ephemeral local storage to persistent Postgres.
Is grepai-storage-postgres safe to install?
Check this page's Security Audits panel; configuring databases involves credentials and network exposure—use least-privilege DB users and avoid committing passwords to repos.
SKILL.md
READMESKILL.md - Grepai Storage Postgres
# GrepAI Storage with PostgreSQL This skill covers using PostgreSQL with the pgvector extension as the storage backend for GrepAI. ## When to Use This Skill - Team environments with shared index - Large codebases (10K+ files) - Need concurrent access - Integration with existing PostgreSQL infrastructure ## Prerequisites 1. PostgreSQL 14+ with pgvector extension 2. Database user with create table permissions 3. Network access to PostgreSQL server ## Advantages | Benefit | Description | |---------|-------------| | 👥 **Team sharing** | Multiple users can access same index | | 📏 **Scalable** | Handles large codebases | | 🔄 **Concurrent** | Multiple simultaneous searches | | 💾 **Persistent** | Data survives machine restarts | | 🔧 **Familiar** | Standard database tooling | ## Setting Up PostgreSQL with pgvector ### Option 1: Docker (Recommended for Development) ```bash # Run PostgreSQL with pgvector docker run -d \ --name grepai-postgres \ -e POSTGRES_USER=grepai \ -e POSTGRES_PASSWORD=grepai \ -e POSTGRES_DB=grepai \ -p 5432:5432 \ pgvector/pgvector:pg16 ``` ### Option 2: Install on Existing PostgreSQL ```bash # Install pgvector extension (Ubuntu/Debian) sudo apt install postgresql-16-pgvector # Or compile from source git clone https://github.com/pgvector/pgvector.git cd pgvector make sudo make install ``` Then enable the extension: ```sql -- Connect to your database CREATE EXTENSION IF NOT EXISTS vector; ``` ### Option 3: Managed Services - **Supabase:** pgvector included by default - **Neon:** pgvector available - **AWS RDS:** Install pgvector extension - **Azure Database:** pgvector available ## Configuration ### Basic Configuration ```yaml # .grepai/config.yaml store: backend: postgres postgres: dsn: postgres://user:password@localhost:5432/grepai ``` ### With Environment Variable ```yaml store: backend: postgres postgres: dsn: ${DATABASE_URL} ``` Set the environment variable: ```bash export DATABASE_URL="postgres://user:password@localhost:5432/grepai" ``` ### Full DSN Options ```yaml store: backend: postgres postgres: dsn: postgres://user:password@host:5432/database?sslmode=require ``` DSN components: - `user`: Database username - `password`: Database password - `host`: Server hostname or IP - `5432`: Port (default: 5432) - `database`: Database name - `sslmode`: SSL mode (disable, require, verify-full) ## SSL Modes | Mode | Description | Use Case | |------|-------------|----------| | `disable` | No SSL | Local development | | `require` | SSL required | Production | | `verify-full` | SSL + verify certificate | High security | ```yaml # Production with SSL store: backend: postgres postgres: dsn: postgres://user:pass@prod.db.com:5432/grepai?sslmode=require ``` ## Database Schema GrepAI automatically creates these tables: ```sql -- Vector embeddings table CREATE TABLE IF NOT EXISTS embeddings ( id SERIAL PRIMARY KEY, file_path TEXT NOT NULL, chunk_index INTEGER NOT NULL, content TEXT NOT NULL, start_line INTEGER, end_line INTEGER, embedding vector(768), -- Dimension matches your model created_at TIMESTAMP DEFAULT NOW(), UNIQUE(file_path, chunk_index) ); -- Index for vector similarity search CREATE INDEX ON embeddings USING ivfflat (embedding vector_cosine_ops); ``` ## Verifying Setup ### Check pgvector Extension ```sql -- Connect to database psql -U grepai -d grepai -- Check extension is installed SELECT * FROM pg_extension WHERE extname = 'vector'; -- Check GrepAI tables exist (after first grepai watch) \dt ``` ### Test Connection from GrepAI ```bash # Check status grepai status # Should show PostgreSQL backend info ``` ## Performance Tuning ### PostgreSQL Configuration For better vector search performance: ```sql -- Increase work memory for vector