llama-index-storage-kvstore-postgres
llama-index kvstore postgres integration
What it is and what it does
This package is a storage adapter that connects LlamaIndex to PostgreSQL, allowing you to persist key-value data (such as indexed documents and embeddings) in a relational database instead of memory or local files. It bridges LlamaIndex's kvstore abstraction layer with PostgreSQL, using asyncpg for async operations and psycopg2-binary for synchronous access.
Typically used when building LlamaIndex applications that need durable, queryable storage across application restarts or when sharing indexed data across multiple processes. The package handles the schema and connection logic, so you interact with it through LlamaIndex's standard kvstore interface rather than writing SQL directly.
Use it for:
- Store and retrieve embeddings and indexed documents in PostgreSQL for production LlamaIndex applications
- Share indexed data across multiple LlamaIndex workers or services via a central PostgreSQL database
- Persist LlamaIndex caches and metadata durably across application restarts without rebuilding indexes
- Integrate LlamaIndex with existing PostgreSQL infrastructure in enterprise environments
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a PostgreSQL-backed key-value store integration for LlamaIndex, enabling persistent storage of indexed data and embeddings using a relational database backend.
Yes, if you are building a LlamaIndex application that requires persistent storage and already use or plan to use PostgreSQL. The low install friction, permissive license, and active maintenance make it a straightforward choice for that use case. Not necessary if you are prototyping with in-memory storage or using a different kvstore backend.
Install
llama-index-storage-kvstore-postgres on PyPI
pip
pip install llama-index-storage-kvstore-postgresuv
uv add llama-index-storage-kvstore-postgrespoetry
poetry add llama-index-storage-kvstore-postgresInstalling llama-index-storage-kvstore-postgres
Before you install
Low install friction with three straightforward runtime dependencies. Active maintenance status as of March 2026, though repository metadata is not publicly available for independent verification.
License in practice
MIT license permits commercial and private use with minimal restrictions; suitable for most deployment contexts.
Quickstart
pip install llama-index-storage-kvstore-postgres
from llama_index.storage.kvstore.postgres import PostgresKVStore
kvstore = PostgresKVStore.from_connection_string(
"postgresql://user:password@localhost/dbname"
)
Requires Python 3.10 or later; PostgreSQL server must be accessible at connection time.
Verify before relying
- Whether this package is actively maintained by LlamaIndex maintainers or the broader community
- Performance characteristics and scalability limits for large-scale kvstore operations
- Whether asyncpg and psycopg2-binary can coexist without conflicts in the same environment
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — asyncpg, llama-index-core, psycopg2-binary |
| Maintenance | actively maintained — 155 days since the last release |
| First released | |
| Downloads | 151,031/month — #10,946 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: llama_index_storage_kvstore_postgres-0.5.0-py3-none-any.whl
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
llama-index-storage-docstore-postgresProvides a Postgres-backed document store…
permissive · top 15,000 on PyPI
tentaclio-postgresBundles PostgreSQL connectivity and schema…
permissive · top 15,000 on PyPI
llama-index-vector-stores-chromaIntegrates Chroma vector database with…
permissive · top 15,000 on PyPI
llama-index-vector-stores-redisIntegrates Redis as a vector store backend for…
permissive · top 15,000 on PyPI
llama-index-vector-stores-lancedbIntegrates LanceDB as a vector store backend…
permissive · top 15,000 on PyPI
llama-index-vector-stores-qdrantIntegrates Qdrant vector database with…
permissive · top 15,000 on PyPI
llama-index-vector-stores-milvusIntegrates the Milvus vector database with…
permissive · top 15,000 on PyPI
llama-index-embeddings-langchainIntegrates Langchain embedding models with…
permissive · top 15,000 on PyPI
beam-nuggetsProvides Apache Beam transforms for reading and…
permissive · top 15,000 on PyPI
pipestatPipestat provides a standard API for reporting,…
permissive · top 15,000 on PyPI