llama-index-storage-docstore-postgres
llama-index docstore postgres integration
What it is and what it does
This package integrates Postgres as a persistent backend for LlamaIndex's document store, allowing you to store and retrieve documents outside of memory. It sits between your LlamaIndex application and a Postgres database, handling the serialization and query logic needed to persist documents across sessions.
You use it by configuring it as the docstore backend in a LlamaIndex application. It depends on llama-index-core for the core framework and llama-index-storage-kvstore-postgres for the underlying key-value storage layer that manages the actual Postgres connection and operations.
Use it for:
- Store documents indexed by LlamaIndex in a persistent Postgres database for long-running applications
- Build RAG systems that need to retain document collections across application restarts
- Share a common document store across multiple LlamaIndex instances via a shared Postgres backend
- Integrate LlamaIndex document management with existing Postgres-based infrastructure
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a Postgres-backed document store integration for LlamaIndex, enabling persistent storage and retrieval of documents within LlamaIndex applications.
Yes, if you are building a LlamaIndex application that needs persistent document storage and already use or plan to use Postgres. Low install friction, active maintenance, MIT license, and no known vulnerabilities make it a straightforward choice for this use case. Not relevant if you don't use LlamaIndex or prefer a different storage backend.
Install
llama-index-storage-docstore-postgres on PyPI
pip
pip install llama-index-storage-docstore-postgresuv
uv add llama-index-storage-docstore-postgrespoetry
poetry add llama-index-storage-docstore-postgresInstalling llama-index-storage-docstore-postgres
Before you install
Low install friction with two runtime dependencies. Active maintenance status as of March 2026. No known vulnerabilities.
License in practice
MIT license permits commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install llama-index-storage-docstore-postgres
from llama_index.storage.docstore.postgres import PostgresDocumentStore
docstore = PostgresDocumentStore.from_uri(connection_string="postgresql://user:password@localhost/dbname")
Requires a running Postgres instance and valid connection credentials; Python 3.10 or later.
Verify before relying
- Whether this package requires a running Postgres instance or handles connection setup automatically
- Performance characteristics and scalability limits for document storage and retrieval
- Whether it supports document indexing or only basic storage/retrieval operations
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — llama-index-core, llama-index-storage-kvstore-postgres |
| Maintenance | actively maintained — 155 days since the last release |
| First released | |
| Downloads | 147,147/month — #11,078 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: llama_index_storage_docstore_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-kvstore-postgresProvides a PostgreSQL-backed key-value store…
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-qdrantIntegrates Qdrant 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-faissIntegrates FAISS vector storage with LlamaIndex…
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-pineconeIntegrates Pinecone vector database with…
permissive · top 15,000 on PyPI
llama-index-vector-stores-postgresIntegrates PostgreSQL with pgvector extension…
permissive · top 15,000 on PyPI
llama-index-vector-stores-milvusIntegrates the Milvus vector database with…
permissive · top 15,000 on PyPI
ciris-persistCIRISPersist provides unified, versioned…
agpl · top 15,000 on PyPI