Download the PHP package thaolaptrinh/laravel-rag without Composer
On this page you can find all versions of the php package thaolaptrinh/laravel-rag. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download thaolaptrinh/laravel-rag
More information about thaolaptrinh/laravel-rag
Files in thaolaptrinh/laravel-rag
Package laravel-rag
Short Description Production-grade RAG engine for Laravel — provider-agnostic, HTTP-based, extensible
License MIT
Homepage https://github.com/thaolaptrinh/laravel-rag
Informations about the package laravel-rag
Laravel RAG
Production-grade RAG (Retrieval-Augmented Generation) engine for Laravel — provider-agnostic, HTTP-based, extensible.
Features
- Document Ingestion: Split documents into chunks, generate embeddings, store in pgvector
- Semantic Search: Cosine similarity search with metadata filtering
- LLM Integration: OpenAI-compatible API support (OpenAI, FPT Cloud, Ollama, vLLM, Supabase)
- Idempotent Re-ingestion: Skip unchanged documents using content hash
- Queue Support: Process large document sets asynchronously
- Testing Helpers: Fake mode for unit testing
Requirements
- PHP 8.4+
- Laravel 11.0, 12.0, 13.0
- PostgreSQL 13+ with pgvector extension
Installation
Configuration
-
Add the RAG database connection to
config/database.php: - Publish and run migrations:
Or manually:
Post-Installation: Create HNSW Index
After ingesting your first documents, create the HNSW vector index for optimal search performance:
Note: The HNSW index cannot be created on an empty table. Run
rag:indexafter your first ingestion.
Environment Variables
Usage
Ingest Documents
Query
Streaming
Delete
Queue Support
For large document sets, use queued ingestion:
Testing
Artisan Commands
Architecture
See docs/ARCHITECTURE.md for detailed architecture documentation.
Key Design Decisions
- Provider-agnostic: Core never mentions specific providers (OpenAI, pgvector, etc.)
- Batch operations: Use
embedBatch(),storeMany()for production performance - Idempotent ingestion: Content hash check skips unchanged documents
- Separate database: Uses
RAG_DB_*connection, not app's default - Hard delete: No soft delete to avoid HNSW index bloat
Testing
License
MIT License. See LICENSE.md.
All versions of laravel-rag with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^11.0||^12.0||^13.0
illuminate/support Version ^11.0||^12.0||^13.0
illuminate/http Version ^11.0||^12.0||^13.0
illuminate/database Version ^11.0||^12.0||^13.0
illuminate/console Version ^11.0||^12.0||^13.0
illuminate/log Version ^11.0||^12.0||^13.0