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. [Utility &amp; Helpers](/categories/utility)
4. /
5. jooservices/laravel-embedding

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

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

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

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

Since Apr 8Pushed 1mo 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 2w ago

READMEChangelog (1)Dependencies (19)Versions (10)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

40

—

FairBetter than 86% of packages

Maintenance88

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity57

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

77d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/142772948?v=4)[JOOservices Ltd](/maintainers/jooservices)[@jooservices](https://github.com/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

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.6k](/packages/larastan-larastan)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)[calebdw/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

15104.9k4](/packages/calebdw-larastan)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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