pgvector 0.3.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. pgvector-0.3.5/LICENSE.txt +21 -0
  2. pgvector-0.3.5/PKG-INFO +554 -0
  3. pgvector-0.3.5/README.md +542 -0
  4. pgvector-0.3.5/pgvector/asyncpg/__init__.py +9 -0
  5. pgvector-0.3.5/pgvector/asyncpg/register.py +31 -0
  6. pgvector-0.3.5/pgvector/django/__init__.py +26 -0
  7. pgvector-0.3.5/pgvector/django/bit.py +32 -0
  8. pgvector-0.3.5/pgvector/django/extensions.py +6 -0
  9. pgvector-0.3.5/pgvector/django/functions.py +55 -0
  10. pgvector-0.3.5/pgvector/django/halfvec.py +60 -0
  11. pgvector-0.3.5/pgvector/django/indexes.py +46 -0
  12. pgvector-0.3.5/pgvector/django/sparsevec.py +55 -0
  13. pgvector-0.3.5/pgvector/django/vector.py +73 -0
  14. pgvector-0.3.5/pgvector/peewee/__init__.py +14 -0
  15. pgvector-0.3.5/pgvector/peewee/bit.py +21 -0
  16. pgvector-0.3.5/pgvector/peewee/halfvec.py +34 -0
  17. pgvector-0.3.5/pgvector/peewee/sparsevec.py +34 -0
  18. pgvector-0.3.5/pgvector/peewee/vector.py +34 -0
  19. pgvector-0.3.5/pgvector/psycopg/__init__.py +11 -0
  20. pgvector-0.3.5/pgvector/psycopg/bit.py +31 -0
  21. pgvector-0.3.5/pgvector/psycopg/halfvec.py +53 -0
  22. pgvector-0.3.5/pgvector/psycopg/register.py +37 -0
  23. pgvector-0.3.5/pgvector/psycopg/sparsevec.py +53 -0
  24. pgvector-0.3.5/pgvector/psycopg/vector.py +58 -0
  25. pgvector-0.3.5/pgvector/psycopg2/__init__.py +8 -0
  26. pgvector-0.3.5/pgvector/psycopg2/halfvec.py +20 -0
  27. pgvector-0.3.5/pgvector/psycopg2/register.py +28 -0
  28. pgvector-0.3.5/pgvector/psycopg2/sparsevec.py +20 -0
  29. pgvector-0.3.5/pgvector/psycopg2/vector.py +21 -0
  30. pgvector-0.3.5/pgvector/sqlalchemy/__init__.py +19 -0
  31. pgvector-0.3.5/pgvector/sqlalchemy/bit.py +26 -0
  32. pgvector-0.3.5/pgvector/sqlalchemy/functions.py +14 -0
  33. pgvector-0.3.5/pgvector/sqlalchemy/halfvec.py +51 -0
  34. pgvector-0.3.5/pgvector/sqlalchemy/sparsevec.py +51 -0
  35. pgvector-0.3.5/pgvector/sqlalchemy/vector.py +51 -0
  36. pgvector-0.3.5/pgvector/utils/__init__.py +11 -0
  37. pgvector-0.3.5/pgvector/utils/bit.py +61 -0
  38. pgvector-0.3.5/pgvector/utils/halfvec.py +78 -0
  39. pgvector-0.3.5/pgvector/utils/sparsevec.py +156 -0
  40. pgvector-0.3.5/pgvector/utils/vector.py +78 -0
  41. pgvector-0.3.5/pgvector.egg-info/PKG-INFO +554 -0
  42. pgvector-0.3.5/pgvector.egg-info/SOURCES.txt +56 -0
  43. pgvector-0.3.5/pgvector.egg-info/dependency_links.txt +1 -0
  44. pgvector-0.3.5/pgvector.egg-info/requires.txt +1 -0
  45. pgvector-0.3.5/pgvector.egg-info/top_level.txt +1 -0
  46. pgvector-0.3.5/pyproject.toml +24 -0
  47. pgvector-0.3.5/setup.cfg +4 -0
  48. pgvector-0.3.5/tests/test_asyncpg.py +115 -0
  49. pgvector-0.3.5/tests/test_bit.py +39 -0
  50. pgvector-0.3.5/tests/test_django.py +435 -0
  51. pgvector-0.3.5/tests/test_half_vector.py +42 -0
  52. pgvector-0.3.5/tests/test_peewee.py +201 -0
  53. pgvector-0.3.5/tests/test_psycopg.py +197 -0
  54. pgvector-0.3.5/tests/test_psycopg2.py +69 -0
  55. pgvector-0.3.5/tests/test_sparse_vector.py +69 -0
  56. pgvector-0.3.5/tests/test_sqlalchemy.py +438 -0
  57. pgvector-0.3.5/tests/test_sqlmodel.py +239 -0
  58. pgvector-0.3.5/tests/test_vector.py +42 -0
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021-2024 Andrew Kane
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,554 @@
1
+ Metadata-Version: 2.1
2
+ Name: pgvector
3
+ Version: 0.3.5
4
+ Summary: pgvector support for Python
5
+ Author-email: Andrew Kane <andrew@ankane.org>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/pgvector/pgvector-python
8
+ Requires-Python: >=3.8
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE.txt
11
+ Requires-Dist: numpy
12
+
13
+ # pgvector-python
14
+
15
+ [pgvector](https://github.com/pgvector/pgvector) support for Python
16
+
17
+ Supports [Django](https://github.com/django/django), [SQLAlchemy](https://github.com/sqlalchemy/sqlalchemy), [SQLModel](https://github.com/tiangolo/sqlmodel), [Psycopg 3](https://github.com/psycopg/psycopg), [Psycopg 2](https://github.com/psycopg/psycopg2), [asyncpg](https://github.com/MagicStack/asyncpg), and [Peewee](https://github.com/coleifer/peewee)
18
+
19
+ [![Build Status](https://github.com/pgvector/pgvector-python/actions/workflows/build.yml/badge.svg)](https://github.com/pgvector/pgvector-python/actions)
20
+
21
+ ## Installation
22
+
23
+ Run:
24
+
25
+ ```sh
26
+ pip install pgvector
27
+ ```
28
+
29
+ And follow the instructions for your database library:
30
+
31
+ - [Django](#django)
32
+ - [SQLAlchemy](#sqlalchemy)
33
+ - [SQLModel](#sqlmodel)
34
+ - [Psycopg 3](#psycopg-3)
35
+ - [Psycopg 2](#psycopg-2)
36
+ - [asyncpg](#asyncpg)
37
+ - [Peewee](#peewee)
38
+
39
+ Or check out some examples:
40
+
41
+ - [Embeddings](https://github.com/pgvector/pgvector-python/blob/master/examples/openai/example.py) with OpenAI
42
+ - [Binary embeddings](https://github.com/pgvector/pgvector-python/blob/master/examples/cohere/example.py) with Cohere
43
+ - [Sentence embeddings](https://github.com/pgvector/pgvector-python/blob/master/examples/sentence_transformers/example.py) with SentenceTransformers
44
+ - [Hybrid search](https://github.com/pgvector/pgvector-python/blob/master/examples/hybrid_search/rrf.py) with SentenceTransformers (Reciprocal Rank Fusion)
45
+ - [Hybrid search](https://github.com/pgvector/pgvector-python/blob/master/examples/hybrid_search/cross_encoder.py) with SentenceTransformers (cross-encoder)
46
+ - [Sparse search](https://github.com/pgvector/pgvector-python/blob/master/examples/sparse_search/example.py) with Transformers
47
+ - [Late interaction search](https://github.com/pgvector/pgvector-python/blob/master/examples/colbert/exact.py) with ColBERT
48
+ - [Image search](https://github.com/pgvector/pgvector-python/blob/master/examples/image_search/example.py) with PyTorch
49
+ - [Image search](https://github.com/pgvector/pgvector-python/blob/master/examples/imagehash/example.py) with perceptual hashing
50
+ - [Morgan fingerprints](https://github.com/pgvector/pgvector-python/blob/master/examples/rdkit/example.py) with RDKit
51
+ - [Topic modeling](https://github.com/pgvector/pgvector-python/blob/master/examples/gensim/example.py) with Gensim
52
+ - [Implicit feedback recommendations](https://github.com/pgvector/pgvector-python/blob/master/examples/implicit/example.py) with Implicit
53
+ - [Explicit feedback recommendations](https://github.com/pgvector/pgvector-python/blob/master/examples/surprise/example.py) with Surprise
54
+ - [Recommendations](https://github.com/pgvector/pgvector-python/blob/master/examples/lightfm/example.py) with LightFM
55
+ - [Horizontal scaling](https://github.com/pgvector/pgvector-python/blob/master/examples/citus/example.py) with Citus
56
+ - [Bulk loading](https://github.com/pgvector/pgvector-python/blob/master/examples/loading/example.py) with `COPY`
57
+
58
+ ## Django
59
+
60
+ Create a migration to enable the extension
61
+
62
+ ```python
63
+ from pgvector.django import VectorExtension
64
+
65
+ class Migration(migrations.Migration):
66
+ operations = [
67
+ VectorExtension()
68
+ ]
69
+ ```
70
+
71
+ Add a vector field to your model
72
+
73
+ ```python
74
+ from pgvector.django import VectorField
75
+
76
+ class Item(models.Model):
77
+ embedding = VectorField(dimensions=3)
78
+ ```
79
+
80
+ Also supports `HalfVectorField`, `BitField`, and `SparseVectorField`
81
+
82
+ Insert a vector
83
+
84
+ ```python
85
+ item = Item(embedding=[1, 2, 3])
86
+ item.save()
87
+ ```
88
+
89
+ Get the nearest neighbors to a vector
90
+
91
+ ```python
92
+ from pgvector.django import L2Distance
93
+
94
+ Item.objects.order_by(L2Distance('embedding', [3, 1, 2]))[:5]
95
+ ```
96
+
97
+ Also supports `MaxInnerProduct`, `CosineDistance`, `L1Distance`, `HammingDistance`, and `JaccardDistance`
98
+
99
+ Get the distance
100
+
101
+ ```python
102
+ Item.objects.annotate(distance=L2Distance('embedding', [3, 1, 2]))
103
+ ```
104
+
105
+ Get items within a certain distance
106
+
107
+ ```python
108
+ Item.objects.alias(distance=L2Distance('embedding', [3, 1, 2])).filter(distance__lt=5)
109
+ ```
110
+
111
+ Average vectors
112
+
113
+ ```python
114
+ from django.db.models import Avg
115
+
116
+ Item.objects.aggregate(Avg('embedding'))
117
+ ```
118
+
119
+ Also supports `Sum`
120
+
121
+ Add an approximate index
122
+
123
+ ```python
124
+ from pgvector.django import HnswIndex, IvfflatIndex
125
+
126
+ class Item(models.Model):
127
+ class Meta:
128
+ indexes = [
129
+ HnswIndex(
130
+ name='my_index',
131
+ fields=['embedding'],
132
+ m=16,
133
+ ef_construction=64,
134
+ opclasses=['vector_l2_ops']
135
+ ),
136
+ # or
137
+ IvfflatIndex(
138
+ name='my_index',
139
+ fields=['embedding'],
140
+ lists=100,
141
+ opclasses=['vector_l2_ops']
142
+ )
143
+ ]
144
+ ```
145
+
146
+ Use `vector_ip_ops` for inner product and `vector_cosine_ops` for cosine distance
147
+
148
+ ## SQLAlchemy
149
+
150
+ Enable the extension
151
+
152
+ ```python
153
+ session.execute(text('CREATE EXTENSION IF NOT EXISTS vector'))
154
+ ```
155
+
156
+ Add a vector column
157
+
158
+ ```python
159
+ from pgvector.sqlalchemy import Vector
160
+
161
+ class Item(Base):
162
+ embedding = mapped_column(Vector(3))
163
+ ```
164
+
165
+ Also supports `HALFVEC`, `BIT`, and `SPARSEVEC`
166
+
167
+ Insert a vector
168
+
169
+ ```python
170
+ item = Item(embedding=[1, 2, 3])
171
+ session.add(item)
172
+ session.commit()
173
+ ```
174
+
175
+ Get the nearest neighbors to a vector
176
+
177
+ ```python
178
+ session.scalars(select(Item).order_by(Item.embedding.l2_distance([3, 1, 2])).limit(5))
179
+ ```
180
+
181
+ Also supports `max_inner_product`, `cosine_distance`, `l1_distance`, `hamming_distance`, and `jaccard_distance`
182
+
183
+ Get the distance
184
+
185
+ ```python
186
+ session.scalars(select(Item.embedding.l2_distance([3, 1, 2])))
187
+ ```
188
+
189
+ Get items within a certain distance
190
+
191
+ ```python
192
+ session.scalars(select(Item).filter(Item.embedding.l2_distance([3, 1, 2]) < 5))
193
+ ```
194
+
195
+ Average vectors
196
+
197
+ ```python
198
+ from pgvector.sqlalchemy import avg
199
+
200
+ session.scalars(select(func.avg(Item.embedding))).first()
201
+ ```
202
+
203
+ Also supports `sum`
204
+
205
+ Add an approximate index
206
+
207
+ ```python
208
+ index = Index(
209
+ 'my_index',
210
+ Item.embedding,
211
+ postgresql_using='hnsw',
212
+ postgresql_with={'m': 16, 'ef_construction': 64},
213
+ postgresql_ops={'embedding': 'vector_l2_ops'}
214
+ )
215
+ # or
216
+ index = Index(
217
+ 'my_index',
218
+ Item.embedding,
219
+ postgresql_using='ivfflat',
220
+ postgresql_with={'lists': 100},
221
+ postgresql_ops={'embedding': 'vector_l2_ops'}
222
+ )
223
+
224
+ index.create(engine)
225
+ ```
226
+
227
+ Use `vector_ip_ops` for inner product and `vector_cosine_ops` for cosine distance
228
+
229
+ ## SQLModel
230
+
231
+ Enable the extension
232
+
233
+ ```python
234
+ session.exec(text('CREATE EXTENSION IF NOT EXISTS vector'))
235
+ ```
236
+
237
+ Add a vector column
238
+
239
+ ```python
240
+ from pgvector.sqlalchemy import Vector
241
+ from sqlalchemy import Column
242
+
243
+ class Item(SQLModel, table=True):
244
+ embedding: Any = Field(sa_column=Column(Vector(3)))
245
+ ```
246
+
247
+ Also supports `HALFVEC`, `BIT`, and `SPARSEVEC`
248
+
249
+ Insert a vector
250
+
251
+ ```python
252
+ item = Item(embedding=[1, 2, 3])
253
+ session.add(item)
254
+ session.commit()
255
+ ```
256
+
257
+ Get the nearest neighbors to a vector
258
+
259
+ ```python
260
+ session.exec(select(Item).order_by(Item.embedding.l2_distance([3, 1, 2])).limit(5))
261
+ ```
262
+
263
+ Also supports `max_inner_product`, `cosine_distance`, `l1_distance`, `hamming_distance`, and `jaccard_distance`
264
+
265
+ Get the distance
266
+
267
+ ```python
268
+ session.exec(select(Item.embedding.l2_distance([3, 1, 2])))
269
+ ```
270
+
271
+ Get items within a certain distance
272
+
273
+ ```python
274
+ session.exec(select(Item).filter(Item.embedding.l2_distance([3, 1, 2]) < 5))
275
+ ```
276
+
277
+ Average vectors
278
+
279
+ ```python
280
+ from pgvector.sqlalchemy import avg
281
+
282
+ session.exec(select(func.avg(Item.embedding))).first()
283
+ ```
284
+
285
+ Also supports `sum`
286
+
287
+ Add an approximate index
288
+
289
+ ```python
290
+ from sqlalchemy import Index
291
+
292
+ index = Index(
293
+ 'my_index',
294
+ Item.embedding,
295
+ postgresql_using='hnsw',
296
+ postgresql_with={'m': 16, 'ef_construction': 64},
297
+ postgresql_ops={'embedding': 'vector_l2_ops'}
298
+ )
299
+ # or
300
+ index = Index(
301
+ 'my_index',
302
+ Item.embedding,
303
+ postgresql_using='ivfflat',
304
+ postgresql_with={'lists': 100},
305
+ postgresql_ops={'embedding': 'vector_l2_ops'}
306
+ )
307
+
308
+ index.create(engine)
309
+ ```
310
+
311
+ Use `vector_ip_ops` for inner product and `vector_cosine_ops` for cosine distance
312
+
313
+ ## Psycopg 3
314
+
315
+ Enable the extension
316
+
317
+ ```python
318
+ conn.execute('CREATE EXTENSION IF NOT EXISTS vector')
319
+ ```
320
+
321
+ Register the vector type with your connection
322
+
323
+ ```python
324
+ from pgvector.psycopg import register_vector
325
+
326
+ register_vector(conn)
327
+ ```
328
+
329
+ For [async connections](https://www.psycopg.org/psycopg3/docs/advanced/async.html), use
330
+
331
+ ```python
332
+ from pgvector.psycopg import register_vector_async
333
+
334
+ await register_vector_async(conn)
335
+ ```
336
+
337
+ Create a table
338
+
339
+ ```python
340
+ conn.execute('CREATE TABLE items (id bigserial PRIMARY KEY, embedding vector(3))')
341
+ ```
342
+
343
+ Insert a vector
344
+
345
+ ```python
346
+ embedding = np.array([1, 2, 3])
347
+ conn.execute('INSERT INTO items (embedding) VALUES (%s)', (embedding,))
348
+ ```
349
+
350
+ Get the nearest neighbors to a vector
351
+
352
+ ```python
353
+ conn.execute('SELECT * FROM items ORDER BY embedding <-> %s LIMIT 5', (embedding,)).fetchall()
354
+ ```
355
+
356
+ Add an approximate index
357
+
358
+ ```python
359
+ conn.execute('CREATE INDEX ON items USING hnsw (embedding vector_l2_ops)')
360
+ # or
361
+ conn.execute('CREATE INDEX ON items USING ivfflat (embedding vector_l2_ops) WITH (lists = 100)')
362
+ ```
363
+
364
+ Use `vector_ip_ops` for inner product and `vector_cosine_ops` for cosine distance
365
+
366
+ ## Psycopg 2
367
+
368
+ Enable the extension
369
+
370
+ ```python
371
+ cur = conn.cursor()
372
+ cur.execute('CREATE EXTENSION IF NOT EXISTS vector')
373
+ ```
374
+
375
+ Register the vector type with your connection or cursor
376
+
377
+ ```python
378
+ from pgvector.psycopg2 import register_vector
379
+
380
+ register_vector(conn)
381
+ ```
382
+
383
+ Create a table
384
+
385
+ ```python
386
+ cur.execute('CREATE TABLE items (id bigserial PRIMARY KEY, embedding vector(3))')
387
+ ```
388
+
389
+ Insert a vector
390
+
391
+ ```python
392
+ embedding = np.array([1, 2, 3])
393
+ cur.execute('INSERT INTO items (embedding) VALUES (%s)', (embedding,))
394
+ ```
395
+
396
+ Get the nearest neighbors to a vector
397
+
398
+ ```python
399
+ cur.execute('SELECT * FROM items ORDER BY embedding <-> %s LIMIT 5', (embedding,))
400
+ cur.fetchall()
401
+ ```
402
+
403
+ Add an approximate index
404
+
405
+ ```python
406
+ cur.execute('CREATE INDEX ON items USING hnsw (embedding vector_l2_ops)')
407
+ # or
408
+ cur.execute('CREATE INDEX ON items USING ivfflat (embedding vector_l2_ops) WITH (lists = 100)')
409
+ ```
410
+
411
+ Use `vector_ip_ops` for inner product and `vector_cosine_ops` for cosine distance
412
+
413
+ ## asyncpg
414
+
415
+ Enable the extension
416
+
417
+ ```python
418
+ await conn.execute('CREATE EXTENSION IF NOT EXISTS vector')
419
+ ```
420
+
421
+ Register the vector type with your connection
422
+
423
+ ```python
424
+ from pgvector.asyncpg import register_vector
425
+
426
+ await register_vector(conn)
427
+ ```
428
+
429
+ or your pool
430
+
431
+ ```python
432
+ async def init(conn):
433
+ await register_vector(conn)
434
+
435
+ pool = await asyncpg.create_pool(..., init=init)
436
+ ```
437
+
438
+ Create a table
439
+
440
+ ```python
441
+ await conn.execute('CREATE TABLE items (id bigserial PRIMARY KEY, embedding vector(3))')
442
+ ```
443
+
444
+ Insert a vector
445
+
446
+ ```python
447
+ embedding = np.array([1, 2, 3])
448
+ await conn.execute('INSERT INTO items (embedding) VALUES ($1)', embedding)
449
+ ```
450
+
451
+ Get the nearest neighbors to a vector
452
+
453
+ ```python
454
+ await conn.fetch('SELECT * FROM items ORDER BY embedding <-> $1 LIMIT 5', embedding)
455
+ ```
456
+
457
+ Add an approximate index
458
+
459
+ ```python
460
+ await conn.execute('CREATE INDEX ON items USING hnsw (embedding vector_l2_ops)')
461
+ # or
462
+ await conn.execute('CREATE INDEX ON items USING ivfflat (embedding vector_l2_ops) WITH (lists = 100)')
463
+ ```
464
+
465
+ Use `vector_ip_ops` for inner product and `vector_cosine_ops` for cosine distance
466
+
467
+ ## Peewee
468
+
469
+ Add a vector column
470
+
471
+ ```python
472
+ from pgvector.peewee import VectorField
473
+
474
+ class Item(BaseModel):
475
+ embedding = VectorField(dimensions=3)
476
+ ```
477
+
478
+ Also supports `HalfVectorField`, `FixedBitField`, and `SparseVectorField`
479
+
480
+ Insert a vector
481
+
482
+ ```python
483
+ item = Item.create(embedding=[1, 2, 3])
484
+ ```
485
+
486
+ Get the nearest neighbors to a vector
487
+
488
+ ```python
489
+ Item.select().order_by(Item.embedding.l2_distance([3, 1, 2])).limit(5)
490
+ ```
491
+
492
+ Also supports `max_inner_product`, `cosine_distance`, `l1_distance`, `hamming_distance`, and `jaccard_distance`
493
+
494
+ Get the distance
495
+
496
+ ```python
497
+ Item.select(Item.embedding.l2_distance([3, 1, 2]).alias('distance'))
498
+ ```
499
+
500
+ Get items within a certain distance
501
+
502
+ ```python
503
+ Item.select().where(Item.embedding.l2_distance([3, 1, 2]) < 5)
504
+ ```
505
+
506
+ Average vectors
507
+
508
+ ```python
509
+ from peewee import fn
510
+
511
+ Item.select(fn.avg(Item.embedding).coerce(True)).scalar()
512
+ ```
513
+
514
+ Also supports `sum`
515
+
516
+ Add an approximate index
517
+
518
+ ```python
519
+ Item.add_index('embedding vector_l2_ops', using='hnsw')
520
+ ```
521
+
522
+ Use `vector_ip_ops` for inner product and `vector_cosine_ops` for cosine distance
523
+
524
+ ## History
525
+
526
+ View the [changelog](https://github.com/pgvector/pgvector-python/blob/master/CHANGELOG.md)
527
+
528
+ ## Contributing
529
+
530
+ Everyone is encouraged to help improve this project. Here are a few ways you can help:
531
+
532
+ - [Report bugs](https://github.com/pgvector/pgvector-python/issues)
533
+ - Fix bugs and [submit pull requests](https://github.com/pgvector/pgvector-python/pulls)
534
+ - Write, clarify, or fix documentation
535
+ - Suggest or add new features
536
+
537
+ To get started with development:
538
+
539
+ ```sh
540
+ git clone https://github.com/pgvector/pgvector-python.git
541
+ cd pgvector-python
542
+ pip install -r requirements.txt
543
+ createdb pgvector_python_test
544
+ pytest
545
+ ```
546
+
547
+ To run an example:
548
+
549
+ ```sh
550
+ cd examples/loading
551
+ pip install -r requirements.txt
552
+ createdb pgvector_example
553
+ python3 example.py
554
+ ```