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

# Quickstart

> Ingest your first document and query it in a couple of minutes

Polyvia turns visual & multimodal documents into a queryable knowledge graph.
This guide takes you from zero to a cited answer.

## 1. Get an API key

<Steps>
  <Step title="Sign in to Polyvia Platform">
    Open the **Polyvia Platform** and sign up or log in.
  </Step>

  <Step title="Create a key">
    Open **API** in the sidebar of the **Polyvia Platform**, then **Create API Key**. Copy it — it's shown only once. All
    keys start with `poly_`.
  </Step>
</Steps>

<Tip>
  In the snippets below you can paste your key straight into `api_key` to get
  going. For real projects, keep it out of code instead — run
  `export POLYVIA_API_KEY=poly_<key>` and call `Polyvia()` (or `new Polyvia()`)
  with no arguments; the SDK reads the variable automatically. An explicit
  `api_key` always takes precedence over the environment variable.
</Tip>

## 2. Install an SDK

<CodeGroup>
  ```bash pip theme={null}
  pip install polyvia
  ```

  ```bash npm theme={null}
  npm install polyvia
  ```
</CodeGroup>

<Tip>
  Prefer raw HTTP? Every example here maps 1:1 to the REST
  [API Reference](/api-reference/introduction). No SDK required.
</Tip>

## 3a. Ingest & query — a single file

Ingestion is asynchronous: upload returns a `task_id`, then you poll (or
`wait`) until it's `completed`. Once indexed, query in natural language and get
an answer grounded in the exact source page.

<CodeGroup>
  ```python Python theme={null}
  from polyvia import Polyvia

  client = Polyvia(api_key="poly_<key>")

  result = client.ingest.file("q4-report.pdf")
  client.ingest.wait(result.task_id)        # blocks until completed

  answer = client.query("What was Q4 revenue, and which chart shows it?")
  print(answer.answer)
  ```

  ```ts TypeScript theme={null}
  import { Polyvia } from "polyvia";

  const client = new Polyvia({ apiKey: "poly_<key>" });

  const result = await client.ingest.file("q4-report.pdf");
  await client.ingest.wait(result.task_id); // resolves when completed

  const answer = await client.query("What was Q4 revenue, and which chart shows it?");
  console.log(answer.answer);
  ```
</CodeGroup>

## 3b. Ingest & query — across many documents

The power of Polyvia is querying a **whole corpus** jointly. Ingest a batch into
a **group**, then ask one question across all of it.

<CodeGroup>
  ```python Python theme={null}
  from polyvia import Polyvia

  client = Polyvia(api_key="poly_<key>")

  # Ingest several files into a group (created on first use)
  items = client.ingest.batch(
      ["q1.pdf", "q2.pdf", "q3.pdf", "q4.pdf"],
      group="FY24 Earnings",
  )
  for item in items:
      client.ingest.wait(item.task_id)

  # Ask once, across the group — answers cite the exact page in each doc
  print(client.query("How did revenue trend across the four quarters?",
                     group="FY24 Earnings").answer)
  ```

  ```ts TypeScript theme={null}
  import { Polyvia } from "polyvia";

  const client = new Polyvia({ apiKey: "poly_<key>" });

  const items = await client.ingest.batch(
    ["q1.pdf", "q2.pdf", "q3.pdf", "q4.pdf"],
    { group: "FY24 Earnings" },
  );
  await Promise.all(items.map((i) => client.ingest.wait(i.task_id)));

  const answer = await client.query(
    "How did revenue trend across the four quarters?",
    { group: "FY24 Earnings" },
  );
  console.log(answer.answer);
  ```
</CodeGroup>

## Next steps

<CardGroup cols={3}>
  <Card title="Core concepts" icon="book-open" href="/concepts">
    Documents, groups, ingestion, citations.
  </Card>

  <Card title="Python SDK" icon="python" href="/products/python-sdk">
    Async client, error handling, agent tools.
  </Card>

  <Card title="MCP Server" icon="plug" href="/products/mcp">
    Use Polyvia from Claude, Cursor and agents.
  </Card>
</CardGroup>

<Note>
  **Need help?** Email [mgierlach5@gmail.com](mailto:mgierlach5@gmail.com).
</Note>
