一键导入
laravel-vector-search
Add semantic search with native vector queries (Laravel 13+); pgvector similarity clauses, embedding workflows, and hybrid search patterns
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Add semantic search with native vector queries (Laravel 13+); pgvector similarity clauses, embedding workflows, and hybrid search patterns
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | laravel:vector-search |
| description | Add semantic search with native vector queries (Laravel 13+); pgvector similarity clauses, embedding workflows, and hybrid search patterns |
Use native vector query support to build semantic search on PostgreSQL + pgvector. Generate embeddings via the AI SDK and query them directly from the query builder.
# Migration: vector column (requires pgvector extension)
Schema::table('documents', function (Blueprint $table) {
$table->vector('embedding', dimensions: 1536);
});
# Generate an embedding
use Illuminate\Support\Str;
$embedding = Str::of('Best wineries in Napa Valley')->toEmbeddings();
# Similarity search from the query builder
$documents = DB::table('documents')
->whereVectorSimilarTo('embedding', 'Best wineries in Napa Valley')
->limit(10)
->get();
limit() similarity queries; unbounded vector scans are expensivewhere filters (tenant, status, locale) to scope resultsBuild AI features with the first-party Laravel AI SDK (Laravel 13+); agents, embeddings, images, audio, and tool calling with provider-agnostic APIs
Use API Resources with pagination and conditional fields; keep response shapes stable and cache-friendly
Compose UIs with Blade components, slots, and layouts; keep templates pure and testable
Request effective code reviews—specify focus areas, provide context, ask for architectural feedback, reference Laravel conventions
Practical daily checklist for Laravel projects; bring services up, run migrations, queues, quality gates, and tests
Create effective debugging prompts—include error messages, stack traces, expected vs actual behavior, logs, and attempted solutions