Registry /
llm-agents / llama-index-storage-docstore-postgres
Install & Compatibility
Where this runs
tested against v0.5.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 253.4MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 19.1s · import 0.000s · 255MB
267MB installed
● package 267MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
PostgresDocStore
✓ from llama_index.storage.docstore.postgres import PostgresDocStore
✗ from llama_index.storage.docstore.postgres import PostgresDocStore
Initialize a PostgreSQL-backed document store using a connection URI.
import os
from llama_index.storage.docstore.postgres import PostgresDocStore
# Set up connection (use environment variables for safety)
connection_string = os.environ.get(
"POSTGRES_CONNECTION_STRING",
"postgresql+asyncpg://user:pass@localhost:5432/llamaindex"
)
docstore = PostgresDocStore.from_uri(
connection_string=connection_string,
table_name="docstore", # optional
schema_name="public" # optional
)
print("PostgresDocStore created successfully")
Upgrade
Version history
0.5.0latest on PyPI · released Mar 12, 2026
Audit
Dependencies
llama-index-corerequiredCore LlamaIndex abstractions
asyncpgrequiredPostgreSQL async driver
sqlalchemyrequiredORM for PostgreSQL
psycopg2-binaryoptionalPostgreSQL adapter