> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vectorshift.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# VectorShift Python SDK

> Build, run, and manage Pipelines, Agents, Knowledge Bases, and Tables from Python.

The VectorShift Python SDK targets the same backend as the visual editor — anything you build in the SDK is editable in the platform UI and vice versa. Pick a primitive and start shipping.

> [card] [Pipeline](https://docs.vectorshift.ai/sdk/pipeline/overview.md)
>
> A graph of nodes (LLMs, loaders, transforms, knowledge readers) you build, save, and run.

> [card] [Agent](https://docs.vectorshift.ai/sdk/agent/overview.md)
>
> Tools, typed I/O, and multi-turn conversations via `Session`.

> [card] [Knowledge Base](https://docs.vectorshift.ai/sdk/knowledge-base/overview.md)
>
> Managed vector + document store you query directly or expose as a tool on an Agent.

> [card] [Table](https://docs.vectorshift.ai/sdk/table/overview.md)
>
> Typed schema, AI-generated columns (Pipeline / Agent), and SQL-grade filters.

> [card] [Transformation](https://docs.vectorshift.ai/sdk/transformation/overview.md)
>
> Reusable, typed Python functions you run directly or wire into a Pipeline.

> [card] [Analytics](https://docs.vectorshift.ai/sdk/analytics/overview.md)
>
> Query runs, tokens, costs, latency, errors, and traces across every primitive.

## Get started in 60 seconds

**1. Install**

```bash theme={"languages":{}}
pip install vectorshift
```

**2. Authenticate**

```bash theme={"languages":{}}
export VECTORSHIFT_API_KEY="sk_..."
```

Generate a key under [Account → API Keys](https://app.vectorshift.ai/account/api-keys).

**3. Run your first pipeline**

Follow the [Quickstart](https://docs.vectorshift.ai/sdk/quickstart.md) for a five-line LLM pipeline you can paste and run.

## What you can build

> [card] [RAG pipelines](https://docs.vectorshift.ai/sdk/pipeline/examples/rag-pipeline.md)
>
> Wire a knowledge-base reader into an LLM in a few lines.

> [card] [Conversational agents](https://docs.vectorshift.ai/sdk/agent/examples/conversational-agent-tools.md)
>
> Tools, approvals, and streamed tool events out of the box.

> [card] [Background batch runs](https://docs.vectorshift.ai/sdk/pipeline/examples/background-run.md)
>
> Kick off long-running jobs and poll for results.

> [card] [Streaming chatbots](https://docs.vectorshift.ai/sdk/agent/examples/chatbot-session.md)
>
> Multi-turn sessions with token-level streaming.

## Reference

> [card] [Pipeline reference](https://docs.vectorshift.ai/sdk/pipeline/reference.md)
>
> Every public method, grouped by topic.

> [card] [Agent reference](https://docs.vectorshift.ai/sdk/agent/reference.md)
>
> Lifecycle, tools, running, types.

> [card] [Errors](https://docs.vectorshift.ai/sdk/errors.md)
>
> Full exception hierarchy with status codes.

> [!TIP]
>
> The SDK ships with type hints and a [mypy plugin](https://docs.vectorshift.ai/sdk/installation.md#type-checking-with-mypy) that catches pipeline-wiring and tool-definition mistakes at static-check time.

## Writing SDK code

Follow these conventions — every example in these docs does, and they keep generated code correct and re-runnable:

* **Authenticate via the `VECTORSHIFT_API_KEY` environment variable.** Never hardcode the key inline.
* **Build pipelines with the fluent builder** — `pipeline.add(name="...").llm(...)`. Don't use standalone node constructors or pass `nodes=[...]` to the constructor.
* **Guard with fetch-or-create at the top**, then build. Nodes dedup by `name`, so a stable `name=` makes re-runs idempotent — don't pass hardcoded `id=` values.
* **Set `temperature` via `sampling=SamplingConfig(temperature=...)`**, not as a top-level `.llm()` argument (where it's silently dropped).
* For exact signatures use the primitive's **reference** page; for full runnable scripts use its **examples** pages.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.