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(8mo ago)03MITPHPPHP &gt;=8.1

Since Sep 9Pushed 8mo 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 1mo ago

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

31

—

LowBetter than 68% of packages

Maintenance62

Regular maintenance activity

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

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

242d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/52030d5c27987d21035f971d66fc1aa3513523fc8040c98971db3a1bd46960de?d=identicon)[Mohamed-Saad288](/maintainers/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

[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5205.3M82](/packages/symplify-monorepo-builder)[spatie/typescript-transformer

This is my package typescript-transformer

3706.5M16](/packages/spatie-typescript-transformer)[civicrm/civicrm-core

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

728272.9k17](/packages/civicrm-civicrm-core)[shivas/versioning-bundle

Symfony application versioning, simple console command to manage version (with providers e.g. git tag) of your application using Semantic Versioning 2.0.0 recommendations

1121.2M1](/packages/shivas-versioning-bundle)[eclipxe/cfdiutils

PHP Common utilities for Mexican CFDI 3.2, 3.3 &amp; 4.0

141129.9k6](/packages/eclipxe-cfdiutils)[shyim/danger-php

Port of danger to PHP

8544.9k](/packages/shyim-danger-php)

PHPackages © 2026

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