> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to Ragie

The Ragie connector lets your AI agent act in each user's Ragie account. Each user connects their own Ragie access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 32 tools.

**Authentication:** Bearer Token
**Categories:** AI, Search, Files & Documents
**Tools:** 32: 18 read, 11 write, 3 destructive
**Users sign in with:** Access token
**Built by:** Scalekit connector
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=RAGIE)

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".env"
   SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
   SCALEKIT_CLIENT_ID=<your-client-id>
   SCALEKIT_CLIENT_SECRET=<your-client-secret>
   ```

3. ### Create the Ragie connection

   In **AgentKit > Connections**, create a Ragie connection. The name you give it is the `connection_name` your code passes. See [Configure connections](/agentkit/connections/).

4. ### Authorize a user and make your first call

   **Node.js** (`quickstart.mts`)

   ```typescript
   import { ScalekitClient } from '@scalekit-sdk/node'
   import 'dotenv/config'
   import { createInterface } from 'node:readline/promises'

   const scalekit = new ScalekitClient(
     process.env.SCALEKIT_ENVIRONMENT_URL,
     process.env.SCALEKIT_CLIENT_ID,
     process.env.SCALEKIT_CLIENT_SECRET,
   )
   const actions = scalekit.actions

   const connector = 'ragie'
   const identifier = 'user_123'

   // Generate an authorization link for the user
   const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
   console.log('Authorize Ragie:', link)
   const rl = createInterface({ input: process.stdin, output: process.stdout })
   await rl.question('Press Enter after authorizing...')
   rl.close()

   // Make your first call
   const result = await actions.executeTool({
     connector,
     identifier,
     toolName: 'ragie_connection_source_types_list',
     toolInput: {},
   })
   console.log(result)
   ```

   ```bash
   npx tsx quickstart.mts
   ```

   **Python** (`quickstart.py`)

   ```python
   import os
   from scalekit import ScalekitClient
   from dotenv import load_dotenv
   load_dotenv()

   scalekit_client = ScalekitClient(
       env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),
       client_id=os.getenv("SCALEKIT_CLIENT_ID"),
       client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),
   )
   actions = scalekit_client.actions

   connection_name = "ragie"
   identifier = "user_123"

   # Generate an authorization link for the user
   link_response = actions.get_authorization_link(
       connection_name=connection_name,
       identifier=identifier,
   )
   print("Authorize Ragie:", link_response.link)
   input("Press Enter after authorizing...")

   # Make your first call
   result = actions.execute_tool(
       tool_input={},
       tool_name="ragie_connection_source_types_list",
       connection_name=connection_name,
       identifier=identifier,
   )
   print(result)
   ```

   ```bash
   python quickstart.py
   ```

   Each user opens the link once and enters their Ragie credentials there. See [Authorize a user](/agentkit/tools/authorize/) for the full flow and statuses.

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'ragie_connection_get',
  toolInput: {
    connection_id: '<connection_id>',
  },
  connector: 'ragie',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="ragie_connection_get",
    tool_input={
        "connection_id": "<connection_id>",
    },
    connection_name="ragie",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `ragie_connection_get`

Get Connection · Read-only

Fetch one connection by id.
Returns id, name, type, source, enabled flag, disabled_by_system reason, page_limit, sync_filter, last_synced_at, syncing flag and partition.
Use ragie_connection_get for one connection's settings. Use ragie_connection_stats_get for document and page counts.
Requires a connection id from ragie_connections_list.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `connection_id` (`string`, required): ID of the connection. Get it from ragie_connections_list.

Example input: `{"connection_id":"<connection_id>"}`

### `ragie_connection_source_types_list`

List Connection Source Types · Read-only

List the data-source types Ragie can connect to.
Returns a list of source types, each with source_type, display_name, icon_url and docs_url.
Use ragie_connection_source_types_list to see which integrations are supported. Use ragie_connections_list for connections you already have.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `ragie_connection_stats_get`

Get Connection Stats · Read-only

Fetch document and page counts for a connection.
Returns document_count and page_count.
Use ragie_connection_stats_get to see how much content a connection has synced. Use ragie_connection_get for its settings.
Requires a connection id from ragie_connections_list.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `connection_id` (`string`, required): ID of the connection. Get it from ragie_connections_list.

Example input: `{"connection_id":"<connection_id>"}`

### `ragie_connections_list`

List Connections · Read-only

List the data-source connections (such as Google Drive, Notion or Slack) in your Ragie account.
Returns connections with id, name, type, source, enabled flag, last_synced_at, syncing flag and partition, plus a pagination object.
Use ragie_connections_list to find a connection id. Use ragie_connection_get for one connection's details.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `cursor` (`string`, optional): Opaque pagination cursor. Pass the next_cursor value from the previous response to fetch the next page; omit for the first page.
- `filter` (`string`, optional): Metadata filter as a JSON string, matched against connection metadata. Example: {"team": {"$eq": "sales"}}.
- `page_size` (`integer`, optional): Number of items per page, from 1 to 100. Defaults to 10. Default: `10`.
- `partition` (`string`, optional): Partition to scope the request to. If omitted, the request is scoped to the default partition.

Example input: `{}`

### `ragie_document_chunk_get`

Get Document Chunk · Read-only

Fetch a single chunk of a document by chunk id.
Returns the chunk id, index, text, metadata, links and any modality data such as word-level timestamps for audio.
Use ragie_document_chunk_get when you have a chunk id from ragie_retrieve. Use ragie_document_chunks_list to page through all chunks.
Requires both a document id and a chunk id.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `chunk_id` (`string`, required): ID of the chunk. Get it from ragie_retrieve or ragie_document_chunks_list.
- `document_id` (`string`, required): ID of the document. Get it from ragie_documents_list or from the response of a create tool.
- `partition` (`string`, optional): Partition to scope this request to. Omit to use the account default (the default partition for accounts created after 2025-01-09; older accounts without strict partition scoping search all partitions). Partition names are lowercase alphanumeric and may include _ and -.

Example input: `{"chunk_id":"<chunk_id>","document_id":"<document_id>"}`

### `ragie_document_chunks_list`

List Document Chunks · Read-only

List the chunks of one document, optionally limited to a range of chunk indexes.
Returns chunks with id, index, text, metadata and links, plus a pagination object with next_cursor and total_count.
Use ragie_document_chunks_list to read a known document's content in order. Use ragie_retrieve to search across all documents.
Requires a document id; the document must be at least indexed.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `document_id` (`string`, required): ID of the document. Get it from ragie_documents_list or from the response of a create tool.
- `cursor` (`string`, optional): Opaque pagination cursor. Pass the next_cursor value from the previous response to fetch the next page; omit for the first page.
- `end_index` (`integer`, optional): Inclusive index of the last chunk to list. If only start_index is given, at most one chunk (matching start_index) is returned. Omit both to list all chunks.
- `page_size` (`integer`, optional): Number of items per page, from 1 to 100. Defaults to 10. Default: `10`.
- `partition` (`string`, optional): Partition to scope this request to. Omit to use the account default (the default partition for accounts created after 2025-01-09; older accounts without strict partition scoping search all partitions). Partition names are lowercase alphanumeric and may include _ and -.
- `start_index` (`integer`, optional): Inclusive index of the first chunk to list. If only end_index is given, at most one chunk (matching end_index) is returned. Omit both to list all chunks.

Example input: `{"document_id":"<document_id>"}`

### `ragie_document_get`

Get Document · Read-only

Fetch one document by id.
Returns the document id, name, status, metadata, partition, errors, chunk_count, external_id, page_count and created and updated timestamps.
Use ragie_document_get to check a document's processing status. Use ragie_document_summary_get for its summary.
Requires a document id from ragie_documents_list or a create tool.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `document_id` (`string`, required): ID of the document. Get it from ragie_documents_list or from the response of a create tool.
- `partition` (`string`, optional): Partition to scope this request to. Omit to use the account default (the default partition for accounts created after 2025-01-09; older accounts without strict partition scoping search all partitions). Partition names are lowercase alphanumeric and may include _ and -.

Example input: `{"document_id":"<document_id>"}`

### `ragie_document_summary_get`

Get Document Summary · Read-only

Fetch the generated summary of a document.
Returns document_id and summary text.
Use ragie_document_summary_get for a quick overview. Use ragie_document_chunks_list for the full content.
The summary is available only once the document status is summary_indexed or ready.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `document_id` (`string`, required): ID of the document. Get it from ragie_documents_list or from the response of a create tool.
- `partition` (`string`, optional): Partition to scope this request to. Omit to use the account default (the default partition for accounts created after 2025-01-09; older accounts without strict partition scoping search all partitions). Partition names are lowercase alphanumeric and may include _ and -.

Example input: `{"document_id":"<document_id>"}`

### `ragie_documents_list`

List Documents · Read-only

List documents in your Ragie account, optionally filtered by metadata.
Returns documents with id, name, status, metadata, partition, chunk_count, external_id and page_count, plus a pagination object with next_cursor and total_count.
Use ragie_documents_list to browse or find a document id. Use ragie_retrieve to search document content.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `cursor` (`string`, optional): Opaque pagination cursor. Pass the next_cursor value from the previous response to fetch the next page; omit for the first page.
- `filter` (`string`, optional): Metadata filter as a JSON string. Supports $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, combinable with $and and $or. Example: {"department": {"$eq": "legal"}}.
- `page_size` (`integer`, optional): Number of items per page, from 1 to 100. Defaults to 10. Default: `10`.
- `partition` (`string`, optional): Partition to scope this request to. Omit to use the account default (the default partition for accounts created after 2025-01-09; older accounts without strict partition scoping search all partitions). Partition names are lowercase alphanumeric and may include _ and -.

Example input: `{}`

### `ragie_element_get`

Get Document Element · Read-only

Fetch a single extracted document element by id.
Returns the element id, index, type, text, markdown, structured data, metadata, location and created_at.
Use ragie_element_get when you have an element id from ragie_elements_list.
Requires an element id.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `element_id` (`string`, required): ID of the element. Get it from ragie_elements_list.

Example input: `{"element_id":"<element_id>"}`

### `ragie_elements_list`

List Document Elements · Read-only

List the structured elements (titles, paragraphs, tables, figures and so on) Ragie extracted from a document.
Returns document_elements, each with id, index, type, text, markdown, data and location, plus a pagination object with next_cursor and total_count.
Use ragie_elements_list to inspect document structure. Use ragie_document_chunks_list for retrieval-ready text chunks.
Requires a document id.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `document_id` (`string`, required): ID of the document. Get it from ragie_documents_list or from the response of a create tool.
- `cursor` (`string`, optional): Opaque pagination cursor. Pass the next_cursor value from the previous response to fetch the next page; omit for the first page.
- `index_end` (`integer`, optional): Only return elements at or before this element index.
- `index_start` (`integer`, optional): Only return elements at or after this element index.
- `page_size` (`integer`, optional): Number of items per page, from 1 to 100. Defaults to 10. Default: `10`.
- `partition` (`string`, optional): Partition to scope this request to. Omit to use the account default (the default partition for accounts created after 2025-01-09; older accounts without strict partition scoping search all partitions). Partition names are lowercase alphanumeric and may include _ and -.
- `type` (`array`, optional): Only return elements of these types. Repeat values as a list. Example: ["Table", "Title"].

Example input: `{"document_id":"<document_id>"}`

### `ragie_entities_list_by_document`

List Entities By Document · Read-only

List entities extracted from one document by your instructions.
Returns entities with id, instruction_id, document_id, chunk_id, data and timestamps, plus a pagination object.
Use ragie_entities_list_by_document to see everything extracted from a document. Use ragie_entities_list_by_instruction to see one instruction's results across documents.
Requires a document id.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `document_id` (`string`, required): ID of the document. Get it from ragie_documents_list or from the response of a create tool.
- `cursor` (`string`, optional): Opaque pagination cursor. Pass the next_cursor value from the previous response to fetch the next page; omit for the first page.
- `page_size` (`integer`, optional): Number of items per page, from 1 to 100. Defaults to 10. Default: `10`.
- `partition` (`string`, optional): Partition to scope this request to. Omit to use the account default (the default partition for accounts created after 2025-01-09; older accounts without strict partition scoping search all partitions). Partition names are lowercase alphanumeric and may include _ and -.

Example input: `{"document_id":"<document_id>"}`

### `ragie_entities_list_by_instruction`

List Entities By Instruction · Read-only

List entities produced by one instruction across your documents.
Returns entities with id, instruction_id, document_id, chunk_id, data and timestamps, plus a pagination object.
Use ragie_entities_list_by_instruction to review one instruction's results. Use ragie_entities_list_by_document to see everything extracted from one document.
Requires an instruction id from ragie_instructions_list.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `instruction_id` (`string`, required): ID of the instruction. Get it from ragie_instructions_list.
- `cursor` (`string`, optional): Opaque pagination cursor. Pass the next_cursor value from the previous response to fetch the next page; omit for the first page.
- `page_size` (`integer`, optional): Number of items per page, from 1 to 100. Defaults to 10. Default: `10`.
- `partition` (`string`, optional): Partition to scope this request to. Omit to use the account default (the default partition for accounts created after 2025-01-09; older accounts without strict partition scoping search all partitions). Partition names are lowercase alphanumeric and may include _ and -.

Example input: `{"instruction_id":"<instruction_id>"}`

### `ragie_instruction_extraction_logs_list`

List Instruction Extraction Logs · Read-only

List extraction log entries for an instruction, optionally filtered by document, status or time range.
Returns log entries with their status (extracted, not_found or error) and timestamps, plus a pagination object.
Use ragie_instruction_extraction_logs_list to debug why an instruction did or did not extract data. Use ragie_entities_list_by_instruction for the extracted data itself.
Requires an instruction id from ragie_instructions_list.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `instruction_id` (`string`, required): ID of the instruction. Get it from ragie_instructions_list.
- `created_after` (`string`, optional): Only include logs created at or after this ISO 8601 timestamp.
- `created_before` (`string`, optional): Only include logs created before this ISO 8601 timestamp.
- `cursor` (`string`, optional): Opaque pagination cursor. Pass the next_cursor value from the previous response to fetch the next page; omit for the first page.
- `document_ids` (`array`, optional): Only return logs for these document ids.
- `page_size` (`integer`, optional): Number of items per page, from 1 to 100. Defaults to 10. Default: `10`.
- `partition` (`string`, optional): Partition to scope this request to. Omit to use the account default (the default partition for accounts created after 2025-01-09; older accounts without strict partition scoping search all partitions). Partition names are lowercase alphanumeric and may include _ and -.
- `status` (`string`, optional): Only return logs with this extraction status. One of: `extracted`, `not_found`, `error`.

Example input: `{"instruction_id":"<instruction_id>"}`

### `ragie_instructions_list`

List Instructions · Read-only

List all entity-extraction instructions in your account.
Returns instructions with id, name, prompt, entity_schema, scope, active flag, filter, partition and timestamps.
Use ragie_instructions_list to find an instruction id before updating, deleting or reading its entities.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `ragie_partition_get`

Get Partition · Read-only

Fetch one partition with its settings, limits and usage stats.
Returns name, is_default, description, context_aware, metadata_schema, limits and stats.
Use ragie_partition_get for details on one partition. Use ragie_partitions_list to see them all.
Requires a partition name from ragie_partitions_list.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `partition_id` (`string`, required): Name of the partition (its identifier). Get it from ragie_partitions_list.

Example input: `{"partition_id":"<partition_id>"}`

### `ragie_partitions_list`

List Partitions · Read-only

List the partitions in your Ragie account.
Returns partitions with name, is_default, description, context_aware, metadata_schema and usage limits, plus a pagination object.
Use ragie_partitions_list to find partition names to scope other tools. Use ragie_partition_get for usage stats on one partition.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `cursor` (`string`, optional): Opaque pagination cursor. Pass the next_cursor value from the previous response to fetch the next page; omit for the first page.
- `page_size` (`integer`, optional): Number of items per page, from 1 to 100. Defaults to 10. Default: `10`.

Example input: `{}`

### `ragie_retrieve`

Retrieve Chunks · Read-only

Search indexed documents with a natural-language query and return the most relevant chunks.
Returns scored_chunks, each with chunk id, index, text, relevance score, document_id, document_name, document metadata and links.
Use ragie_retrieve to answer questions from your content. Use ragie_documents_list to browse documents and ragie_document_chunks_list to read the chunks of one known document.
Documents must be in indexed or ready status to be retrievable.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `query` (`string`, required): Natural-language query to search with. Example: What is our parental leave policy?
- `filter` (`object`, optional): Metadata filter limiting which documents are searched. Supports $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, combinable with $and and $or. Example: {"department": {"$eq": "legal"}}.
- `max_chunks_per_document` (`integer`, optional): Maximum chunks to return from any single document, used to draw results from more documents. Beta feature.
- `partition` (`string`, optional): Partition to scope the retrieval to. Omit to search the default partition, which includes documents not created in a named partition.
- `recency_bias` (`boolean`, optional): Favor more recent documents over older ones in the ranking. Defaults to false. Default: `false`.
- `rerank` (`boolean`, optional): Rerank chunks for semantic relevance after the similarity search. Slower, but returns a smaller set of highly relevant chunks and helps reduce hallucinations. Defaults to false. Default: `false`.
- `top_k` (`integer`, optional): Maximum number of chunks to return. Defaults to 8. Default: `8`.

Example input: `{"query":"<query>"}`

### `ragie_connection_enabled_set`

Enable Or Disable Connection · Write

Enable or disable a connection. A disabled connection stops syncing.
Returns the updated connection.
Use ragie_connection_enabled_set to pause or resume syncing. Use ragie_connection_sync to run a sync now.
Requires a connection id from ragie_connections_list.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `connection_id` (`string`, required): ID of the connection. Get it from ragie_connections_list.
- `enabled` (`boolean`, required): True to enable the connection, false to disable it.
- `reason` (`string`, optional): Optional reason for disabling the connection, recorded by Ragie.

Example input: `{"connection_id":"<connection_id>","enabled":true}`

### `ragie_connection_sync`

Sync Connection · Write

Start a sync of a connection so new and changed source content is ingested.
Returns a message field confirming the sync was started.
Use ragie_connection_sync to refresh a connection on demand. Check progress with ragie_connection_get and its syncing flag.
Requires a connection id from ragie_connections_list.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `connection_id` (`string`, required): ID of the connection. Get it from ragie_connections_list.

Example input: `{"connection_id":"<connection_id>"}`

### `ragie_document_create_from_url`

Create Document From URL · Write

Ingest a document from a publicly accessible HTTP or HTTPS URL.
Returns the new document with its id, name, status (starts as pending), metadata, partition and external_id.
Use ragie_document_create_from_url for files hosted online. Use ragie_document_create_raw for text or JSON you already have in hand.
Processing is asynchronous: poll ragie_document_get until status is ready. PDFs over 2000 pages and other static files over 10000 pages are not supported.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): Public HTTP or HTTPS URL of the file to download. Example: https://example.com/handbook.pdf
- `external_id` (`string`, optional): Optional identifier for the document in your own system, such as a database id or the source URL.
- `metadata` (`object`, optional): Key-value metadata to store on the document, as an object. Keys are strings. Values may be strings, numbers, booleans, or lists of strings; up to 1000 total values (each list item counts). Reserved keys that cannot be used: document_id, document_type, document_source, document_name, document_uploaded_at, start_time, end_time, chunk_content_type. Example: {"department": "legal", "year": 2024, "tags": ["nda", "vendor"]}.
- `mode` (`string`, optional): Processing strategy for textual documents: fast extracts text only and can be up to 20x faster; hi_res also extracts images and tables from Word documents, PDFs, images and PowerPoints; all processes every media type at the highest quality; agentic_ocr uses vision models (early access, contact Ragie support to enable). Omit to use the account default. One of: `fast`, `hi_res`, `all`, `agentic_ocr`.
- `name` (`string`, optional): Name for the document. If omitted, Ragie names it with the current timestamp.
- `partition` (`string`, optional): Partition to create the document in. Partitions are created automatically the first time a document is added. Must be lowercase alphanumeric and may include _ and -.

Example input: `{"url":"<url>"}`

### `ragie_document_create_raw`

Create Document From Text · Write

Ingest a document from raw text or a JSON object.
Returns the new document with its id, name, status (starts as pending), metadata, partition and external_id.
Use ragie_document_create_raw when you already hold the content. Use ragie_document_create_from_url for files hosted online.
Processing is asynchronous: poll ragie_document_get until status is ready.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `data` (`string`, required): Document content as plain text, or as a JSON object. Example: "Refunds are accepted within 30 days of purchase."
- `external_id` (`string`, optional): Optional identifier for the document in your own system, such as a database id or the source URL.
- `metadata` (`object`, optional): Key-value metadata to store on the document, as an object. Keys are strings. Values may be strings, numbers, booleans, or lists of strings; up to 1000 total values (each list item counts). Reserved keys that cannot be used: document_id, document_type, document_source, document_name, document_uploaded_at, start_time, end_time, chunk_content_type. Example: {"department": "legal", "year": 2024, "tags": ["nda", "vendor"]}.
- `name` (`string`, optional): Name for the document. If omitted, Ragie names it with the current timestamp.
- `partition` (`string`, optional): Partition to create the document in. Partitions are created automatically the first time a document is added. Must be lowercase alphanumeric and may include _ and -.

Example input: `{"data":"Refunds are accepted within 30 days of purchase."}`

### `ragie_document_metadata_update`

Update Document Metadata · Write

Merge changes into a document's metadata without reprocessing the document.
Returns the full metadata of the document including the update, or a status field when async is true.
Use ragie_document_metadata_update to add, change or remove metadata keys. A key set to null is deleted.
Requires a document id from ragie_documents_list.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `document_id` (`string`, required): ID of the document. Get it from ragie_documents_list or from the response of a create tool.
- `metadata` (`object`, required): Partial metadata update, as an object. Keys are strings; values may be strings, numbers, booleans, or lists of strings. A key set to null is removed. Up to 1000 total values including existing metadata. For documents managed by a connection, the change is stored as an overlay re-applied on every sync. Example: {"status": "reviewed", "draft": null}.
- `async` (`boolean`, optional): Run the update in the background. If true, the request returns immediately with HTTP 202; if false, it completes before returning. Defaults to false.
- `partition` (`string`, optional): Partition to scope this request to. Omit to use the account default (the default partition for accounts created after 2025-01-09; older accounts without strict partition scoping search all partitions). Partition names are lowercase alphanumeric and may include _ and -.

Example input: `{"document_id":"<document_id>","metadata":{"status":"reviewed","draft":null}}`

### `ragie_document_update_from_url`

Update Document From URL · Write

Replace a document's file with a new file downloaded from a public URL and reprocess it.
Returns a status field for the update.
Use ragie_document_update_from_url to refresh a document that came from a URL. Use ragie_document_update_raw to replace it with text.
Requires a document id from ragie_documents_list. Processing is asynchronous: poll ragie_document_get until status is ready.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `document_id` (`string`, required): ID of the document. Get it from ragie_documents_list or from the response of a create tool.
- `url` (`string`, required): Public HTTP or HTTPS URL of the replacement file. Example: https://example.com/handbook-v2.pdf
- `mode` (`string`, optional): Processing strategy for textual documents: fast extracts text only and can be up to 20x faster; hi_res also extracts images and tables from Word documents, PDFs, images and PowerPoints; all processes every media type at the highest quality; agentic_ocr uses vision models (early access, contact Ragie support to enable). Omit to use the account default. One of: `fast`, `hi_res`, `all`, `agentic_ocr`.
- `partition` (`string`, optional): Partition to scope this request to. Omit to use the account default (the default partition for accounts created after 2025-01-09; older accounts without strict partition scoping search all partitions). Partition names are lowercase alphanumeric and may include _ and -.

Example input: `{"document_id":"<document_id>","url":"<url>"}`

### `ragie_document_update_raw`

Update Document From Text · Write

Replace a document's content with new raw text or a JSON object and reprocess it.
Returns a status field for the update.
Use ragie_document_update_raw to overwrite a text document. Use ragie_document_update_from_url to replace it with a file from a URL.
Requires a document id from ragie_documents_list. Processing is asynchronous: poll ragie_document_get until status is ready.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `data` (`string`, required): New document content as plain text, or as a JSON object. Example: "Refunds are accepted within 60 days of purchase."
- `document_id` (`string`, required): ID of the document. Get it from ragie_documents_list or from the response of a create tool.
- `partition` (`string`, optional): Partition to scope this request to. Omit to use the account default (the default partition for accounts created after 2025-01-09; older accounts without strict partition scoping search all partitions). Partition names are lowercase alphanumeric and may include _ and -.

Example input: `{"data":"Refunds are accepted within 60 days of purchase.","document_id":"<document_id>"}`

### `ragie_instruction_create`

Create Instruction · Write

Create an instruction that extracts structured entities from documents as they are created or updated.
Returns the new instruction with its id, name, prompt, entity_schema, scope, active flag and timestamps.
Use ragie_instruction_create to define automatic extraction. Extracted data is read with ragie_entities_list_by_document or ragie_entities_list_by_instruction.
The name must be unique.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `entity_schema` (`object`, required): JSON Schema describing the structure of each extracted entity. Example: {"type": "object", "properties": {"parties": {"type": "array", "items": {"type": "string"}}}, "required": ["parties"]}.
- `name` (`string`, required): Unique name for the instruction. Example: Contract Parties
- `prompt` (`string`, required): Natural-language instruction applied to each document or chunk. The result is stored as an entity matching entity_schema. Example: Extract the names of all parties to the contract.
- `active` (`boolean`, optional): Whether the instruction runs on documents when they are created or their file is updated. Defaults to true. Default: `true`.
- `context_template` (`string`, optional): Optional mustache-style template prepended to the content sent for extraction. Variables include document.name, document.type, document.source and document.metadata values. Example: Document: {{document.name}}
- `filter` (`object`, optional): Metadata filter; the instruction runs only on documents whose metadata matches. Example: {"department": {"$eq": "legal"}}.
- `partition` (`string`, optional): Partition the instruction applies to. If set, it runs only for documents in that partition.
- `scope` (`string`, optional): Whether the instruction runs on the whole document or on each chunk. Use document for summaries or sentiment; use chunk for fine-grained extraction. Defaults to chunk. One of: `document`, `chunk`. Default: `chunk`.

Example input: `{"entity_schema":{},"name":"<name>","prompt":"<prompt>"}`

### `ragie_instruction_update`

Update Instruction · Write

Change an existing entity-extraction instruction, such as its name, prompt, schema, scope, filter or active flag.
Returns the updated instruction.
Use ragie_instruction_update to edit or pause an instruction. Use ragie_instruction_create for a new one.
Requires an instruction id from ragie_instructions_list. Only the fields you provide are changed.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `instruction_id` (`string`, required): ID of the instruction. Get it from ragie_instructions_list.
- `active` (`boolean`, optional): Whether the instruction runs on documents when they are created or updated.
- `context_template` (`string`, optional): New mustache-style template prepended to the content sent for extraction.
- `entity_schema` (`object`, optional): New JSON Schema for the extracted entities.
- `filter` (`object`, optional): New metadata filter; the instruction runs only on documents whose metadata matches.
- `name` (`string`, optional): New unique name for the instruction.
- `prompt` (`string`, optional): New natural-language instruction applied to documents.
- `scope` (`string`, optional): Run on the whole document or on each chunk. One of: `document`, `chunk`.

Example input: `{"instruction_id":"<instruction_id>"}`

### `ragie_partition_create`

Create Partition · Write

Create a partition to isolate a set of documents, optionally with monthly or maximum usage limits.
Returns the new partition with name, is_default, description, context_aware, metadata_schema and limits.
Use ragie_partition_create to set up a partition ahead of time with limits. Partitions are also created automatically when a document is added to a new partition name.
Names must be lowercase alphanumeric and may include _ and -.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `name` (`string`, required): Partition name: lowercase letters and digits, with _ and - allowed. Example: customer-acme
- `description` (`string`, optional): Description of the partition. Example: Documents for the Acme customer.
- `metadata_schema` (`object`, optional): Optional JSON Schema subset describing the metadata of documents in this partition, used to generate filters. Detailed field descriptions help LLMs build filters. Example: {"department": {"type": "string", "description": "Owning department"}}.
- `pages_hosted_limit_max` (`integer`, optional): Maximum limit, in pages, for hosted documents in the partition.
- `pages_hosted_limit_monthly` (`integer`, optional): Monthly limit of hosted pages added in the current month in the partition.
- `pages_processed_limit_max` (`integer`, optional): Maximum limit, in pages, for processed documents in the partition.
- `pages_processed_limit_monthly` (`integer`, optional): Monthly limit, in pages, for processed documents in the partition.

Example input: `{"name":"<name>"}`

### `ragie_partition_update`

Update Partition · Write

Change a partition's description, context-aware setting or metadata schema.
Returns the updated partition with name, description, context_aware, metadata_schema, limits and stats.
Use ragie_partition_update to edit an existing partition. Use ragie_partition_create for a new one.
Requires a partition name from ragie_partitions_list. Only the fields you provide are changed.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `partition_id` (`string`, required): Name of the partition (its identifier). Get it from ragie_partitions_list.
- `context_aware` (`boolean`, optional): Enable context-aware descriptions for the partition.
- `description` (`string`, optional): New description of the partition.
- `metadata_schema` (`object`, optional): New metadata schema for the partition, as a map of field name to JSON Schema, used to generate filters.

Example input: `{"partition_id":"<partition_id>"}`

### `ragie_document_delete`

Delete Document · Destructive

Permanently delete a document and its chunks from Ragie.
Returns a status field for the deletion.
Use ragie_document_delete only when the document should be gone for good; it cannot be undone.
Requires a document id from ragie_documents_list.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `document_id` (`string`, required): ID of the document. Get it from ragie_documents_list or from the response of a create tool.
- `async` (`boolean`, optional): Delete in the background. If true, deletion runs asynchronously. Defaults to false.
- `partition` (`string`, optional): Partition to scope this request to. Omit to use the account default (the default partition for accounts created after 2025-01-09; older accounts without strict partition scoping search all partitions). Partition names are lowercase alphanumeric and may include _ and -.

Example input: `{"document_id":"<document_id>"}`

### `ragie_instruction_delete`

Delete Instruction · Destructive

Delete an entity-extraction instruction.
Returns a status field for the deletion.
Use ragie_instruction_delete to remove an instruction for good. Use ragie_instruction_update with active set to false to pause it instead.
Requires an instruction id from ragie_instructions_list.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `instruction_id` (`string`, required): ID of the instruction. Get it from ragie_instructions_list.

Example input: `{"instruction_id":"<instruction_id>"}`

### `ragie_partition_delete`

Delete Partition · Destructive

Delete a partition and all documents inside it.
Returns a message field confirming the deletion.
Use ragie_partition_delete only when the whole partition and its documents should be gone for good; it cannot be undone.
Requires a partition name from ragie_partitions_list.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `partition_id` (`string`, required): Name of the partition (its identifier). Get it from ragie_partitions_list.
- `async` (`boolean`, optional): Delete in the background. If true, deletion runs asynchronously. Defaults to false.

Example input: `{"partition_id":"<partition_id>"}`

## Related

Other AI connectors ([all 134](/agentkit/connectors/?category=ai)):

- [Chorus](/agentkit/connectors/chorus/): Scalekit connector, Username and password, 9 tools
- [Gong](/agentkit/connectors/gong/): Scalekit connector, OAuth, 69 tools
- [Jiminny](/agentkit/connectors/jiminny/): Scalekit connector, Access token, 27 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
