Download the PHP package hamzi/nativerag without Composer
On this page you can find all versions of the php package hamzi/nativerag. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hamzi/nativerag
More information about hamzi/nativerag
Files in hamzi/nativerag
Package nativerag
Short Description A production-ready, privacy-first Local AI Controller and Retrieval-Augmented Generation (RAG) engine for Laravel 11, 12, and 13. Supports Ollama, LM Studio, zero-infra vector search, SSE streaming, and full conversational memory โ all with 100% data residency.
License MIT
Homepage https://github.com/hamdyelbatal122/nativerag
Informations about the package nativerag
๐ง Laravel NativeRAG
A world-class, production-ready Local AI & RAG Engine for Laravel 11, 12 & 13
Laravel NativeRAG empowers you to run fully localized, privacy-first AI workflows using models hosted in Ollama or LM Studio โ directly from your Laravel application.
No OpenAI keys. No Pinecone. No cloud data leaks. 100% data residency. Zero external dependencies.
โจ Features
| Feature | Details |
|---|---|
| ๐ค Multi-Driver LLM | Switch between Ollama & LM Studio via Laravel's Manager pattern |
| ๐๏ธ Zero-Infra Vector Search | Cosine Similarity powered by PHP + native SQL. No Pinecone needed |
| โก SSE Streaming | Real-time token streaming to Alpine.js / Livewire frontends |
| ๐งฉ Auto-Embedding Trait | Add Embeddable to any Eloquent model for automatic vector indexing |
| ๐ง Persistent Memory | Multi-turn chat history with sliding-window pruning |
| ๐ Payload Encryption | Encrypt stored chat history using Laravel's App Key |
| ๐ก๏ธ Strict Types | PHP 8.2+ with declare(strict_types=1), Readonly DTOs, Enums |
| ๐ pgvector Support | Native PostgreSQL pgvector cosine distance queries |
โ Compatibility
| Laravel | PHP | Status |
|---|---|---|
| 13.x | 8.2, 8.3, 8.4, 8.5 | โ Fully Supported |
| 12.x | 8.2, 8.3, 8.4, 8.5 | โ Fully Supported |
| 11.x | 8.2, 8.3, 8.4, 8.5 | โ Fully Supported |
๐ Installation
Publish configuration and migrations:
๐ ๏ธ Configuration
Set your driver settings in .env:
๐ Usage
1. Chat Completions
2. Real-Time SSE Streaming
Consume in JavaScript (Alpine.js / Vanilla):
3. Embeddable Models (Auto-Indexing)
Attach the Embeddable trait to any Eloquent model. Whenever the model is saved, its content is automatically chunked and embedded locally.
4. Semantic Vector Search
5. Switch Driver at Runtime
๐ Security & Privacy
- 100% On-Premise: All inference runs against Ollama/LM Studio on your own hardware. Zero network calls leave your server.
- Payload Encryption: Enable
NATIVE_RAG_ENCRYPT_PAYLOADS=trueto encrypt all stored chat content and metadata using Laravel's native AES-256-CBC encryption. - SQL Injection Safe: Strictly uses Laravel's parameterized query builder with no raw string interpolations.
- Change Detection: MD5 content hashing prevents re-embedding unchanged documents โ eliminating redundant local API calls.
๐งช Testing & Code Quality
๐ค Contributing
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
๐ก๏ธ Security Vulnerabilities
Please review the SECURITY.md policy to learn how to responsibly report a vulnerability.
๐ License
The MIT License (MIT). Please see LICENSE.md for more information.
All versions of nativerag with dependencies
illuminate/support Version ^11.0|^12.0|^13.0
illuminate/database Version ^11.0|^12.0|^13.0
illuminate/http Version ^11.0|^12.0|^13.0
symfony/http-foundation Version ^7.0|^8.0