PHPackages                             jooservices/laravel-embedding - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. jooservices/laravel-embedding

ActiveLibrary

jooservices/laravel-embedding
=============================

A reusable Laravel package for text chunking, embedding generation, and optional vector persistence.

1.0.0(1mo ago)00[7 PRs](https://github.com/jooservices/laravel-embedding/pulls)MITPHPPHP ^8.5CI passing

Since Apr 8Pushed 6d agoCompare

[ Source](https://github.com/jooservices/laravel-embedding)[ Packagist](https://packagist.org/packages/jooservices/laravel-embedding)[ RSS](/packages/jooservices-laravel-embedding/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (19)Versions (7)Used By (0)

JOOservices Laravel Embedding Library
=====================================

[](#jooservices-laravel-embedding-library)

A Laravel package for text chunking, Ollama-based embedding generation, optional persistence, and PostgreSQL `pgvector` similarity search.

Current runtime support is intentionally narrow:

- Ollama embedding generation is supported.
- PostgreSQL with `pgvector` is required for similarity search.
- SQLite/MySQL can persist vectors, but they do not provide vector search through this package.
- OpenAI configuration is reserved for a future release and is not supported at runtime yet.

Key Features
------------

[](#key-features)

1. **Smart Context Chunking:** Includes `DefaultChunker`, `MarkdownChunker`, `SentenceChunker`, and `TokenBudgetChunker`.
2. **Native PostgreSQL Vector Search:** Uses `pgvector` cosine-distance operators (``) when your embedding store is PostgreSQL.
3. **Background Processing:** Ships with queue-aware jobs plus configurable queue connection, queue name, retry/backoff, timeout, and overlap protection.
4. **Safer Re-Embedding:** Can skip unchanged targets and replace persisted target sets only after successful generation.
5. **Flexible Targeting:** Supports Eloquent-backed targets and non-Eloquent `target_type` / `target_id` references.
6. **Search Helpers:** Supports metadata-aware filtering and a thin `EmbeddingSearch` service.

Quick Start
-----------

[](#quick-start)

Please read the complete documentation available in the `docs/` directory:

- [Installation &amp; Setup](docs/01-getting-started/installation.md)
- [Usage &amp; Asynchronous Processing](docs/02-user-guide/01-chunking-and-queues.md)
- [PostgreSQL pgvector Performance](docs/02-user-guide/02-pgvector-performance.md)
- [Dynamic Runtime Context](docs/03-examples/runtime-context.md)

Basic Usage
-----------

[](#basic-usage)

```
use JOOservices\LaravelEmbedding\Facades\Embedding;
use JOOservices\LaravelEmbedding\Facades\EmbeddingSearch;

// 1. Single text raw vector
$vector = Embedding::embedText('Who is the CEO of Apple?');

// 2. Chunk, embed, and persist a non-Eloquent target
Embedding::chunkAndEmbed($hugePdfContent, [
    'target_type' => 'document',
    'target_id' => 'annual-report-2024',
    'namespace' => 'finance',
    'skip_if_unchanged' => true,
    'author' => 'System',
]);

// 3. Search & Retrieve (PostgreSQL + pgvector only)
$results = EmbeddingSearch::similarToText('Company leadership', 5, [
    'namespace' => 'finance',
    'meta' => ['author' => 'System'],
]);
```

PostgreSQL Notes
----------------

[](#postgresql-notes)

This package does not auto-create a pgvector ANN index because index strategy depends on your chosen model dimensions and operational preferences. Treat extension enablement and index creation as deployment decisions in the host application.

If you want the package migration to attempt `CREATE EXTENSION vector`, enable:

```
EMBEDDING_PGVECTOR_ENSURE_EXTENSION=true
```

AI Agents &amp; Development
---------------------------

[](#ai-agents--development)

This package contains strict documentation for external AI Agents (Cursor, Cline, Github Copilot). If you are an AI Agent building on top of this package, read the Skill sheet located at `.agents/skills/laravel-embedding/SKILL.md`.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance97

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

32d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a4ff5b64fb70623808dbe8a32cabfd3add7db11ee382893a437c2660ba9d9f55?d=identicon)[jooservices](/maintainers/jooservices)

---

Top Contributors

[![soulevilx](https://avatars.githubusercontent.com/u/2688707?v=4)](https://github.com/soulevilx "soulevilx (8 commits)")

---

Tags

laravelaivectorollamaembeddingchunking

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jooservices-laravel-embedding/health.svg)

```
[![Health](https://phpackages.com/badges/jooservices-laravel-embedding/health.svg)](https://phpackages.com/packages/jooservices-laravel-embedding)
```

###  Alternatives

[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[dragon-code/laravel-http-logger

Logging incoming HTTP requests

319.8k3](/packages/dragon-code-laravel-http-logger)[bjuppa/laravel-blog

Add blog functionality to your Laravel project

483.3k1](/packages/bjuppa-laravel-blog)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
