skills/vendix-ai-embeddings-rag/SKILL.md
Embeddings and RAG pipeline: pgvector setup, OpenAI embedding generation, raw SQL vector storage/search, product event pipeline, RAG context building, and batch sync. Trigger: When working with embeddings, semantic search, pgvector, RAG, or the embedding pipeline.
npx skillsauth add rzyfront/vendix vendix-ai-embeddings-ragInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
apps/backend/src/ai-engine/embeddings/embedding.service.tsapps/backend/src/ai-engine/embeddings/rag.service.tsapps/backend/src/ai-engine/embeddings/embedding-events.listener.tsapps/backend/src/ai-engine/queue/processors/ai-embedding.processor.tsapps/backend/src/jobs/embedding-sync.job.tsapps/backend/prisma/migrations/20260326030000_add_ai_embeddings/migration.sqlCREATE EXTENSION IF NOT EXISTS vector.ai_embeddings.embedding is vector(1536) / Prisma Unsupported("vector(1536)").vector_cosine_ops.[store_id, entity_type, entity_id].OPENAI_API_KEY.text-embedding-3-small.$queryRawUnsafe and $6::vector with ON CONFLICT.1 - (embedding <=> query::vector) as cosine similarity.store_id and optionally by entity_type.limit=5, min_similarity=0.3.Current event listener only handles products:
product.created -> enqueue ai-embedding job embed.product.updated -> enqueue embed.product.deleted -> enqueue delete-embedding.Product content is built from name, description, and category.
To add an entity type, add event listeners, content-building logic, and ensure store/org/entity ids are present in the job payload.
store_id from RequestContextService.aiEngine.chat().EmbeddingService.searchByText() for context.aiEngine.chat(messages), not run().app_key exists in params but is currently unused.embedding-sync.job.ts runs daily at 0 2 * * *, finds up to 500 active products without embeddings, and enqueues embeddings.
Current caveat: batch sync uses global raw SQL and joins embeddings by store_id, entity_type, and entity_id; it does not include organization_id in the join. Verify before changing multi-tenant embedding logic.
store_id filter in raw vector searches.semantic_search is placeholder.vendix-ai-queuevendix-ai-chatvendix-ai-agent-toolsvendix-prisma-migrationsdevelopment
Mobile app development rules for Vendix Expo/React Native project. Trigger: When editing, creating, or modifying any file under apps/mobile, or when developing mobile-specific features.
development
Feature gating by store subscription state: global store write guard, AI feature gate, Redis feature resolution, quota consumption, frontend paywall interceptor, banner, and subscription UI states. Trigger: When adding feature gates, paywalls, subscription-based access control, protecting store write operations, AI feature gates, or rollout flags.
testing
SaaS subscription billing for Vendix stores: plan pricing, invoices, Wompi platform payments, manual payments, partner commissions, payouts, proration, and dunning. Trigger: When creating SaaS invoices, working with partner rev-share, margin/surcharge pricing, invoice sequence allocation, partner payout batches, subscription payments, manual payments, or dunning flows.
development
Periodic quota counters with Redis, UTC period keys, Lua-based idempotent AI quota consumption, request-id deduplication, and post-success consumption. Trigger: When building quota counters, enforcing monthly/daily feature caps, or reusing AI quota patterns for uploads, emails, exports, or rate-limited features.