Download the PHP package sharifuddin/laravel-ai-bridge without Composer

On this page you can find all versions of the php package sharifuddin/laravel-ai-bridge. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-ai-bridge

Laravel AI Bridge โ€” AI Agent, Function Calling & Vector Search Package for Laravel

Laravel AI Bridge is a production-grade Laravel AI integration package that turns any Laravel application into an AI agent capable of understanding natural-language prompts and safely executing your existing controllers, services, and business logic as callable "tools." It supports Gemini, OpenAI (ChatGPT), DeepSeek, Anthropic (Claude), and any custom or self-hosted AI model, with automatic vector embedding generation, automatic AI provider failover, and zero-code tool discovery โ€” making it the fastest way to add a Laravel AI chatbot, Laravel AI assistant, or natural-language-to-API layer to any existing Laravel project.

Latest Version on Packagist Total Downloads PHP Version Laravel Version

Keywords: Laravel AI package, Laravel AI agent, Laravel function calling, Laravel Gemini integration, Laravel OpenAI integration, Laravel ChatGPT package, Laravel DeepSeek integration, Laravel vector database, Laravel MySQL vector search, Laravel pgvector, natural language to Laravel controller, Laravel AI chatbot, Laravel LLM tool calling, AI agent auto failover.


๐Ÿ“š Table of Contents


๐Ÿ”ฅ Why Laravel AI Bridge?

Most "AI for Laravel" tutorials wire up a single hardcoded prompt to a single hardcoded model. Laravel AI Bridge is different โ€” it's a full AI orchestration layer built for real production apps with hundreds of existing controllers:


โœจ Feature Highlights


๐Ÿ“Š Feature Comparison Matrix

Capability Laravel AI Bridge
Multi AI provider support (Gemini / OpenAI / DeepSeek / Anthropic / Custom) โœ…
Automatic AI provider failover on rate limit / error โœ…
Automatic vector embedding generation โœ…
MySQL vector database support โœ…
PostgreSQL (pgvector) vector database support โœ…
MongoDB / Qdrant / Pinecone vector database support โœ…
Zero-config controller discovery โœ…
Auto pagination/filter/date-range parameter discovery โœ…
FormRequest / Controller+Service / $fillable auto-detection โœ…
Bulk array-of-objects (bulk create/update) support โœ…
Excel / PDF / CSV export passthrough โœ…
Permission & Gate re-authorization on every AI action โœ…
Multi-tenant isolation โœ…
Ready-made Chat UI โœ…
2-command installation โœ…

โš™๏ธ Requirements


๐Ÿ“ฆ Installation โ€” 2-Command Setup

Get a fully working Laravel AI agent running in just two commands:

That's it โ€” add one AI provider API key to your .env and your Laravel app already understands natural-language prompts.

Full setup (recommended for production)

1. Install via Composer

2. Publish configuration

3. Configure your environment

4. Generate the vector index

5. Start chatting

or open the ready-made UI at GET /ai/assistant.

Vector Store Architecture


๐Ÿ” Automatic AI Provider Switching & Failover (Gemini, OpenAI, DeepSeek, Anthropic + Custom)

Laravel AI Bridge is not locked into a single AI vendor. Switch your Laravel AI agent's underlying model with a single .env change:

๐Ÿšฆ Auto Switch AI Agent if Limit Expired or Error Occurs

Configure an ordered automatic failover chain. If your primary provider hits a rate limit, a quota/billing error, a server outage, a network timeout, or any other error, Laravel AI Bridge automatically and transparently switches to the next configured provider โ€” the end user never notices a thing:

With the above, the chain is: Gemini โ†’ OpenAI โ†’ DeepSeek. If every provider in the chain fails, a single clear, combined error is returned (never a silent failure), and an AiProviderFailedOver event fires on every switch so you can log, alert, or track it in your own monitoring stack.

Adding a brand-new custom AI provider (a self-hosted model, Groq, OpenRouter, or any other OpenAI-compatible endpoint) is a config-only change โ€” no PHP code required:


๐Ÿง  Automatic Tool & Vector Generation (Zero-Config Discovery)

Laravel AI Bridge automatically scans your existing controllers and generates rich, filter-aware vector embeddings for every action โ€” no manual metadata entry, no manual embedding pipeline:


๐Ÿ—„ Vector Database Support (PostgreSQL, MySQL, MongoDB, Qdrant, Pinecone)

Laravel AI Bridge ships with a pluggable vector database layer โ€” pick whichever your infrastructure already runs, with zero code changes:

Driver Extension Required Best For
postgresql (default) pgvector Teams already on Postgres wanting native vector search
mysql None โ€” works on stock MySQL/MariaDB Teams who want vector search without installing any new database or extension
mongodb mongodb/mongodb + Atlas Vector Search MongoDB-based applications
qdrant None (HTTP API) Dedicated, high-performance vector search infrastructure
pinecone None (HTTP API) Fully managed vector search SaaS
array None Local development / testing, dependency-free

Switch between them with a single environment variable:

The MySQL vector store is especially popular for teams who want AI-powered semantic search over their Laravel controllers without provisioning a new database engine โ€” it stores embeddings directly in a MySQL table and performs similarity ranking without any external service.


๐Ÿ“ File / Excel / PDF Export Support

Ask your AI agent to export data and get back a real, working file โ€” not broken JSON. Any controller action that returns a file download (Excel::download(), response()->streamDownload(), Storage::download(), or any Response with a Content-Disposition: attachment header) is detected automatically and streamed straight through to the HTTP response untouched:

No special configuration needed โ€” this works automatically alongside the same auto-discovered export=excel-style query parameters described above.


๐Ÿ›  Defining a First-Class AI Tool

Register it (list it in config/ai-bridge.php) or e.g. in a service provider's boot():

Or

Custom tool example for your own app

This is the pattern most apps use when they want AI to call their own business logic:

And register it (list it in config/ai-bridge.php) or e.g. in a service provider's boot():

Or

Then index and ask the assistant:

The AI will only see the declarations for the tools that match the prompt, and it will execute the selected custom tool only after validation + re-authorization.

Behind the scenes: normalize โ†’ embed โ†’ vector search โ†’ hybrid rank โ†’ permission/tenant filter โ†’ send only the matching tool declarations to the active AI provider โ†’ validate its chosen arguments โ†’ re-authorize โ†’ execute โ†’ return a compact, bounded JSON result (or stream a file, for exports).

Multi-tenant tools


๐Ÿงฉ Backward Compatibility (Legacy Controller Tools)

Controllers previously discovered via ToolProviderInterface/CachedControllerToolProvider (implementing the interface, or just reflected by public method) keep working with zero changes. They are wrapped as LegacyControllerToolAdapter instances and merged into the same registry, so they get the same semantic retrieval, argument validation, and authorization re-check as first-class tools โ€” plus automatic query-parameter, FormRequest, bulk-array, and route-model-binding discovery described above. Disable this via ai-bridge.legacy_controllers.enabled = false once fully migrated.

The original AiProcessorInterface methods (processPrompt(), selectRelevantTools()) are preserved unchanged for any code calling them directly. AiController and the new AiService::chat() pipeline are what changed.


โšก Artisan Commands


๐Ÿ—‚ Architecture

Key interfaces (all in Sharifuddin\LaravelAiBridge\Contracts): ToolInterface, ToolRegistryInterface, VectorStoreInterface, EmbeddingProviderInterface, AiProviderInterface, TenantContextResolverInterface. Swap any implementation without touching the rest of the pipeline.

See config/ai-bridge.php for every tunable: retrieval weights/thresholds, cache TTLs, vector store connection, embedding driver, provider failover order, execution limits.


๐Ÿ” Security Model


๐Ÿ’ฌ Chat UI

A ready-made, Copilot-style chat interface is included out of the box at GET /ai/assistant โ€” no frontend build step required.

![Laravel AI Bridge chat UI with pinned prompts sidebar](<Screenshot from 2026-09-11 16-23-20.png>)


โ“ Frequently Asked Questions (FAQ)

Does Laravel AI Bridge work with OpenAI/ChatGPT instead of Gemini? Yes. Set AI_BRIDGE_PROVIDER=openai and add your OPENAI_API_KEY โ€” no code changes needed. DeepSeek and Anthropic (Claude) are supported the same way.

What happens if my AI provider's API key runs out of quota? If you've configured AI_BRIDGE_FAILOVER_ORDER, Laravel AI Bridge automatically switches to the next configured AI provider with zero downtime and zero code changes.

Can I use MySQL instead of PostgreSQL for vector search? Yes. Set AI_VECTOR_STORE=mysql โ€” no extensions or additional services required, it works on stock MySQL/MariaDB.

Do I need to manually register every controller as an AI tool? No. Existing controllers are discovered automatically, including their query parameters, filters, and validation rules โ€” you only need to define a first-class ToolInterface tool if you want to expose logic that isn't already behind a controller.

Does it support bulk create/update endpoints? Yes. Endpoints validating arrays of objects (e.g. 'items.*.name' => 'required|string') are automatically understood and exposed to the AI with the correct nested schema.

Can the AI export data as an Excel or PDF file? Yes. Any controller action returning a file download response is streamed back to the client automatically โ€” no extra configuration needed.

Is it safe to let an AI model call my application's controllers directly? Yes โ€” every AI-selected tool call is re-validated against a strict argument schema and re-authorized through Laravel's own Gate/Policy system immediately before execution, regardless of what the AI model returns.


๐Ÿงช Testing


๐Ÿ“„ License

This package is open-sourced software licensed under the MIT license.


๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ‘จโ€๐Ÿ’ป Author

Sharif Uddin


๐ŸŒŸ Support

If you find this Laravel AI package useful, please consider:


๐Ÿ“š Changelog

Detailed changes for each release are documented in CHANGES.md.


๐Ÿ”— Links


๐ŸŽฏ Quick Start Cheat Sheet


Laravel AI Bridge โ€” the fastest way to turn any Laravel application into a secure, production-ready AI agent. ๐Ÿค–โœจ


All versions of laravel-ai-bridge with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1|^8.2|^8.3|^8.4
illuminate/support Version ^9.0|^10.0|^11.0|^12.0
illuminate/http Version ^9.0|^10.0|^11.0|^12.0
illuminate/routing Version ^9.0|^10.0|^11.0|^12.0
illuminate/cache Version ^9.0|^10.0|^11.0|^12.0
guzzlehttp/guzzle Version ^7.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sharifuddin/laravel-ai-bridge contains the following files

Loading the files please wait ...