LlamaIndex store wrappers that auto-provision Docker containers via py-dockerdb
Project description
llama-index-pydocker
LlamaIndex store wrappers that spin up Docker containers automatically — one import swap away.
pip install llama-index-pydocker
llama-index-pydocker wraps every LlamaIndex store class that needs a running
database. Pass a localhost URL and the right Docker container starts
automatically via py-dockerdb. Pass a
cloud URL and the wrapper is invisible — nothing Docker-related ever runs.
Switch from a local Neo4j graph store to a hosted one without touching your pipeline. Prototype a pgvector RAG index on your laptop, deploy to RDS with one URL change. Give every student an isolated vector store in seconds.
When to use this
- Local GraphRAG prototype: one import swap gives you a Neo4j container that LlamaIndex talks to directly, with automatic teardown via context manager.
- pgvector RAG on localhost: spin up Postgres + pgvector, run your retrieval pipeline, shut everything down — without ever opening a terminal.
- Qdrant / OpenSearch experiments: same pattern, same API. Swap backends by
changing the URL and the
docker_configtype. - Production passthrough: point any store at a cloud endpoint and
llama-index-pydockerbehaves exactly like the upstream LlamaIndex class.
Supported Stores
Prerequisites
- Python 3.10+ · Docker running ·
py-dockerdbinstalled
Installation
pip install llama-index-pydocker # core only
pip install "llama-index-pydocker[neo4j]" # + Neo4j graph store
pip install "llama-index-pydocker[postgres]" # + pgvector store
pip install "llama-index-pydocker[qdrant]" # + Qdrant vector store
pip install "llama-index-pydocker[opensearch]" # + OpenSearch vector store
pip install "llama-index-pydocker[all]" # everything
Usage
Change one import. Everything else stays the same.
Neo4j Graph Store
# Before
from llama_index.graph_stores.neo4j import Neo4jGraphStore
# After — Docker container starts automatically on localhost URLs
from llama_index_pydocker import Neo4jGraphStore
from llama_index_pydocker import Neo4jGraphStore
store = Neo4jGraphStore(
url="bolt://localhost:7687",
password="test",
)
# Container is up, store is ready
store.stop() # remove container when done
Use a context manager for automatic teardown:
with Neo4jGraphStore(url="bolt://localhost:7687", password="test") as store:
index = KnowledgeGraphIndex.from_documents(docs, storage_context=..., graph_store=store)
response = query_engine.query("Who founded Neo4j?")
# Container removed here
Point at a cloud instance — Docker is never touched:
store = Neo4jGraphStore(
url="bolt://my-aura-instance.databases.neo4j.io:7687",
password="secret",
)
pgvector Store
from llama_index_pydocker import PGVectorStore
store = PGVectorStore(
connection_string="postgresql://user:pass@localhost:5432/vectordb",
embed_dim=1536,
)
store.stop()
Override Docker config (volume, retries, container name, …):
from docker_db import PostgresConfig
from llama_index_pydocker import PGVectorStore
cfg = PostgresConfig(
user="user", password="pass", database="vectordb",
project_name="my-rag",
retries=30,
)
with PGVectorStore(
connection_string="postgresql://user:pass@localhost:5432/vectordb",
embed_dim=1536,
docker_config=cfg,
) as store:
index = VectorStoreIndex.from_documents(docs, vector_store=store)
print(index.as_query_engine().query("What is pgvector?"))
Qdrant Vector Store
from llama_index_pydocker import QdrantVectorStore
with QdrantVectorStore(
collection_name="docs",
url="http://localhost:6333",
) as store:
index = VectorStoreIndex.from_documents(docs, vector_store=store)
print(index.as_query_engine().query("What is Qdrant?"))
Remote cluster — no Docker:
store = QdrantVectorStore(
collection_name="docs",
url="https://my-cluster.qdrant.io:6333",
api_key="sk-...",
)
OpenSearch Vector Store
from llama_index_pydocker import OpensearchVectorStore
with OpensearchVectorStore(
index_name="docs",
endpoint="http://localhost:9200",
embed_dim=1536,
) as store:
index = VectorStoreIndex.from_documents(docs, vector_store=store)
print(index.as_query_engine().query("What is OpenSearch?"))
Routing logic
url / connection_string / endpoint
│
▼
is_localhost(host)?
┌────┴────┐
YES NO
│ │
▼ ▼
create passthrough
Docker (behaves like
container upstream class)
Port is always inferred from the URL, even when a docker_config is supplied.
More examples
Full runnable notebooks are in usage/:
Neo4j / GraphRAG · pgvector RAG · Qdrant · OpenSearch
Development
git clone https://github.com/amadou-6e/llama-index-pydocker.git
cd llama-index-pydocker
pip install -e ".[all]"
Testing
python -m pytest tests/test_utils.py
python -m pytest tests/test_neo4j.py
python -m pytest tests/test_postgres.py
python -m pytest tests/test_qdrant.py
python -m pytest tests/test_opensearch.py
Contributing
PRs welcome. Include tests for behaviour changes.
License
MIT License. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llama_index_pydocker-0.1.0.tar.gz.
File metadata
- Download URL: llama_index_pydocker-0.1.0.tar.gz
- Upload date:
- Size: 17.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07c3ca5dfcb03b4e484e5b7acbd24ec2b0d387b4b018410aba17458c8791888d
|
|
| MD5 |
e3c2993b7d82f837033ba3467210ce73
|
|
| BLAKE2b-256 |
b91c153d519faff6d95314d057811b97f47ee20e91ca49d3452e49a8e240c123
|
Provenance
The following attestation bundles were made for llama_index_pydocker-0.1.0.tar.gz:
Publisher:
cicd.yml on amadou-6e/llama-index-pydocker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llama_index_pydocker-0.1.0.tar.gz -
Subject digest:
07c3ca5dfcb03b4e484e5b7acbd24ec2b0d387b4b018410aba17458c8791888d - Sigstore transparency entry: 1076492158
- Sigstore integration time:
-
Permalink:
amadou-6e/llama-index-pydocker@4fdf626919d2623b439a0fa55d0e483d06d738c9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/amadou-6e
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cicd.yml@4fdf626919d2623b439a0fa55d0e483d06d738c9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file llama_index_pydocker-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llama_index_pydocker-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20a719bc9dedfcd02978b3174b2c948992bc89126c8cadedb2521e5d2b539151
|
|
| MD5 |
87a774691b8ac6095f2734985d184c26
|
|
| BLAKE2b-256 |
91ada6281603dbd7d0829084cb8a08c3a973a91c6f95ae93bd66f2cf07ce56f1
|
Provenance
The following attestation bundles were made for llama_index_pydocker-0.1.0-py3-none-any.whl:
Publisher:
cicd.yml on amadou-6e/llama-index-pydocker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llama_index_pydocker-0.1.0-py3-none-any.whl -
Subject digest:
20a719bc9dedfcd02978b3174b2c948992bc89126c8cadedb2521e5d2b539151 - Sigstore transparency entry: 1076492168
- Sigstore integration time:
-
Permalink:
amadou-6e/llama-index-pydocker@4fdf626919d2623b439a0fa55d0e483d06d738c9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/amadou-6e
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cicd.yml@4fdf626919d2623b439a0fa55d0e483d06d738c9 -
Trigger Event:
push
-
Statement type: