agenticgraph / vector
Laravel-native vector retrieval for AgenticGraph workflows.
Requires
- php: ^8.3
- illuminate/contracts: ^12.61.1 || ^13.12.0
- illuminate/database: ^12.61.1 || ^13.12.0
- illuminate/http: ^12.61.1 || ^13.12.0
- illuminate/support: ^12.61.1 || ^13.12.0
- prism-php/prism: ^0.102.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^3.9.3
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.9.2
- orchestra/testbench: ^10.0|^11.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.1
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- spatie/laravel-ray: ^1.43.6
Suggests
- agenticgraph/agenticgraph: Optional: enables automatic tracing of vector operations when used inside AgenticGraph nodes.
- phpunit/phpunit: Required (directly or through Pest) to run AgenticGraph\Vector\Testing\StoreConformanceTests against a store.
Provides
None
Conflicts
None
Replaces
None
README
Pre-1.0: minor versions may contain breaking changes. Read CHANGELOG.md before you upgrade.
Laravel-native vector retrieval: store documents, embed text, run similarity search, and work with structured results. Standalone-first with optional soft integration into AgenticGraph tracing when retrieval runs inside graph nodes. This is not a RAG framework; RAG is a pattern you build on the primitives.
Repository: github.com/shahzad-io/agenticgraph-vector
Full documentation: agenticgraph.dev/docs/vector-overview
Requirements
- PHP 8.3+
- Laravel 12.61.1+ or 13.12+
- PostgreSQL with the pgvector extension (typically a separate connection from your primary database)
Compatibility
The three packages are released together:
| Package | Version | Works with |
|---|---|---|
agenticgraph/agenticgraph (core) |
0.2.x | PHP 8.3+, Laravel 12.61.1+ or 13.12+, Prism 0.102 |
agenticgraph/vector |
0.1.x | PHP 8.3+, Laravel 12.61.1+ or 13.12+, Prism 0.102, PostgreSQL with pgvector (0.8+ for iterative scan). Core 0.2.x is optional (tracing) |
@agenticgraph/stream-client, @agenticgraph/stream-react, @agenticgraph/stream-vue |
0.1.x | Core 0.2.x on the server (stream wire contract v1.1), Node.js 18+, React 18+ or Vue 3.4+ for the adapters |
Installation
composer require agenticgraph/vector
Define a pgvector connection in config/database.php, then set:
VECTOR_DB_CONNECTION=pgvector OPENAI_API_KEY=your-key
See the installation guide for details.
AI assistants
Run php artisan boost:install and select the AgenticGraph skills, so your coding assistant knows how to ingest and search with this package.
Quick example
use AgenticGraph\Vector\Facades\Vector; use AgenticGraph\Vector\ValueObjects\CollectionDefinition; use AgenticGraph\Vector\ValueObjects\Document; $dimensions = \AgenticGraph\Vector\Facades\Embeddings::using('prism')->dimensions(); Vector::store('pgvector')->createCollection( new CollectionDefinition('articles', dimensions: $dimensions), ); Vector::store('pgvector') ->collection('articles') ->upsert([ Document::make('doc-1', 'Laravel queue workers process Redis-backed background jobs.', [ 'category' => 'laravel', ]), ]); $results = Vector::store('pgvector') ->collection('articles') ->similarTo('How do Laravel queue workers use Redis?') ->take(5) ->get(); $results->first()?->id; // 'doc-1' $results->toContext(); // concatenated content for your LLM layer
Optional AgenticGraph integration
composer require agenticgraph/agenticgraph
Vector operations inside graph nodes nest as vector spans in AgenticGraph traces. The package works fully without AgenticGraph.
License
The MIT License (MIT). See LICENSE.md for details.
Started from spatie/package-skeleton-laravel.