llama-index-vector-stores-azurepostgresql
Azure PostgreSQL Vector Store integration for LlamaIndex.
This package provides an integration for using Azure Database for PostgreSQL as a vector store backend with LlamaIndex, supporting advanced vector search capabilities (including pgvector, DiskANN, and hybrid search).
Features
- Store and query vector embeddings in Azure PostgreSQL
- Support for pgvector and DiskANN extensions
- Metadata filtering
- Seamless integration with LlamaIndex's core abstractions
Installation
You can install the package and its dependencies using uv, pip, or poetry:
uv pip install .
# or
pip install .
# or
poetry install
Dependencies:
llama-indexpsycopg(PostgreSQL driver)azure-identity(for Azure authentication)
Usage Example
import sys
sys.path.insert(0, "/path/to/llama-index-vector-stores-azurepostgresql")
from llama_index.vector_stores.azurepostgresql.base import AzurePGVectorStore
from llama_index.core import (
SimpleDirectoryReader,
StorageContext,
VectorStoreIndex,
)
from llama_index.llms.azure_openai import AzureOpenAI
from llama_index.embeddings.azure_openai import AzureOpenAIEmbedding
# Set up your Azure OpenAI and PostgreSQL connection details
llm = AzureOpenAI(...)
embed_model = AzureOpenAIEmbedding(...)
vector_store = AzurePGVectorStore.from_params(
database="postgres",
host="<your-host>.postgres.database.azure.com",
port=5432,
table_name="my_table",
embed_dim=1536,
pg_diskann_kwargs={
"pg_diskann_operator_class": "vector_cosine_ops",
"pg_diskann_max_neighbors": 32,
"pg_diskann_l_value_ib": 100,
"pg_diskann_l_value_is": 100,
"pg_diskann_iterative_search": True,
},
)
storage_context = StorageContext.from_defaults(vector_store=vector_store)
documents = SimpleDirectoryReader("./data").load_data()
index = VectorStoreIndex.from_documents(
documents, storage_context=storage_context
)
query_engine = index.as_query_engine()
response = query_engine.query("Your query here")
print(response)
Development
- To run tests:
make test
- To build the package:
uv build
License
This project is licensed under the terms of the Apache 2.0 license.
Metadata
Release files for llama-index-vector-stores-azurepostgres 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| llama_index_vector_stores_azurepostgres-0.3.0.tar.gz | 19.1 kB | Without provenance | Details for llama_index_vector_stores_azurepostgres-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| llama_index_vector_stores_azurepostgres-0.3.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for llama_index_vector_stores_azurepostgres-0.3.0-py2.py3-none-any.whl |
Total release size: 41.4 kB
Release files / llama_index_vector_stores_azurepostgres-0.3.0.tar.gz
| Download URL | llama_index_vector_stores_azurepostgres-0.3.0.tar.gz |
|---|---|
| Size | 19.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
39a371aa19968021b1316ef7582da76825df63db844271cc9db9a103d2690472
|
|
BLAKE2b-256 checksum How to use checksums |
6202e62d95ef6c40d65dafa647a2ecb70e67088d7872b5711ed2f9ca3000efb3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / llama_index_vector_stores_azurepostgres-0.3.0-py2.py3-none-any.whl
| Download URL | llama_index_vector_stores_azurepostgres-0.3.0-py2.py3-none-any.whl |
|---|---|
| Size | 22.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
dde2f4796731743bdc214d2a58af2a83caf1bcb0716e71f554a41697792d6d19
|
|
BLAKE2b-256 checksum How to use checksums |
38c667eec8bd6e69dc3068dc48ab02dca483d473c5c22b8209b9c05651334852
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for llama-index-vector-stores-azurepostgres 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.