Download the PHP package ankane/pgvector without Composer
On this page you can find all versions of the php package ankane/pgvector. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package pgvector
pgvector-php
pgvector support for PHP
Supports Laravel, Doctrine, and PgSql
Getting Started
Follow the instructions for your database library:
- Laravel
- Doctrine
- PgSql
Or check out some examples:
- Embeddings with OpenAI
- Binary embeddings with Cohere
- Hybrid search with Ollama (Reciprocal Rank Fusion)
- Sparse search with Text Embeddings Inference
- Morgan fingerprints with RDKit
- Recommendations with Disco
- Horizontal scaling with Citus
- Bulk loading with
COPY
Laravel
Install the package
Enable the extension
You can now use the vector
type in future migrations
Update your model
Insert a vector
Get the nearest neighbors to a record
Also supports InnerProduct
, Cosine
, L1
, Hamming
, and Jaccard
distance
Get the nearest neighbors to a vector
Get the distances
Add an approximate index in a migration
Use vector_ip_ops
for inner product and vector_cosine_ops
for cosine distance
Doctrine
Install the package
Register the types and distance functions
Enable the extension
Update your model
Insert a vector
Get the nearest neighbors to a vector
Also supports max_inner_product
, cosine_distance
, l1_distance
, hamming_distance
, and jaccard_distance
PgSql
Enable the extension
Create a table
Insert a vector
Get the nearest neighbors to a vector
Add an approximate index
See a full example
Upgrading
0.1.4
The package name was changed from ankane/pgvector
to pgvector/pgvector
. Update it in composer.json
to remove the message.
History
View the changelog
Contributing
Everyone is encouraged to help improve this project. Here are a few ways you can help:
- Report bugs
- Fix bugs and submit pull requests
- Write, clarify, or fix documentation
- Suggest or add new features
To get started with development:
To run an example: