adrianmtanase/laravel-vector-store
Composer 安装命令:
composer require adrianmtanase/laravel-vector-store
包简介
Vector store abstraction layer for the Laravel framework.
README 文档
README
This package provides an implementation of multiple vector databases (e.g. Pinecone.io).
Support us
If this helped you, consider supporting my development over on Patreon or on Github.
Installation
Requires PHP ^8.1
composer require adrianmtanase/laravel-vector-store
Currently supports
Plans to implement
- MySql - once it's ready
❗ If you're coming from version 0.0.25 ❗
- Coming from version
0.0.25you'll have to re-publish the config, as the Pinecone environment variable has been replaced withpinecone_host
php artisan vendor:publish
Usage
Using the VectorStore facade, you can easily access any provider and execute operations.
VectorStore::instance() ->namespace('general') ->upsert( PineconeUpsertRequest::build() ->id('1') ->values([ -0.002739503, -0.01970483, -0.011307885, -0.011125952, -0.023119587, 0.0016207852, -0.003981551, -0.029249357, 0.00983842, -0.023721369 ]) ->metadata([ 'text' => 'Vector store is lit!' ]) );
The default provider is Pinecone.io, this can be easily switched using the facade VectorStore::provider(VectorStoreProviderType::PINECONE), or directly in the vector-store config.
Weaviate
As Weaviate runs through GraphQL, the query language is complex. There are several useful methods in WeaviateQueryRequest that will help you query data more efficiently. For example:
VectorStore::provider(VectorStoreProviderType::WEAVIATE) ->instance() ->namespace('general') ->query( WeaviateQueryRequest::build() ->vector([ -0.002739503, -0.01970483, -0.011307885, -0.011125952, -0.023119587, 0.0016207852, -0.003981551, -0.029249357, 0.00983842, -0.023721369 ]) ->properties(['text']) ->withId() ->withParameters(WeaviateQueryParameters::build()->group('type: closest, force: 1')) );
As the system is complex, the package also supports a rawQuery form, or even getting access to the underlying client.
Weaviate raw query
VectorStore::provider(VectorStoreProviderType::WEAVIATE) ->instance() ->namespace('general') ->rawQuery(' { Get { General(nearVector: { vector: [ -0.002739503, -0.01970483, -0.011307885, -0.011125952, -0.023119587, 0.0016207852, -0.003981551, -0.029249357, 0.00983842, -0.023721369 ] }) { text } } } ');
Underlying Weaviate client
VectorStore::provider(VectorStoreProviderType::WEAVIATE) ->instance() ->client() ->batchDelete('general')
adrianmtanase/laravel-vector-store 适用场景与选型建议
adrianmtanase/laravel-vector-store 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 75 次下载、GitHub Stars 达 6, 最近一次更新时间为 2023 年 12 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「store」 「laravel」 「vector」 「ai」 「weaviate」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 adrianmtanase/laravel-vector-store 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 adrianmtanase/laravel-vector-store 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 adrianmtanase/laravel-vector-store 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Admin Hub for GetCandy. A modern headless e-commerce solution for Laravel PHP framework.
Simple php store locator based on a googlesheet with gsx api
Alfabank REST API integration
Singleton containers for storing and retrieving arbitrary data keeping the state until the end of the run.
Provides an interface for controlling and manipulating data for different kind of databases.
PHP Library Key Value Store
统计信息
- 总下载量: 75
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 18
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-12-23
