Skip to main content
The polyvia npm package wraps the entire REST API in a fully-typed, ESM/CJS-compatible client.
Requires Node.js 18+. Works in TypeScript and plain JavaScript.

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 apiKey option.

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 getOrCreate when you want the group object itself.

Documents

Usage & Rate Limits


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 Claude Desktop config.

npm

npm install polyvia

GitHub

Source code and examples