portal-catalog-rag

Implements a two-phase semantic data catalog search with keyword ranking and hybrid pgvector retrieval.

Updated Jul 27, 2026
One-click install
npx skills add https://github.com/ArthurZizumbo/karisma-data --skill portal-catalog-rag-arthurzizumbo
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: portal-catalog-rag
Source: https://github.com/ArthurZizumbo/karisma-data/tree/main/.claude/skills/portal-catalog-rag
Command: npx skills add https://github.com/ArthurZizumbo/karisma-data --skill portal-catalog-rag-arthurzizumbo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires sqlalchemy, google-genai.

What problem does it solve? Business users and agents need to find the right data fields in a catalog using natural language queries, but pure keyword search misses semantic matches while pure vector search loses exact business terms. This Skill implements a two-phase catalog search that keeps one response contract across both phases. ## Core Features & Use Cases - Keyword MVP: ILIKE and PostgreSQL tsvector ranking over business names and definitions behind /api/catalog/search. - Hybrid RAG phase: Combines tsvector keyword scores with pgvector cosine similarity over Gemini embeddings (VECTOR(768)) with fixed 0.4/0.6 weights. - Tribal notes with applicability: Attaches contextual notes to hits only when their applicability condition matches the query, and every response cites its source. - Evaluation gate: Enforces Hit Rate@3 >= 0.8 on a 20-query business evaluation set before closing the hybrid phase. - Use Case: A user searches "saldo vencido de la cartera" and receives catalog hits citing the creditos source, with applicable tribal notes attached. ## Quick Start Ask the agent to implement the catalog search endpoint with keyword tsvector ranking first, then add the hybrid pgvector scoring and run the Hit Rate@3 evaluation.

Frequently Asked Questions about portal-catalog-rag

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

FAQPage Schema
How do I build a hybrid search combining keyword and vector scores in PostgreSQL?▼

Combine tsvector keyword ranking with pgvector cosine similarity in a single ORDER BY clause using fixed weights, such as 0.4 for keyword score and 0.6 for vector score. This keeps exact business terms competitive while adding semantic matching.

How do I generate embeddings for a data catalog with the Gemini API?▼

Embed a concatenation of business name, definition, and tribal notes per catalog field using the gemini-embedding-001 model with output dimensionality 768. Run it as a batch job after seeding or editing the catalog, storing results in a VECTOR(768) column.

Why not use pure vector search for a business data catalog?▼

Pure vector search can demote exact business terminology that users rely on. The hybrid approach guarantees keyword matches still win when appropriate, while cosine similarity catches paraphrased queries that keyword search misses.

How do I evaluate retrieval quality for a semantic catalog search?▼

Build an evaluation set of 20 business queries with expected sources, then measure Hit Rate@3 by checking whether the expected source appears in the top 3 results. The hybrid phase requires Hit Rate@3 >= 0.8 before it is considered complete.

When should I use a hierarchical retrieval approach instead of flat RAG?▼

For homogeneous tabular corpora like a data catalog, flat retrieval outperforms hierarchy, so keep the catalog flat. A navigable hierarchy like Corpus2Skill applies only to document collections such as manuales/, and is treated as a stretch goal.