llama-index-vector-stores-polign
LlamaIndex vector store for polign_db.
pip install llama-index-vector-stores-polign
Usage
from llama_index.core import StorageContext, VectorStoreIndex
from llama_index.vector_stores.polign import PolignVectorStore
store = PolignVectorStore(
collection_name="docs",
url="http://localhost:23000", # api_key="plgn_..." when the server requires one
)
storage_context = StorageContext.from_defaults(vector_store=store)
index = VectorStoreIndex.from_documents(documents, storage_context=storage_context)
retriever = index.as_retriever(similarity_top_k=5)
retriever.retrieve("what purrs?")
index.delete_ref_doc("document-id") # removes every chunk of that document
# reopen later without re-indexing
index = VectorStoreIndex.from_vector_store(store)
Collections are created on the first write and take their dimension from
the first embedding. Pass client= with an existing polign.Client or
polign.GrpcClient to reuse a connection or use the gRPC transport
(pip install "llama-index-vector-stores-polign[grpc]").
Metadata filters
MetadataFilters translate to polign's filter language. Supported
operators: EQ, NE, GT, GTE, LT, LTE, IN, NIN, ANY, ALL,
CONTAINS, IS_EMPTY, with AND, OR, and NOT conditions and nesting.
TEXT_MATCH is not supported. query.doc_ids and query.node_ids are
honored.
from llama_index.core.vector_stores.types import MetadataFilter, MetadataFilters, FilterOperator
retriever = index.as_retriever(
similarity_top_k=5,
filters=MetadataFilters(filters=[
MetadataFilter(key="lang", value="en"),
MetadataFilter(key="year", value=2024, operator=FilterOperator.GTE),
]),
)
Query modes
| Mode | What runs |
|---|---|
DEFAULT |
vector search; similarity is 1 / (1 + d) for L2 collections, 1 - d for cosine |
TEXT_SEARCH, SPARSE |
BM25 over the node text; similarity is the BM25 score |
HYBRID |
vector plus BM25 fused server-side; linear with alpha when set, reciprocal rank fusion otherwise |
MMR |
re-ranks the similarity_top_k * mmr_prefetch_factor nearest nodes with mmr_threshold |
Pass similarity_fn= to the constructor to change the distance mapping.
ef, cold, nprobe, and rescore given as extra query kwargs go to
polign.Client.search unchanged.
Text and hybrid modes need a server with a segment store
(polign-server -store ...); an in-memory server raises
polign.InvalidArgumentError. The BM25 index is built when the server
persists a segment, so nodes take part in lexical search only after the
next segment is written and the searchers refresh, about half a minute with
default settings. Vector search sees writes immediately.
How nodes are stored
- The polign record id is the node id, also stored under
_node_id. - The node text lives in the metadata key
text, the field the server's BM25 index reads by default. Change it withtext_key=only if the server is configured for another field. - Everything else is what LlamaIndex's
node_to_metadata_dictproduces: the node as JSON under_node_content,_node_type,ref_doc_id(also asdoc_idanddocument_id), and the node's metadata at the top level so it can be filtered on. Top-level values polign cannot store (nested objects,None) are JSON-encoded there; the node itself is unaffected.
Limits
clear()deletes every record; dropping the collection itself needs the server's-byo-storecollection API.- Async methods run the synchronous client in a worker thread.
- Writes are sent in batches of up to 5,000 records, the server's limit.
Development
pip install -e ".[grpc]" pytest pytest-asyncio
pytest # boots a polign-server; see tests/conftest.py
License
Apache License 2.0. See LICENSE.
Metadata
Release files for llama-index-vector-stores-polign 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 | Provenance | Actions |
|---|---|---|---|---|
| llama_index_vector_stores_polign-0.1.0.tar.gz | 15.6 kB | With provenance | Details for llama_index_vector_stores_polign-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| llama_index_vector_stores_polign-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for llama_index_vector_stores_polign-0.1.0-py3-none-any.whl |
Total release size: 28.7 kB
Release files / llama_index_vector_stores_polign-0.1.0.tar.gz
| Download URL | llama_index_vector_stores_polign-0.1.0.tar.gz |
|---|---|
| Size | 15.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
282d1f74b579c0bb7eb8a37833d55f57305259fce212c25feb7714f1f148ddfe
|
|
BLAKE2b-256 checksum How to use checksums |
8250813e60f366fd4f214cb18f41c7532283a485482432fe8410deccb1eeb11c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 11, 2026.
Transparency logRelease files / llama_index_vector_stores_polign-0.1.0-py3-none-any.whl
| Download URL | llama_index_vector_stores_polign-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7bbacf23eff0b84b3cc88abb803d1f7a88e3b9c4354538b7fdd3b266299e5dd1
|
|
BLAKE2b-256 checksum How to use checksums |
e7f95daa04f3bb4c5274f0bfbd3393e99c9637e83a948be6b46104026561ddeb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 11, 2026.
Transparency logSecurity for llama-index-vector-stores-polign 0.1.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for llama_index_vector_stores_polign-0.1.0.tar.gz
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 Sep 11, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.