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.
Metadata
Release files for llama-index-pydocker 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| llama_index_pydocker-0.1.0.tar.gz | 17.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llama_index_pydocker-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.0 kB
Release files / llama_index_pydocker-0.1.0.tar.gz
| Download URL | llama_index_pydocker-0.1.0.tar.gz |
|---|---|
| Size | 17.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
07c3ca5dfcb03b4e484e5b7acbd24ec2b0d387b4b018410aba17458c8791888d
|
|
BLAKE2b-256 checksum How to use checksums |
b91c153d519faff6d95314d057811b97f47ee20e91ca49d3452e49a8e240c123
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 10, 2026.
Transparency logRelease files / llama_index_pydocker-0.1.0-py3-none-any.whl
| Download URL | llama_index_pydocker-0.1.0-py3-none-any.whl |
|---|---|
| Size | 18.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
20a719bc9dedfcd02978b3174b2c948992bc89126c8cadedb2521e5d2b539151
|
|
BLAKE2b-256 checksum How to use checksums |
91ada6281603dbd7d0829084cb8a08c3a973a91c6f95ae93bd66f2cf07ce56f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 10, 2026.
Transparency log