- Home
- Skills
- Yoanbernabeu
- Grepai Skills
- Grepai Storage Postgres
grepai-storage-postgres_skill
1
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill yoanbernabeu/grepai-skills --skill grepai-storage-postgres- SKILL.md6.8 KB
Overview
This skill configures PostgreSQL with the pgvector extension to store GrepAI embeddings and code chunks. It enables a shared, scalable, and persistent vector index suitable for team environments and large codebases. Use it to move from local file-based storage to a production-ready database backend.
How this skill works
The skill prepares PostgreSQL (14+) with pgvector, creates the embeddings table and a vector index (IVFFlat) and updates GrepAI configuration to point at a DSN. GrepAI writes chunked file content and 768‑dim embeddings into the database, and the IVFFlat index accelerates similarity searches. It also includes guidance for Docker, managed services, SSL, tuning, backups, and migration from local indexes.
When to use it
- Team environments where multiple developers share the same index
- Large codebases (10k+ files) that need scalable storage
- When you require concurrent searches and persistent storage
- To integrate GrepAI with existing PostgreSQL infrastructure
- When you need managed service support (Supabase, Neon, RDS)
Best practices
- Run PostgreSQL with pgvector 14+ and enable the vector extension in each database
- Store DSN in environment variables and avoid committing credentials
- Enable SSL (require or verify-full) for remote databases
- Tune IVFFlat lists and PostgreSQL memory settings (work_mem/shared_buffers) for large indexes
- Schedule regular VACUUM ANALYZE and pg_dump backups
Example use cases
- Shared company code search: all engineers point GrepAI to a central DB for unified semantic search
- Monorepo support: index millions of lines across many projects with efficient vector search
- CI integration: use the DB-backed index in automated code analysis and batch pipelines
- Migration from local storage: delete .grepai/index.gob, update DSN, and re-run grepai watch to re-index
FAQ
Use PostgreSQL 14 or newer and install the pgvector extension. Then run CREATE EXTENSION IF NOT EXISTS vector; in your database.
How do I test the connection from GrepAI?
Set DATABASE_URL or the DSN in .grepai/config.yaml, run grepai status, and confirm the backend shows PostgreSQL details. Also verify the embeddings table with \dt in psql.
How can I improve slow searches?
Create or tune the IVFFlat index (lists ~ sqrt(rows)), increase work_mem, and ensure regular VACUUM ANALYZE. More lists speeds search at the cost of memory.