Download the PHP package ayaashraf/laravel-rag without Composer

On this page you can find all versions of the php package ayaashraf/laravel-rag. 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-rag

Laravel RAG Package

A production-ready Retrieval-Augmented Generation (RAG) package for Laravel using pgvector and Livewire.

Features

Installation

Publishing Assets

Publish configuration, migrations, and views:

Run migrations:

Configuration

Create a PostgreSQL connection for vectors in config/database.php:

Configure environment variables in .env:

Usage

In Blade Templates

Programmatic Usage

With Callback Hooks

Database Schema

Documents Table

Stores document metadata on MySQL/Primary DB:

Document Chunks Table

Stores vector embeddings on PostgreSQL with pgvector:

Architecture

The package uses a multi-database approach:

This separation allows:

Configuration Options

All options can be set via config/rag.php or .env variables:

Option Env Var Default Description
embedding_provider RAG_EMBEDDING_PROVIDER gemini AI provider for embeddings
vector_connection RAG_VECTOR_CONNECTION pgsql_vector PostgreSQL connection name
documents_connection RAG_DOCUMENTS_CONNECTION mysql Metadata DB connection
min_similarity RAG_MIN_SIMILARITY 0.45 Threshold for English queries
arabic_min_similarity RAG_ARABIC_MIN_SIMILARITY 0.30 Threshold for Arabic queries
embedding_dimensions RAG_EMBEDDING_DIMENSIONS 768 Vector dimensions
chunk_size RAG_CHUNK_SIZE 1000 Characters per chunk
chunk_overlap RAG_CHUNK_OVERLAP 200 Overlap between chunks
max_search_results RAG_MAX_SEARCH_RESULTS 10 Max chunks to retrieve
storage_disk RAG_STORAGE_DISK rag_documents Storage disk for files
chunker_strategy RAG_CHUNKER_STRATEGY character Chunking strategy
chat.provider RAG_CHAT_PROVIDER gemini Chat completion provider
chat.model RAG_CHAT_MODEL gemini-2.0-flash Chat model name
chat.timeout RAG_CHAT_TIMEOUT 120 Request timeout in seconds

Advanced Usage

Custom Embedding Providers

Create your own embedding implementation:

Manual Document Processing

Performance Tips

  1. Use Queue Workers for document processing:

  2. Enable Embedding Caching in config/ai.php:

  3. Batch Imports for large document sets:

  4. Tune Similarity Threshold based on your documents:
    • Lower threshold (0.30) = More results, lower precision
    • Higher threshold (0.70) = Fewer results, higher precision

Troubleshooting

Vector Search Returns No Results

Check the similarity threshold:

Out of Memory During PDF Processing

Limit PDF size or process asynchronously:

Embedding API Rate Limiting

Reduce batch size in config/rag.php:

Testing

Run the package tests:

License

MIT License - see LICENSE file for details.

Support

For issues, questions, or contributions, please visit the GitHub repository.


Made with ❤️ for Laravel developers


All versions of laravel-rag with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
laravel/framework Version ^12.0
laravel/ai Version ^0.6.8
livewire/livewire Version ^3.0 || ^4.0
pgvector/pgvector Version ^0.2.0
spatie/pdf-to-text Version ^1.55
phpoffice/phpspreadsheet Version ^5.7
phpoffice/phpword Version ^1.4
smalot/pdfparser Version ^2.12
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 ayaashraf/laravel-rag contains the following files

Loading the files please wait ...