Registry /
llm-agents / llama-index-storage-kvstore-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 4.796s · 253.3MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 19.1s · import 4.398s · 255MB
267MB installed
● package 267MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
PostgresKVStore
✓ from llama_index.storage.kvstore.postgres import PostgresKVStore
✗ from llama_index.kvstore.postgres import PostgresKVStore
Old import path before 0.5.0
Initialize a PostgresKVStore with connection string and perform basic put/get operations.
from llama_index.storage.kvstore.postgres import PostgresKVStore
kvstore = PostgresKVStore(
connection_string="postgresql://user:pass@localhost:5432/dbname",
table_name="kvstore",
schema_name="public"
)
# Example: set and get
kvstore.put(key="test_key", val={"data": "value"})
result = kvstore.get(key="test_key")
print(result)
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'llama_index.kvstore'
Import path changed in 0.5.0
fixUse from llama_index.storage.kvstore.postgres import PostgresKVStore
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation "kvstore" does not exist
Table not created automatically
fixSet create_table=True or pre-create the table: CREATE TABLE IF NOT EXISTS public.kvstore (key TEXT PRIMARY KEY, data JSONB);
Upgrade
Version history
0.5.0latest on PyPI · released Mar 12, 2026
Audit
Dependencies
asyncpgrequiredPostgreSQL async client
sqlalchemyrequiredORM for schema management
llama-index-corerequiredCore LlamaIndex abstractions