semantic-patterns

Transform natural language questions into vector-search prompts for RAG systems.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/pascalandy/dotfiles --skill semantic-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: semantic-patterns
Source: https://github.com/pascalandy/dotfiles/tree/main/dot_config/opencode/skill/semantic-patterns
Command: npx skills add https://github.com/pascalandy/dotfiles --skill semantic-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps data teams and developers transform vague user questions into structured prompts for vector-based retrieval systems, improving recall and relevance in large knowledge bases.

Core Features & Use Cases

  • Pattern-driven query engineering: Expansion, Decomposition, Contextual Rewriting, Diagnostic Expansion, Self-Ask, HyDE, Metadata Pre-filtering, Multi-hop Retrieval, Temporal Rewriting.
  • Use Cases: Build semantic search pipelines, design retrieval logic, and diagnose recall failures in large document corpora.
  • Reference: See references/semantic-patterns.md for detailed pattern definitions and examples.

Quick Start

Provide a natural language question to the skill and it will generate a suite of vector-search prompts using the patterns above to guide retrieval.

Frequently Asked Questions about semantic-patterns

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

FAQPage Schema
How do I improve vector search recall for vague natural language questions in RAG?

Use query engineering patterns like Expansion, Decomposition, and Contextual Rewriting to transform natural language questions into optimized retrieval prompts. This structures vague queries to match relevant documents more accurately in large knowledge bases.

What is HyDE and how does it work for semantic retrieval?

HyDE is a semantic retrieval pattern that rewrites queries into hypothetical answer documents before vectorizing. It bridges the semantic gap between short questions and longer informational text in vector stores.

How do I implement multi-hop retrieval across large document corpora?

Apply query decomposition and Self-Ask patterns to break complex questions into sequential sub-queries. This allows the retrieval pipeline to gather intermediate context across large document stores before synthesizing a final answer.

Can I use metadata filtering with vector search to narrow down document retrieval?

Yes, metadata pre-filtering narrows the vector search space by applying structural filters before semantic retrieval. This improves precision and reduces computational load on the vector store.

Why does my RAG pipeline return irrelevant results and how can I debug retrieval failures?

Debug retrieval failures by applying diagnostic query expansion to generate multiple varied search prompts from the original question. This identifies whether poor recall stems from query phrasing mismatches or embedding limitations.

Do I need external dependencies or specialized databases to run these semantic search patterns?

No external dependencies are required beyond standard vector-store tooling. The query transformations run without additional runtime environments, generating optimized prompts directly compatible with existing RAG retrieval pipelines.