agent-creator
Use when creating expert agents. Generates agent.md with frontmatter, hooks, required sections, and skill references.
Use when implementing semantic/vector search in Laravel 13 with PostgreSQL + pgvector.
$ npx -y skills add fusengine/agents --skill laravel-vector-search --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/laravel-vector-searchContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when implementing semantic/vector search in Laravel 13 with PostgreSQL + pgvector.
name: laravel-vector-search description: Use when implementing semantic/vector search in Laravel 13 with PostgreSQL + pgvector. versions: laravel: "13.0" php: "8.3" postgresql: "16+" pgvector: "0.7+" user-invocable: true references: references/pgvector-setup.md, references/embeddings-workflow.md, references/queries.md, references/templates/Document-model.php.md, references/templates/VectorSearchService.php.md related-skills: laravel-ai-sdk, laravel-eloquent, laravel-migrations
<objective> Covers Laravel 13 vector/semantic search on PostgreSQL with the pgvector extension: enabling the extension via Schema::ensureVectorExtensionExists(), the vector column type and HNSW/IVFFlat indexing, the embedding generation and persistence workflow, and the query builder's vector methods (whereVectorSimilarTo, selectVectorDistance, whereVectorDistanceLessThan, orderByVectorDistance). PostgreSQL-only — no MySQL/SQLite fallback. For full-text/keyword search, see laravel-scout instead (the two can be combined for hybrid search). </objective>
Before ANY implementation, spawn 3 agents in parallel, one `Agent` call each with a `name`:
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.
---
| 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) |
---
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
---
database/migrations/ └── XXXX_create_documents_table.php # Schema::ensureVectorExtensionExists(), vector(1536) col, HNSW index app/Models/ └── Document.php # casts embedding to array, uses whereVectorSimilarTo app/Ai/Services/ └── VectorSearchService.php # encapsulates query + threshold logic
→ See [Document-model.php.md](references/templates/Document-model.php.md) for full example
---
| Topic | Reference | When to Consult | |-------|-----------|-----------------| | **pgvector setup** | [pgvector-setup.md](references/pgvector-setup.md) | Migrations + index creation | | **Embedding workflow** | [embeddings-workflow.md](references/embeddings-workflow.md) | Generating + persisting vectors | | **Query patterns** | [queries.md](references/queries.md) | `whereVectorSimilarTo` and friends |
| Template | When to Use | |----------|-------------| | [Document-model.php.md](references/templates/Document-model.php.md) | Eloquent model with vector column | | [VectorSearchService.php.md](references/templates/VectorSearchService.php.md) | Reusable service |
---
Schema::ensureVectorExtensionExists();
Schema::create('documents', function (Blueprint $table) {
$table->id();
$table->text('content');
$table->vector('embedding', 1536);
$table->timestamps();
$table->vectorIndex('embedding', algorithm: 'hnsw');
});$documents = Document::query()
->whereVectorSimilarTo('embedding', 'best wineries in Napa Valley', minSimilarity: 0.4)
->limit(10)
->get();→ See [VectorSearchService.php.md](references/templates/VectorSearchService.php.md) for complete example
---
A plugin ecosystem that turns Claude Code into a supervised, multi-agent development environment.
Repo: fusengine/agents
Use when creating expert agents. Generates agent.md with frontmatter, hooks, required sections, and skill references.
Use when starting ANY development task -- feature, bug fix, refactor, hotfix (triggers: implement, create, build, fix, add feature, refactor, develop).
Use when creating a feature/component or adding functionality. Fires BEFORE APEX Analyze to refine requirements via structured questioning.
Use before a root-cause, done/verified claim, irreversible action, or 2nd-time fix reaches the owner (APEX or plain conversation); also fires at every…
Use when validating code quality after modifications -- SOLID compliance, DRY duplication, linter errors, architecture violations. Do NOT use for functional…
Use when an expert agent self-reviews and self-corrects code after the Execute phase, before sniper validation (BMAD-METHOD elicitation techniques).