Skip to main content
The polyvia Python package wraps the entire REST API in a typed, IDE-friendly client.
Requires Python 3.9+. LangChain agent support:

Quick Start

Prefer not to hard-code the key? The SDK also reads it from the POLYVIA_API_KEY environment variable — set export POLYVIA_API_KEY=poly_<key> and you can drop the api_key argument.

Usage

Ingest

The SDK uploads file bytes directly to Polyvia’s storage backend (the API server is not in the upload path), so there is no practical file-size cap from the SDK side and large batches don’t fail on a request-body limit. Each file in a batch is uploaded and finalized independently — a failure on one file is captured in BatchIngestItem.error and does not affect the others.

Query

Groups

Groups have a human name and an opaque backend id. Pass the name to ingest / query and the SDK resolves it — you rarely touch the id. Use get_or_create when you want the group object itself.

Documents

Usage & Rate Limits


Async Client

Every method on AsyncPolyvia is a coroutine — same API surface as the sync client.

Error Handling


MCP & Agent Tools

MCP Server

Connect Polyvia to Claude, OpenAI, and other AI clients via MCP — including SDK helpers, programmatic agent tools, and LangChain integration.

PyPI

pip install polyvia

GitHub

Source code and examples