Download the PHP package manik/neuro without Composer
On this page you can find all versions of the php package manik/neuro. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package neuro
Short Description A unified AI interface for Laravel — LLMs, embeddings, vector databases, RAG pipelines, agents, and more.
License MIT
Informations about the package neuro
Neuro: Laravel AI Framework
A unified AI interface for Laravel — LLMs, embeddings, vector databases, RAG pipelines, agents, and more.
- Installation
- Configuration
- Quick Start
- LLM Providers
- Embedding Providers
- Vector Databases
- RAG Pipeline
- Agents & Tool Calling
- Memory
- Image Generation
- Speech Processing
- Document Ingestion & Chunking
- Testing
- Events & Observability
- Architecture
Installation
Publish the configuration:
Run migrations (for persistent memory and document storage):
Configuration
Add the following to your .env file based on the providers you use:
LLM Providers
Embedding Providers
Vector Databases
All vector database methods accept a collection name as the first argument. If omitted or null, the driver falls back to the per-driver collection config, then to AI_DEFAULT_VECTOR_COLLECTION, then to 'default':
Temperature & Generation Settings
Configure temperature, max tokens, and timeout per provider:
Override temperature at runtime:
System Instructions
Cross-driver support for system prompts. Pass a message with role: 'system':
The driver automatically handles the provider-specific format:
| Driver | API Field |
|---|---|
| OpenAI | messages[].role = system (native) |
| Anthropic | Top-level system field |
| Gemini | systemInstruction field |
| Cohere | preamble field |
| Ollama | messages[].role = system (native) |
| Grok | messages[].role = system (native) |
| Mistral | messages[].role = system (native) |
Embedding Dimensions
Control embedding output dimensions to ensure compatibility with your vector database:
RAG Configuration
Cache & Rate Limiting
Quick Start
Chat Completion
Streaming Chat
Embeddings
Batch embed:
Vector Search
LLM Providers
Use the Neuro::llm() method to access the LLM manager directly:
Supported Providers
| Provider | Driver Key | Chat | Stream | Tools | Config Key |
|---|---|---|---|---|---|
| OpenAI | openai |
✅ | ✅ | ✅ | ai.llm.openai |
| Anthropic | anthropic |
✅ | ✅ | ✅ | ai.llm.anthropic |
| Google Gemini | gemini |
✅ | ✅ | ❌ | ai.llm.gemini |
| Ollama | ollama |
✅ | ✅ | ✅ | ai.llm.ollama |
| xAI Grok | grok |
✅ | ✅ | ✅ | ai.llm.grok |
| Mistral | mistral |
✅ | ✅ | ✅ | ai.llm.mistral |
| Cohere | cohere |
✅ | ✅ | ✅ | ai.llm.cohere |
Tool Calling
Custom Ollama Setup
Ollama runs locally with no API key required:
Embedding Providers
| Provider | Driver Key | Default Dimensions | Config Key |
|---|---|---|---|
| OpenAI | openai |
1536 | ai.embedding.openai |
| Ollama | ollama |
4096 | ai.embedding.ollama |
| Gemini | gemini |
768 | ai.embedding.gemini |
| Mistral | mistral |
1024 | ai.embedding.mistral |
| Cohere | cohere |
1024 | ai.embedding.cohere |
Override dimensions via .env to match your vector database:
Vector Databases
Supported Databases
| Database | Driver Key | Create | Upsert | Search | Delete | Filter | Config Key |
|---|---|---|---|---|---|---|---|
| Qdrant | qdrant |
✅ | ✅ | ✅ | ✅ | ✅ | ai.vector.qdrant |
| Pinecone | pinecone |
❌ | ✅ | ✅ | ✅ | ✅ | ai.vector.pinecone |
| pgvector | pgvector |
✅ | ✅ | ✅ | ✅ | ✅ | ai.vector.pgvector |
| Weaviate | weaviate |
✅ | ✅ | ✅ | ✅ | ✅ | ai.vector.weaviate |
| Milvus | milvus |
✅ | ✅ | ✅ | ✅ | ✅ | ai.vector.milvus |
| Chroma | chroma |
✅ | ✅ | ✅ | ✅ | ✅ | ai.vector.chroma |
Basic Usage
pgvector Setup
Qdrant Setup
RAG Pipeline
The RAG (Retrieval Augmented Generation) pipeline retrieves relevant context from a vector store and uses it to answer questions.
Basic RAG
Using the Pipeline Directly
The RAG Flow
Agents & Tool Calling
Creating an Agent
Registering Tools via Manager
Memory
Available Drivers
| Driver | Key | Storage | Description |
|---|---|---|---|
| Session | session |
Laravel session | Per-request/session memory |
| Conversation | conversation |
In-memory | Runtime conversation history |
| Persistent | persistent |
Database | Long-term persistent storage |
Usage
Persistent Memory
Image Generation
OpenAI DALL-E
Edit Image
Variations
Speech Processing
Text-to-Speech
Speech-to-Text
Document Ingestion & Chunking
Supported Formats
| Format | Auto-detected |
|---|---|
.txt |
✅ |
.md |
✅ |
.html |
✅ |
.csv |
✅ |
.json |
✅ |
Ingest a Document
Ingest Raw Content
Chunking Strategies
| Strategy | Class | Description |
|---|---|---|
| Fixed Size | FixedSizeChunking |
Split by character count with overlap |
| Recursive | RecursiveChunking |
Split by paragraphs → sentences → chars |
| Semantic | SemanticChunking |
Split by headings and blank lines |
| Sliding Window | SlidingWindowChunking |
Overlapping windows with stride |
Full Ingestion Pipeline
Testing
Fake Responses
Fake Embeddings
Events & Observability
Events
| Event | Description | Payload |
|---|---|---|
MessageSending |
Before an LLM call is made | provider, model, messages, options |
MessageReceived |
After an LLM response | provider, model, response, latency |
EmbeddingCreated |
After embedding is generated | provider, model, text, dimensions |
VectorStored |
After vectors are upserted | provider, collection, record_count |
DocumentIndexed |
After a document is indexed | collection, document, chunk_count |
Observability Configuration
Architecture
Extending with Custom Drivers
You can register custom drivers at runtime:
Then add the corresponding config to config/neuro.php and use it:
License
The MIT License (MIT). See LICENSE for more information.
All versions of neuro with dependencies
laravel/framework Version ^11.0|^12.0|^13.0|^14.0
guzzlehttp/guzzle Version ^7.0
ext-json Version *
ext-pdo Version *