sqlalchemy-model-generator

Generate SQLAlchemy models with pgvector embeddings and BM25 indexing.

3|1|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/Gzmomo001/antichet_RAG --skill sqlalchemy-model-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sqlalchemy-model-generator
Source: https://github.com/Gzmomo001/antichet_RAG/tree/main/.claude/skills/sqlalchemy-model-generator
Command: npx skills add https://github.com/Gzmomo001/antichet_RAG --skill sqlalchemy-model-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Create structured SQLAlchemy models (with UUID primary keys) and optional vector embeddings, enabling PostgreSQL-based vector search and BM25 indexing for fast retrieval in ML-assisted apps.

Core Features & Use Cases

  • Auto-generate model classes following existing conventions (Base, tablename, timestamps, UUID PK).
  • Add embedding columns using pgvector (Vector(dim)) with dimension controlled by settings.
  • Implement full-text search support via TSVector and appropriate indexes for BM25 lookups.
  • Update initialization and retrieval scaffolds (init_db.py, retrieval service) to integrate new models seamlessly.
  • Read and reference existing models to maintain consistency and lineage.

Quick Start

Provide the table name and field specifications to generate a new SQLAlchemy model with pgvector embedding and BM25 indexing.

Frequently Asked Questions about sqlalchemy-model-generator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate SQLAlchemy models with pgvector support for new database tables?

To generate SQLAlchemy models with pgvector support, provide the table name and field specifications. The tool scaffolds model classes with UUID primary keys, vector embedding columns, and BM25 full-text search integration consistent with existing conventions.

What is the best way to add vector embeddings to a SQLAlchemy model?

Adding vector embeddings to a SQLAlchemy model is handled by creating pgvector columns with dimensions controlled by application settings. This ensures vector search capabilities are integrated while maintaining alignment with existing database schemas and retrieval scaffolds.

How does BM25 full-text search work with SQLAlchemy and PostgreSQL?

BM25 full-text search with SQLAlchemy uses TSVector columns and appropriate indexes to enable fast text lookups. The model generator creates these indexing scaffolds automatically, allowing ML-assisted apps to perform efficient retrieval alongside vector similarity searches.

Does the generated SQLAlchemy model enforce UUID primary keys?

Yes, the generated SQLAlchemy model strictly enforces UUID primary keys for all new entities. This standardization ensures consistency across your database tables and aligns with existing model conventions for reliable data lineage and integration.

Can I update existing initialization and retrieval scripts when adding new database tables?

You can update initialization and retrieval scaffolds like init_db.py and retrieval services automatically when adding new tables. The generator reads and references existing models to seamlessly integrate new entities while maintaining structural consistency.

What are the limitations of scaffolding SQLAlchemy models for vector search?

Scaffolding SQLAlchemy models for vector search is limited to PostgreSQL databases using pgvector. It requires existing model conventions to reference for consistency and focuses on generating UUID-based entities, so it may not suit legacy schemas lacking these structural foundations.