$npx skillfedfor your agent

llama-index-vector-stores-postgres

llama-index vector_stores postgres integration

With conditionsPyPI DatabaseReleased Mar 2026527.8K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — llama_index_vector_stores_postgres-0.8.1-py3-none-any.whl
v0.8.1 · released 2026-03-13 · Python <4.0,>=3.10 · 5 runtime deps: asyncpg, llama-index-core, pgvector, psycopg2-binary, sqlalchemy

Yes, if you are building a LlamaIndex application and have PostgreSQL with pgvector already available. The package is actively maintained, has no known vulnerabilities, and low install friction. It is most valuable when you want to avoid adding a separate vector database and can leverage existing Postgres infrastructure. Not necessary if you prefer a dedicated vector store or do not use LlamaIndex.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires a running PostgreSQL instance with pgvector extension installed and configured.
  • Low install friction with a pure-Python wheel and five runtime dependencies.
  • Actively maintained as of 2026-03-13, with current Python support (3.10+).

License · maintenance · safety

MIT (permissive) — MIT license permits commercial and private use with minimal restrictions—suitable for most projects.

last release 2026-03-13 (154 days)

0 known vulnerabilities (OSV.dev, 2026-08-14) · 527,763 downloads/mo, #6,169 on PyPI

Verify before relying

pip install llama-index-vector-stores-postgres

from llama_index.vector_stores.postgres import PGVectorStore

vector_store = PGVectorStore.from_params(
    database="your_database",
    host="localhost",
    password="your_password",
    port="5432",
    user="your_user",
    table_name="your_table",
    embed_dim=1536,
)
  • Performance characteristics and scalability limits for large embedding collections.
  • Specific version compatibility matrix between llama-index-core and this integration.
  • Whether MMR query mode requires additional dependencies or configuration beyond pgvector.
Same gist for agents: .md · .json

What it is and what it does

This package bridges LlamaIndex and PostgreSQL by providing a vector store adapter that leverages the pgvector extension for storing and querying embeddings. It wraps the underlying database operations (via sqlalchemy, psycopg2-binary, and asyncpg) into a LlamaIndex-compatible interface, letting you use PostgreSQL as your embedding backend instead of a specialized vector database.

The integration supports five query modes: DEFAULT (standard similarity), HYBRID (dense + sparse), SPARSE (BM25 text), TEXT_SEARCH (full-text), and MMR (maximal marginal relevance for diverse results). You configure it by pointing to a PostgreSQL database and table, specifying embedding dimension, and then instantiate a PGVectorStore object that integrates directly with LlamaIndex's index and query engine APIs.

Use it for

  • Store and retrieve embeddings from PostgreSQL when you already have Postgres infrastructure and want to avoid a separate vector database.
  • Implement hybrid search combining dense vector similarity with sparse BM25 text retrieval on the same dataset.
  • Use MMR queries to retrieve diverse, relevant results—useful for summarization or multi-faceted information retrieval.
  • Build full-text search on embeddings using PostgreSQL's native text search capabilities alongside vector operations.
  • Integrate vector search into existing LlamaIndex applications that already use Postgres for other data.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you are building a LlamaIndex application and have PostgreSQL with pgvector already available.

The package is actively maintained, has no known vulnerabilities, and low install friction. It is most valuable when you want to avoid adding a separate vector database and can leverage existing Postgres infrastructure. Not necessary if you prefer a dedicated vector store or do not use LlamaIndex.

Install

llama-index-vector-stores-postgres on PyPI

Before you install

Low install friction with a pure-Python wheel and five runtime dependencies. Actively maintained as of 2026-03-13, with current Python support (3.10+). No known vulnerabilities.

Requires a running PostgreSQL instance with pgvector extension installed and configured.

License in practice

MIT license permits commercial and private use with minimal restrictions—suitable for most projects.

Quickstart

pip install llama-index-vector-stores-postgres

from llama_index.vector_stores.postgres import PGVectorStore

vector_store = PGVectorStore.from_params(
    database="your_database",
    host="localhost",
    password="your_password",
    port="5432",
    user="your_user",
    table_name="your_table",
    embed_dim=1536,
)

Verify before relying

  • Performance characteristics and scalability limits for large embedding collections.
  • Specific version compatibility matrix between llama-index-core and this integration.
  • Whether MMR query mode requires additional dependencies or configuration beyond pgvector.

Package facts

LicenseMIT permissive
Python supportSupports the current Python release <4.0,>=3.10
Install frictionLow. Pure-Python wheel
Runtime dependencies
5 packages
asyncpgllama-index-corepgvectorpsycopg2-binarysqlalchemy
MaintenanceActively maintained 154 days since the last release
First released
Downloads527,763 / month, #6,169 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14

Evidence: llama_index_vector_stores_postgres-0.8.1-py3-none-any.whl

Tags

Capabilities
postgres vector storepgvector llama indexpostgresql embedding storagevector database postgressemantic search postgreshybrid retrieval postgresmmr search postgres
Topics
vector-searchembeddingspostgres-integration

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “postgres vector store”

Give your agent the search over MCP, or paste the wish link into any chat.

More Database packages

psycopg2-binary Worth it
PyPI · Software Development · released Apr 2026

psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.

copyleftcompiled wheel · 3.9+
271.6Mdownloads / mo
redis Worth it
PyPI · Database · released Jul 2026

Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.

Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.

MITpure Python · 3.10+
268.3Mdownloads / mo
ydb Worth it
PyPI · Database · released Jul 2026

YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.

Install it if you need to connect Python applications to YDB databases.

permissive licensepure Python · 3.10+
210.0Mdownloads / mo
snowflake-connector-python Worth it
PyPI · Software Development · released Aug 2026

Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.

Apache-2.0compiled wheel · 3.10+
193.6Mdownloads / mo
sqlparse Worth it
PyPI · Software Development · released Aug 2026

sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.

Install it if you need to manipulate, format, or analyze SQL text programmatically.

BSD-3-Clausepure Python · 3.10+
148.9Mdownloads / mo
dbt-adapters With conditions
PyPI · Database · released Jul 2026

Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.

Apache-2.0pure Python · 3.10.0+
121.3Mdownloads / mo

See also llama-index-vector-stores-redis · llama-index-vector-stores-faiss · vecs · langchain-postgres · llama-index-vector-stores-qdrant · llama-index-vector-stores-chroma · llama-index-retrievers-bm25 · llama-index-vector-stores-milvus · pgserver · sqlite-vec