laravel-vector-search

laravel-vector-search is a skill for Claude Code, Codex from fusengine/agents. It costs 22 tokens per session (1,243 once invoked), scanned A, original, MIT.

A Laravel implementation for semantic search, which finds records by meaning rather than only matching exact words. It uses PostgreSQL with the pgvector extension to store and compare numeric representations of text.

In plain words
What is it for?
Use it to store embeddings, generate them from text, compare similarity, filter by distance, and order PostgreSQL results by meaning.
Why use it?
It helps searches find related wording and concepts, but requires PostgreSQL and does not work with MySQL or SQLite.

Skill for Claude CodeCodex

Part of the fuse-laravel plugin — 23 skills, 1 agent shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/fusengine/agents/laravel-vector-search
Any agent
npx skills add fusengine/agents --skill laravel-vector-search
Clone the repo
git clone --depth 1 https://github.com/fusengine/agents

Made for: Claude Code, Codex.

Or install fuse-laravel, the plugin that ships this one along with the rest of its 23 skills, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for laravel-vector-search

README.md
[![agentmods](https://agentmods.dev/badge/skills/fusengine/agents/laravel-vector-search.svg)](https://agentmods.dev/skills/fusengine/agents/laravel-vector-search)
Your own site
<a href="https://agentmods.dev/skills/fusengine/agents/laravel-vector-search"><img src="https://agentmods.dev/badge/skills/fusengine/agents/laravel-vector-search.svg" alt="Measured on agentmods" height="20"></a>
Per session 22 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,243 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00022 $0.01243
Opus 5 $0.00011 $0.00622
Sonnet 5 $0.00004 $0.00249
Haiku 4.5 $0.00002 $0.00124

Measured yesterday against content hash 0b1a6e3a90cc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

laravel-vector-search scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/laravel-expert/skills/laravel-vector-search/SKILL.md · 137 lines

How it starts

The opening of the file, as written. The whole thing — 137 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Laravel 13 Vector Search (pgvector)

Agent Workflow (MANDATORY)

Before ANY implementation, use TeamCreate to spawn 3 agents:

  1. fuse-ai-pilot:explore-codebase - Check current DB driver (must be PostgreSQL) and existing embedding columns
  2. fuse-ai-pilot:research-expert - Verify pgvector extension version and HNSW vs IVFFlat tradeoffs
  3. mcp__context7__query-docs - Pull laravel.com/docs/13.x/search + queries examples

After implementation, run fuse-ai-pilot:sniper for validation.


Overview

Feature Description
PostgreSQL only Requires pgvector extension; not available on MySQL/SQLite
Schema helper Schema::ensureVectorExtensionExists() enables the extension
Query builder whereVectorSimilarTo(), selectVectorDistance(), whereVectorDistanceLessThan(), orderByVectorDistance()
Auto-embedding Pass a raw string and Laravel generates the embedding via AI SDK
Cosine similarity Default distance; threshold via minSimilarity (0.0 - 1.0)

Critical Rules

  1. Use PostgreSQL - Vector clauses ONLY work on pgsql connections - no fallback to MySQL/SQLite
  2. Create an HNSW index - Without an index, queries do full table scans; > 10k rows means seconds-to-minutes latency
  3. Match dimensions exactly - Insert-time and query-time embedding models MUST share the same dimensions
  4. Cache embeddings - Regenerating embeddings on every request is the #1 cost driver; persist them
  5. Lock the embedding model - Changing the model invalidates ALL stored embeddings; treat the model as a schema field

Read the full file on GitHub · 137 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 137 lines · 22 tokens per session scan A 0b1a6e3a90cc

Subscribe to this mod's changes

laravel-vector-search is a skill published in the GitHub repository fusengine/agents (25 stars, last pushed 1mo ago), licensed MIT. It adds 22 tokens to every session and 1,243 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

pgvector-semantic-search

Use this skill for setting up vector similarity search with pgvector for AI/ML embeddings, RAG applications, or semantic search. Trigger when user asks to: Store or search vector embeddings in PostgreSQL Set up semantic search, similarity search, or nearest neighbor search Create HNSW or IVFFlat indexes for vectors…

timescale/pg-aiguide · 190 tokens

postgres-hybrid-text-search

Use this skill to implement hybrid search combining BM25 keyword search with semantic vector search using Reciprocal Rank Fusion (RRF). Trigger when user asks to: Combine keyword and semantic search Implement hybrid search or multi-modal retrieval Use BM25/pgtextsearch with pgvector together Implement RRF (Reciprocal…

timescale/pg-aiguide · 162 tokens

030201-pgvector-embeddings

Vector search with pgvector — embedding generation (OpenAI or hash), HNSW indexing, cosine similarity search, and enriched product JOIN queries.

natuleadan/skills · 38 tokens

pinecone

Set up Pinecone as the vector DB in a RAG pipeline — index config, batch upsert, semantic query, metadata filters. Use when the user is adding Pinecone or debugging vector search.

phucbm/skills · 43 tokens

cloudflare-vectorize

Cloudflare Vectorize vector database for semantic search and RAG. Use for vector indexes, embeddings, similarity search, or encountering dimension mismatches, filter errors.

secondsky/claude-skills · 37 tokens

ai-vector-brain

Builds vector-brain implementations for repos, docs hubs, and compliance corpora. Use when creating pgvector retrieval brains with scripts, SQL, manifests, and evals.

vasilyu1983/AI-Agents-public · 40 tokens