PHPackages                             mohamedsaad/ai-bridge - 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. mohamedsaad/ai-bridge

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

mohamedsaad/ai-bridge
=====================

AI Bridge package to run Python semantic similarity checks inside Laravel

v1.0.1(9mo ago)03MITPHPPHP &gt;=8.1

Since Sep 9Pushed 9mo agoCompare

[ Source](https://github.com/Mohamed-Saad288/laravel-ai-bridge)[ Packagist](https://packagist.org/packages/mohamedsaad/ai-bridge)[ RSS](/packages/mohamedsaad-ai-bridge/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (1)Versions (3)Used By (0)

AI Bridge for Laravel
=====================

[](#ai-bridge-for-laravel)

AI Bridge is a Laravel package that allows you to check the semantic similarity between two texts using Python and Sentence Transformers.

It provides a simple PHP service and Laravel integration while running Python under the hood.

---

🚀 Features
----------

[](#-features)

- **Semantic text similarity** (not just string matching).
- Uses [sentence-transformers](https://www.sbert.net/) (`all-MiniLM-L6-v2`) for embeddings.
- Easy to use inside Laravel via the service container or facade.
- Built-in Python script execution with Symfony Process.

---

📦 Installation
--------------

[](#-installation)

1. **Install the package via Composer:**

    ```
    composer require mohamedsaad/ai-bridge
    ```
2. **Make sure you have Python 3.8+ installed.**
3. **Install the Python dependencies:**

    ```
    pip install sentence-transformers torch
    ```

---

⚡ Usage
-------

[](#-usage)

### Using the Service

[](#using-the-service)

```
use Saad\AiBridge\AiService;

$ai = app(AiService::class);

$score = $ai->similarity("I love programming", "I enjoy coding");

echo $score; // 0.85 (the closer to 1, the more similar)
```

### Using the Facade

[](#using-the-facade)

```
use Facades\Ai;

$score = Ai::similarity("Laravel is great", "I like PHP frameworks");

dd($score);
```

---

🛠 Requirements
--------------

[](#-requirements)

- PHP &gt;= 8.1
- Laravel &gt;= 10
- Python &gt;= 3.8
- Python Packages: `sentence-transformers`, `torch`

---

📌 Example Output
----------------

[](#-example-output)

- **Input:** `"I love programming"` vs `"I enjoy coding"`
- **Output:** `0.82`

---

📝 License
---------

[](#-license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance55

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

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

Every ~0 days

Total

2

Last Release

297d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/131921827?v=4)[Mohamed Saad](/maintainers/Mohamed-Saad288)[@Mohamed-Saad288](https://github.com/Mohamed-Saad288)

---

Top Contributors

[![Mohamed-Saad288](https://avatars.githubusercontent.com/u/131921827?v=4)](https://github.com/Mohamed-Saad288 "Mohamed-Saad288 (10 commits)")

### Embed Badge

![Health badge](/badges/mohamedsaad-ai-bridge/health.svg)

```
[![Health](https://phpackages.com/badges/mohamedsaad-ai-bridge/health.svg)](https://phpackages.com/packages/mohamedsaad-ai-bridge)
```

###  Alternatives

[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k251.2M25.2k](/packages/friendsofphp-php-cs-fixer)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[phpactor/phpactor

PHP refactoring and intellisense tool for text editors

1.9k17.1k1](/packages/phpactor-phpactor)

PHPackages © 2026

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