pw.xpacks.llm.vector_store

Pathway vector search server and client.

The server reads source documents and build a vector index over them, then starts serving HTTP requests.

The client queries the server and returns matching documents.

class pw.xpacks.llm.vector_store.VectorStoreClient(host=None, port=None, url=None, timeout=15, additional_headers=None)

[source]
A client you can use to query VectorStoreServer.

Please provide either the url, or host and port.

get_input_files(metadata_filter=None, filepath_globpattern=None)

sourceFetch information on documents in the the vector store.

  • Parameters
    • metadata_filter (str | None) – optional string representing the metadata filtering query in the JMESPath format. The search will happen only for documents satisfying this filtering.
    • filepath_globpattern (str | None) – optional glob pattern specifying which documents will be searched for this query.

get_vectorstore_statistics()

sourceFetch basic statistics about the vector store.

query(query, k=3, metadata_filter=None, filepath_globpattern=None)

sourcePerform a query to the vector store and fetch results.

  • Parameters
    • query (str) –
    • k (int) – number of documents to be returned
    • metadata_filter (str | None) – optional string representing the metadata filtering query in the JMESPath format. The search will happen only for documents satisfying this filtering.
    • filepath_globpattern (str | None) – optional glob pattern specifying which documents will be searched for this query.