# Manage API Keys
Source: https://docs.agents.kolena.com/api-keys
Manage API Keys for Programmatic Connections
## Using API Keys
The HTTP API and Python client use API keys for authentication in the following ways:
| Option | How To Use API Key |
| - | - |
| [HTTP API](/api-reference/quickstart) | Set API Key as Authorization bearer token in requests |
| [Python client](/python-client/quickstart) | Set API Key to `KOLENA_API_KEY` environment variable |
## Personal API Keys
Open your user profile at the bottom of the sidebar, click "Profile Settings", then switch to the "API Keys" tab.
From here you can create new Keys and revoke existing ones.
All personal API Keys have the same roles and permissions as your user.
## Service Users and API Keys
This is available on the Enterprise Plan. [Contact Kolena](mailto:support@kolena.com) if you’re not on an Enterprise plan but would like to try this feature.
Service users can be created with API Keys associated to them.
This allows you to create Keys that are not tied to a specific user's membership in your Organization or their roles and permissions.
Organization `admin`s can create service users and API Keys from the "API Keys" tab on [your Organization page](https://agents.kolena.com/organization?tab=api-keys).
Creating an API Key from this modal will also create a service user.
This service user has a default Organization role which you can manage, and can be [given permissions on individual agents](/fine-grained-access-control) like any other Organization user.
## Managing API Keys Across Your Organization
Organization `admin`s can manage and revoke API keys for their team members and service users through the "API Keys" tab on [your Organization page](https://agents.kolena.com/organization?tab=api-keys).
## Programmatic API Key Management
Users can programmatically manage their API keys for automated rotation and monitoring workflows.
See the [API reference](/api-reference/create-api-key) or the [Python client guide](/python-client/quickstart#manage-api-keys)
### API Key Expiration
This is available on the Enterprise Plan. [Contact Kolena](mailto:support@kolena.com) if you’re not on an Enterprise plan but would like to try this feature.
Organization administrators can configure organization-wide API key expiration policies from the "Data & Security" tab on [your Organization page](https://agents.kolena.com/organization?tab=data-and-security):
* **Organization-level policies**: Admins can require all keys to have an expiration date and set maximum allowed expiration periods for compliance
* **Individual key expirations**: When creating new API keys, users can set expiration dates that don't exceed organization policies
* **Expiration notifications**: Configure email alerts to be sent a specified number of days before key expiration to both administrators and the key owner
# Add Agent Run
Source: https://docs.agents.kolena.com/api-reference/add-agent-run
openapi.json POST /api/v1/client/agents/{agent_id}/runs
Push data to an Agent Run
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
# Add Agent Run (and Wait)
Source: https://docs.agents.kolena.com/api-reference/add-agent-run-wait
openapi.json POST /api/v1/client/agents/{agent_id}/runs/wait
Push data to an Agent Run and wait for results
#### Rate Limits
This endpoint is rate limited based on your Organization tier:
| Organization Tier | Rate Limit (requests/minute) |
| - | - |
| Starter | 10 |
| Professional | 20 |
| Enterprise | 40 |
Rate limits are applied per Organization.
#### Behavior
This endpoint accepts data to create an Agent Run.
If the results from all Prompts are available within the requested `timeout` period, the response will include the completed Agent Run with results.
Otherwise, the response will contain a `status` of `running` and a `run_id` which can be used to [fetch the results](/api-reference/get-agent-run) later.
Compared to the [Add Agent Run](/api-reference/add-agent-run) endpoint, this endpoint is synchronous and attempts to wait for the Agent Run to complete before returning results.
Requests are processed with higher priority when resources are available, but the endpoint is rate limited more strictly.
#### Handling Timeouts
If the Agent Run takes longer than the request timeout period to complete, this endpoint will return the Agent Run in a `running` status. In such cases:
1. The response will indicate the Run is still in progress
2. You can use the [Get Agent Run](/api-reference/get-agent-run) endpoint to fetch the results later by providing the same `run_id`
#### Tips to Avoid Timeouts
To reduce the likelihood of timeouts when using this endpoint:
1. **Use smaller inputs** - Upload inputs with minimal content and fewer prompts
2. **Disable "Data Analysis"** - If your Agent has Data Analysis enabled, consider disabling it for faster processing
3. **Batch your requests** - For large volumes of data, consider using the non-waiting version ([Add Agent Run](/api-reference/add-agent-run)) and poll for results
# Copy Agent
Source: https://docs.agents.kolena.com/api-reference/copy-agent
openapi.json POST /api/v1/client/agents/{agent_id}/copy
Make a copy of an existing Agent
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
# Create API Key
Source: https://docs.agents.kolena.com/api-reference/create-api-key
openapi.json POST /api/v1/client/api-keys
Create a new API key for the current user
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
**Important**: The `api_key` secret is only returned once during creation. Save it immediately in a secure location.
# Delete Agent Run
Source: https://docs.agents.kolena.com/api-reference/delete-agent-run
openapi.json DELETE /api/v1/client/agents/{agent_id}/runs/{run_id}
Delete Agent Run, including underlying files
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
# Delete API Key
Source: https://docs.agents.kolena.com/api-reference/delete-api-key
openapi.json DELETE /api/v1/client/api-keys/{key_id}
Delete a specific API key owned by current user
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
This endpoint is idempotent - deleting a non-existent key returns success (204 No Content).
# Download Agent Run Templated Output
Source: https://docs.agents.kolena.com/api-reference/download-agent-run-templated-output
openapi.json POST /api/v1/client/agents/{agent_id}/runs/{run_id}/templated-output
Download an Agent Run into a [Templated Output](/templated-outputs)
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
# Get Agent
Source: https://docs.agents.kolena.com/api-reference/get-agent
openapi.json GET /api/v1/client/agents/{agent_id}
Return a single Agent
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
# Get Agent Run
Source: https://docs.agents.kolena.com/api-reference/get-agent-run
openapi.json GET /api/v1/client/agents/{agent_id}/runs/{run_id}
Return a single Run for an Agent, including results
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
# Get API Key
Source: https://docs.agents.kolena.com/api-reference/get-api-key
openapi.json GET /api/v1/client/api-keys/{key_id}
Retrieve details for a specific API key owned by current user
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
# Create Ground Truth
Source: https://docs.agents.kolena.com/api-reference/ground-truths/create-ground-truth
openapi.json POST /api/v1/client/agents/{agent_id}/ground_truths
Create a new Ground Truth for an Agent
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
# Create Ground Truth Version
Source: https://docs.agents.kolena.com/api-reference/ground-truths/create-ground-truth-version
openapi.json POST /api/v1/client/agents/{agent_id}/ground_truths/{ground_truth_id}/versions
Create a new version of a Ground Truth for an Agent
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
# Create Validation
Source: https://docs.agents.kolena.com/api-reference/ground-truths/create-validation
openapi.json POST /api/v1/client/agents/{agent_id}/ground_truths/{ground_truth_id}/validations
Create a Validation for a Ground Truth
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
# Delete Ground Truth
Source: https://docs.agents.kolena.com/api-reference/ground-truths/delete-ground-truth
openapi.json DELETE /api/v1/client/agents/{agent_id}/ground_truths/{ground_truth_id}
Delete a Ground Truth for an Agent
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
# Delete Validation
Source: https://docs.agents.kolena.com/api-reference/ground-truths/delete-validation
openapi.json DELETE /api/v1/client/agents/{agent_id}/ground_truths/{ground_truth_id}/validations/{validation_id}
Delete a Validation for a Ground Truth
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
# Get Ground Truth
Source: https://docs.agents.kolena.com/api-reference/ground-truths/get-ground-truth
openapi.json GET /api/v1/client/agents/{agent_id}/ground_truths/{ground_truth_id}
Return Ground Truth for Agent
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
# Get Ground Truth Version
Source: https://docs.agents.kolena.com/api-reference/ground-truths/get-ground-truth-version
openapi.json GET /api/v1/client/agents/{agent_id}/ground_truths/{ground_truth_id}/versions/{version}
Return a specific version of a Ground Truth for an Agent
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
# Get Validation
Source: https://docs.agents.kolena.com/api-reference/ground-truths/get-validation
openapi.json GET /api/v1/client/agents/{agent_id}/ground_truths/{ground_truth_id}/validations/{validation_id}
Return a Validation result for a Ground Truth
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
# List Ground Truths
Source: https://docs.agents.kolena.com/api-reference/ground-truths/list-ground-truth
openapi.json GET /api/v1/client/agents/{agent_id}/ground_truths
Return all Ground Truths for Agent
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
# List Ground Truth Versions
Source: https://docs.agents.kolena.com/api-reference/ground-truths/list-ground-truth-versions
openapi.json GET /api/v1/client/agents/{agent_id}/ground_truths/{ground_truth_id}/versions
Return all versions of a Ground Truth for an Agent
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
# List Validations
Source: https://docs.agents.kolena.com/api-reference/ground-truths/list-validations
openapi.json GET /api/v1/client/agents/{agent_id}/ground_truths/{ground_truth_id}/validations
Return all Validation results for a Ground Truth
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
# List Agent Runs
Source: https://docs.agents.kolena.com/api-reference/list-agent-runs
openapi.json GET /api/v1/client/agents/{agent_id}/runs
Return all Runs for an Agent, including results
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
# List Agents
Source: https://docs.agents.kolena.com/api-reference/list-agents
openapi.json GET /api/v1/client/agents
Return all Agents
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
# List API Keys
Source: https://docs.agents.kolena.com/api-reference/list-api-keys
openapi.json GET /api/v1/client/api-keys
List all API keys owned by current user
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
Only keys belonging to the authenticating user are returned. Users cannot see keys from other users.
# List Usage Records
Source: https://docs.agents.kolena.com/api-reference/list-usage-records
openapi.json GET /api/v1/client/usage
List billed credit usage records for your account, scoped to accessible workspaces
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
## Multiple Usage Records per Run
A Run can have separate usage records for Prompt executions and document processing.
These records may be split further by cost type or credit grant.
A single Run can therefore have several records with the same `run_id` and `type: "agent_run"`.
The response does not include Prompt IDs, cost types, or credit grants, so records may look alike. Keep each record when calculating usage.
# List Workspaces
Source: https://docs.agents.kolena.com/api-reference/list-workspaces
openapi.json GET /api/v1/client/workspaces
Return all Workspaces
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
# Query Access Logs
Source: https://docs.agents.kolena.com/api-reference/query-access-logs
PUT /api/v1/client/access-logs/query
Query access logs
This is available on the Enterprise Plan. [Contact Kolena](mailto:support@kolena.com) if you’re not on an Enterprise plan but would like to try this feature.
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
# Quickstart Guide
Source: https://docs.agents.kolena.com/api-reference/quickstart
Call Agents using the Kolena API
The Kolena API provides a straight forward way to push data to your Agents and retrieve results.
## Create an Agent in the Web UI
We recommend creating your Agent in the web UI at [https://agents.kolena.com](https://agents.kolena.com).
This is the easiest way to create prompts and validate results on a sample set of files.
See our guide on [Creating an Agent](/quickstart#creating-the-agent) for more details.
Once you have created your Agent, you can call its API methods by using its `agent_id`.
You can find this in the URL of the Agent page or by clicking the "Copy Agent ID" button on the Agent's overview page next to the Agent name.
## Push Data to an Agent
Once you have an Agent created, upload files to a new Run using the [`POST /api/v1/client/agents/{agent_id}/runs`](/api-reference/add-agent-run) method.
Files are uploaded as multipart form data in this request.
The response body will be a JSON object containing the `run_id`, which you can use to retrieve results later.
To authenticate your API requests, you need to set the `Authorization` header with your API key. See [Managing API Keys](/api-keys) for details.
## Retrieve Results from an Agent
Results for an Agent Run can be retrieved using the [`GET /api/v1/client/agents/{agent_id}/runs`](/api-reference/list-agent-runs) method.
This will return a list of all Runs for the Agent.
Optionally, you can retrieve a single Run using the `run_id` query parameter.
The response body is a JSON object of the following format:
```json theme={null}
{
"agent_id": 1,
"run_id": 1,
"run_url": "https://agents.kolena.com/my_org/agents/1/runs/1",
"created": "2025-01-01T00:00:00",
"updated": "2025-01-05T00:00:00",
"files": [
"demo1.pdf",
"demo2.csv"
],
"order": [
"prompt_1",
"prompt_2"
],
"status": "success",
"data": {
"prompt_1": {
"status": "success",
"metadata": {
"citations": [
{
"file": "demo1.pdf",
"pages": [
2,
5
]
}
],
"confidence": 1,
"reasoning": "Looking at file demo1.pdf, ..."
},
"value": "foo"
},
"prompt_2": {
"status": "success",
"metadata": {
"citations": [
{
"file": "demo2.csv",
"pages": []
}
],
"confidence": 1,
"reasoning": "The order amount is listed in demo2.csv"
},
"value": 123
}
}
}
```
Note in particular the `data` field, which contains the results of the Agent Run.
`data` is a dictionary keyed by the Prompt names you created in the Web UI for the Agent.
Each entry in `data` contains the results for that Prompt, including:
* `value`: The actual result value returned by the Agent for that Prompt.
* `metadata`: Additional information about the result, such as reasoning and citations.
The `metadata.confidence` field is deprecated and is no longer populated with a real confidence score. When present, the value is typically `1.0` and should not be used to assess result quality or uncertainty.
Results can also be retrieved using a [webhook](/webhook).
## Get Agents information
You can list all Agents using the [`GET /api/v1/client/agents`](/api-reference/list-agents) method, and get specific
Agent information using the [`GET /api/v1/client/agents/{agent_id}`](/api-reference/get-agent) method.
# Update Agent
Source: https://docs.agents.kolena.com/api-reference/update-agent
openapi.json PATCH /api/v1/client/agents/{agent_id}
Update properties of an Agent
**Rate Limit:** This endpoint is limited to ** requests per minute** per user.
## Overview
Update properties of an Agent.
Only `metadata` is currently supported for updates.
# Overview
Source: https://docs.agents.kolena.com/connecting-to-kolena
Options for Programatic Connection to Kolena
Kolena Agents can be connected to your data using app-level integrations such as [Sharepoint, Cloud Storage, and other means](/connections).
If you require fine-grained control of your data or want to build a custom integration, you can connect to Kolena programmatically using any of the following options:
| Option | When To Use |
| - | - |
| [HTTP API](/api-reference/quickstart) | Use this option if you want to connect to Kolena from any programming language or framework. This API exposes basic methods for adding new Runs and polling the results for an Agent. |
| [Python client](/python-client/quickstart) | Use this option if you need to connect to Kolena from Python only. |
| [Webhook](/webhook) | Use this option if you want to receive real-time results from Kolena about your Agents and Runs. Webhooks allow you to build custom integrations that respond to events in Kolena. |
# Overview
Source: https://docs.agents.kolena.com/connections
Automate bringing documents into your Agent and sending its results to an Integration
**Integrations** allow your Agent to connect directly with third-party applications and services.
An Integration either brings documents into an Agent or sends its results out:
* **Input**: documents coming into the Agent
* **Output**: results going out of the Agent
[See the full list of all supported integrations here](/connections/supported) and steps on how to integrate with them.
Agents can also be connected using our [API](/api-reference/add-agent-run) or [Python Client](/python-client/quickstart).
## Configuring Integrations
Integrations are configured for each Agent from the Workflow graph on the main Agent page.
The Workflow graph starts at an **Input** node and ends at an **Output** node, with the Agent's Prompts in between.
Each node lists what is currently connected to it. Clicking a node opens a panel where you can manage it:
* From the **Input** node, click "Upload Files" to add documents yourself, or "Import from Integration" to bring them in automatically.
* From the **Output** node, click "Add Output Template" to shape the results, or "Send to Integration" to send them somewhere.
On a large Agent, use the "Jump to" control above the graph to bring the Input or Output node back into view.
An Integration you connect is available to every Agent in the Workspace, and sharing one lets other people attach it to their own Agents. To view your integrations, open your user profile at the bottom of the sidebar, click "Profile Settings", then switch to the "Integrations" tab.
Administrators, and anyone with a [Custom Role](/custom-roles) granting the "View Integration" action, can see every Integration connected across the Organization from the "Integrations" tab on the Organization page.
## How Integrations Work
### Input Integrations
If documents come in from a file storage system (e.g. Box, Google Drive, S3), the Agent will automatically watch it for new files.
When new files are detected, the Agent will create new Runs to process those files.
See [Cloud Folder Sync](/connections/cloud-folder-sync) for details on how folders are kept in sync.
An Input Integration can read files in two different patterns:
1. **Import Files Separately**: Each file in the connected location is processed as a separate Run.
2. **Group Files Together**: All files in a sub-folder pattern are processed together, where each sub-folder's content as a single run by the Agent.
### Output Integrations
If results go out to a file storage system (e.g. Box, Google Drive, S3), the Agent will write output files to it after each Run is completed.
An Output Integration can write files in two different patterns:
1. **Write to Directory**: Each Run by the Agent produces output files sent to the Integration.
2. **Write to File**: Each Run by the Agent produces a row in a single output spreadsheet.
You can send your results to an Integration as PDF, Word, Excel, CSV, JSON, or Powerpoints.
You can also use [templates](/templated-outputs) to customize the format of your output files.
### Example Workflows
These patterns can be combined.
Let's consider how to model some example workflows:
#### Lease Abstraction
Suppose you have multiple lease documents and amendments for various properties stored in a Box.com folder:
```
/Leases
/Leases/Property_A/Lease.pdf
/Leases/Property_A/Amendment_1.pdf
/Leases/Property_A/Amendment_2.pdf
/Leases/Property_B/Lease.pdf
/Leases/Property_B/Amendment_1.pdf
```
and you want to generate an abstract file for each property.
In this case, you would bring documents in from the Box.com folder, grouping files by subfolder (i.e., Property\_A, Property\_B) so that each property's documents are processed as a single run.
The output can then be sent to another Box.com folder, with one output file per run.
#### Utility Bill Extraction
Suppose you have a folder of utility bills in Google Drive which you want to extract key details into a table, which one row per bill:
```
/Bills
/Bills/Bill_001.pdf
/Bills/Bill_002.pdf
/Bills/Bill_003.pdf
```
In this case, you would bring documents in from the Google Drive folder and send results out to a single Google Sheet.
The output of each runs will be synced to a new row in the Google Sheet.
## FAQ
### I've connected an Integration, when will my Agent start processing files?
Files already in the connected location are imported when the Integration is added, and new files are typically detected within a minute or two of being added.
For Integrations that group files together, Kolena waits until a sub-folder has been quiet for 5 minutes before processing it, so it may take up to five minutes before new runs are created.
When connecting a folder that already contains a large number of files, the initial import happens in batches and may take some time to complete. See [Cloud Folder Sync](/connections/cloud-folder-sync#bulk-additions-and-large-folders) for details.
### How many Integrations can I add to my Agent?
A single Agent can have multiple Integrations bringing documents in and sending results out.
### What happens if I add a new file to a connected folder?
For Integrations where files are imported separately:
* If a new file is added, Kolena will create a new run for that file
For Integrations where files are grouped together:
* If a new file is added to a sub-folder, Kolena will create a new run if one does not exist or update an existing run if one already exists for that grouping.
### What happens if I remove a file from a connected folder?
By default, Kolena will not delete or update existing runs if a file is removed.
Grouped folder Integrations on Box, Google Drive, and SharePoint can opt in to [syncing deletions](/connections/cloud-folder-sync#syncing-deletions), which removes deleted files from their Runs and either re-runs the affected Runs or marks them as stale.
### What happens if I move a file into or within a connected folder?
A file moved or copied into a synced folder is imported the same as a new file, even if the file itself is old.
For files moved between sub-folders within a synced folder, the file is imported at its new location; the copy at the old location is only removed if [syncing deletions](/connections/cloud-folder-sync#syncing-deletions) is enabled.
### What happens if I delete a Run or file in Kolena?
The deletion is permanent: syncing will not re-import the file from the same location, even during a full re-scan.
If the file later appears in a different location, it is treated as new and imported there.
### What happens if I update a file in a connected folder?
If you update the content of an existing file, Kolena will not automatically re-process the updated files or refresh existing runs.
# Cloud Folder Sync
Source: https://docs.agents.kolena.com/connections/cloud-folder-sync
How Kolena keeps your Agents in sync with cloud storage folders
When a folder from a [cloud storage integration](/connections/supported) (Box, Google Drive, SharePoint, Amazon S3, or Azure Blob Storage) is used as an input to an Agent, Kolena keeps the Agent in sync with it automatically.
The files already in the folder are imported when the Integration is added, and from then on the folder and all of its subfolders are monitored for changes.
## Change Detection
For Box, Google Drive, and SharePoint, Kolena reads the provider's change feed and only processes what has changed since the last check.
For Amazon S3 and Azure Blob Storage, Kolena periodically lists the folder and imports files it has not seen before.
Each Integration is checked about once a minute.
## How Changes Are Handled
| Change in the cloud folder | What Kolena does |
| - | - |
| File added | Creates a new Run (or, for grouped Integrations, adds the file to its subfolder's Run) |
| File moved or copied into the folder | Imports it the same as a new file, even if the file is old |
| Subfolder moved or copied into the folder | Imports all files inside it |
| File edited in place | Nothing. Existing Runs are not automatically re-processed |
| File deleted or moved out of the folder | Nothing, unless [deletion sync](#syncing-deletions) is enabled |
Hidden system files (e.g. `.DS_Store`, `Thumbs.db`, `desktop.ini`) and Microsoft Office temporary lock files are never imported.
If you delete a Run or file in Kolena, syncing will not re-import that file from the same location, even during a full re-scan.
## Grouped Folders
When an Integration groups files together, each subfolder becomes a single Run containing every file nested beneath it.
To avoid processing a folder while files are still being uploaded to it, Kolena waits until a subfolder has had no new file activity for 5 minutes before creating or updating its Run.
When a file is added to a subfolder that already has a Run, the file is added to the existing Run and its Prompts are re-run.
Manual edits to the Run's results are preserved.
## Syncing Deletions
By default, deleting a file in the cloud folder never changes existing Runs in Kolena.
Grouped Integrations on Box, Google Drive, and SharePoint can enable **Sync cloud deletions** when configuring the Integration.
[Contact Kolena](mailto:support@kolena.com) to enable this feature for your organization.
When enabled, files deleted or moved out of the folder are also removed from their Runs.
The **On File Delete** setting controls what happens to the affected Run: **Re-run Prompts** (the default) re-processes the Run with its remaining files, while **Mark Run as stale** keeps the existing results and flags them as out of date so you can re-run later.
Runs themselves are never deleted automatically. A Run whose files are all removed is kept and marked stale.
## Bulk Additions and Large Folders
When many files arrive at once, or when a folder that already contains many files is first connected, the files are imported in batches over successive checks.
No files are skipped. Large imports simply take longer to complete, and new files added in the meantime are still detected and imported.
The standard [file limits](/faq/supported-formats#are-there-limits-on-file-uploads) apply to files imported from cloud Integrations.
Files exceeding the limits appear on the Run with an error message rather than being silently skipped.
# Supported Integrations
Source: https://docs.agents.kolena.com/connections/supported
List of Available Integrations to Connect Your Agents
Below are all supported integrations and steps on how to integrate with them.
Agents can also be connected using our [API](/api-reference/add-agent-run) or [Python Client](/python-client/quickstart).
If you do not see an Integration you'd like to use, contact us and we will prioritize support!
##
Amazon S3
Amazon S3 can be used as an input to an Agent, or an output for its results. To connect an Amazon S3 bucket to an Agent:
- Navigate to the Agent you wish to connect
- From the Workflow graph, click the "Input" node and then "Import from Integration", or click the "Output" node and then "Send to Integration"
- If an Amazon S3 integration already exists, click "Select" under "Amazon S3" and choose an account. Otherwise, click "Connect" and follow the configuration steps below:
Step 1: Specify Bucket(s)
- Enter the bucket name(s) you wish to connect
- Click "Continue"
Step 2: Create Access Policy
- Copy the "Access Policy" JSON
- In your AWS console:
- Navigate to IAM Policies page
- Click "Create Policy" and select the "JSON" tab
- Paste the copied JSON
- Click through the "Next" buttons, adding the desired name, description, and tags
Step 3: Create Trust Policy
- Copy the "Trust Policy" JSON
- In your AWS console:
- Navigate to IAM Roles page
- Click "Create Role" and select "Custom trust policy"
- Paste the copied JSON
- Search for and select the access policy created in Step 2. Click "Next"
- Provide a role name and review the permissions, then click "Create role"
- Copy the role's ARN for use in the next step
Step 4: Save Integration
- In Kolena, click "Continue"
- Enter the ARN of the role created in Step 3
- Click "Finish"
- Select the bucket and folder you wish to connect to
## Azure Blob Storage
Azure Blob Storage can be used as an input to an Agent, or an output for its results. To connect Azure Blob Storage to an Agent:
- Navigate to the Agent you wish to connect
- From the Workflow graph, click the "Input" node and then "Import from Integration", or click the "Output" node and then "Send to Integration"
- If an Azure Blob Storage integration already exists, click "Select" under "Azure Blob Storage" and choose an account. Otherwise, click "Connect" and follow the configuration steps below:
Step 1: Create Azure App Registration for Kolena
- From the Azure portal, search for "App registrations" and navigate to this page
- Click "New Registration"
- Under "Supported account types", select "Accounts in any organizational directory"
- Click "Register" to save the App registration
- Click on the App registration you have created
- Note the "Tenant ID" and "Application (client) ID"
- Click "Certificates & secrets", then "New client secret"
- Click "Add" to save this secret and note the key value
Step 2: Assign Roles to App Registration
Assign Storage Blob Delegator Role
- Navigate to the storage account containing your blobs
- Click "Access Control (IAM)"
- Click the "Role assignments" tab
- Click "Add", then "Add role assignment"
- Search for and select "Storage Blob Delegator"
- Click on the "Members" tab, then click "Select members"
- Search for the App registration created in Step 1
- Click "Select"
- Click "Review + assign" to save
Assign Storage Blob Data Reader Role
- From the storage account, click "Containers" under "Data Storage" and click on the container containing your blobs
- Click "Access Control (IAM)"
- Click the "Role assignments" tab
- Click "Add", then "Add role assignment"
- Search for and select "Storage Blob Data Reader"
- Click on the "Members" tab, then click "Select members"
- Search for the App registration created in Step 1
- Click "Select"
- Click "Review + assign" to save
- (Optional) Repeat the steps above for any additional containers you wish to connect
Assign Storage Blob Data Contributor Role
- From the storage account, click "Containers" under "Data Storage" and click on the container containing your blobs
- Click "Access Control (IAM)"
- Click the "Role assignments" tab
- Click "Add", then "Add role assignment"
- Search for and select "Storage Blob Data Contributor"
- Click on the "Members" tab, then click "Select members"
- Search for the App registration created in Step 1
- Click "Select"
- Click "Review + assign" to save
- (Optional) Repeat the steps above for any additional containers you wish to connect
Step 3: Save Integration
- In Kolena, fill in the fields for the integration:
- **Tenant ID**: The Directory (tenant) ID of the App registration created in Step 1
- **Client ID**: The Application (client) ID of the App registration created in Step 1
- **Client Secret**: The secret key for the App registration created in Step 1
- **Storage Account Name**: The storage account in Azure you wish to connect to
- **Storage Blob Endpoint URL**: The endpoint for accessing the storage account. Can be found in "Endpoints" under "Settings" for your storage account. Usually of the form `https://.blob.core.windows.net`
- **Container(s)**: The Azure storage container(s) to which you granted role permissions in Step 2
- Click "Finish"
- Select the container and folder you wish to connect to
##
Box can be used as an input to an Agent, or an output for its results. To connect a Box account to an Agent:
1. Navigate to the Agent you wish to connect
2. From the Workflow graph, click the "Input" node and then "Import from Integration", or click the "Output" node and then "Send to Integration"
3. If a Box integration already exists, click "Select" under "Box" and choose an account. Otherwise, click "Connect" and click to authorize access
4. Select the folder you wish to connect to
## Email
Agents can be set up to receive documents by email, or to email their results out. To connect an email address to an Agent:
- Navigate to the Agent you wish to connect
- From the Workflow graph, click the "Input" node and then "Import from Integration", or click the "Output" node and then "Send to Integration"
- Select the "Email" integration
- If the Agent should receive emails:
- Copy the recipient email address (this is where emails must be sent to)
- The recipient address can also optionally be modified
- (Optional) Specify a sender or domain the email must be sent from. If omitted, the Agent will accept emails from any email address
- Click "Confirm"
- Send or forward emails to the recipient address
- Automatic forwarding can be configured in your email provider, e.g. [Gmail](https://support.google.com/mail/answer/10957?hl=en) or [Outlook](https://support.microsoft.com/en-us/office/turn-on-automatic-forwarding-in-outlook-7f2670a1-7fff-4475-8a3c-5822d63b0c8e). Note that for Gmail forwarding, Kolena will automatically handle the verification step for the provided recipient address
- **File Size Limits**: For reliable delivery, keep emails under 30 MB in total size, including all attachments. Emails larger than this may fail to be received and processed.
- If the Agent should send emails:
- Specify a recipient email address
An Agent can send emails to a fixed recipient address, or dynamically generate the recipient address, subject, and body based on the Agent's output. To do this:
- Create a Prompt for the Agent with output type `Text`.
- Select this Prompt from the "To:", "Subject:", or "Body:" fields.
- A Prompt used for the "To:" field can return multiple recipients in a single run - separate the addresses with commas, semicolons, or new lines, and the email will be sent to all of them.
- For a given run, every address the "To:" Prompt returns must be a valid email. If any address is invalid or missing, that run is marked "Failed to Send" (with the invalid value shown) and is retried on later runs; other runs are unaffected.
- (Optional) Modify the generated sender address, or use your own. This is the address the Agent will send emails from
- When using your own email address, you will need to send and accept a verification email for the specified address
- (Optional) Enable "Attach input files" to include the run's original input files as additional email attachments
- **File Size Limits**: Input files are skipped if they would push the email's total size beyond the 20 MB limit. The Agent's output file is always attached.
- Click "Confirm"
## Gmail
Gmail can be used as an input to an Agent. To connect a Gmail account to an Agent:
1. Navigate to the Agent you wish to connect
2. From the Workflow graph, click the "Input" node and then "Import from Integration"
3. If a Gmail integration already exists, click "Select" under "Gmail" and choose an account. Otherwise, click "Connect" and click to authorize access
4. When prompted by Google, ensure you select the following required scopes: **View your email messages and settings.**
5. (Optional) Specify a sender (email address) or labels to filter emails. By default, all emails to the account will be brought in
6. Click "Confirm"
## Google Drive
Google Drive can be used as an input to an Agent, or an output for its results. To connect a Google Drive to an Agent:
1. Navigate to the Agent you wish to connect
2. From the Workflow graph, click the "Input" node and then "Import from Integration", or click the "Output" node and then "Send to Integration"
3. If a Google Drive integration already exists, click "Select" under "Google Drive" and choose an account. Otherwise, click "Connect" and click to authorize access
4. When prompted by Google, ensure you select the following required scopes: **See, edit, create, and delete all of your Google Drive files.**
5. Select the folder you wish to connect to
#### Google Sheet
Results from an Agent can be exported to a spreadsheet in your Google Drive.
Add Google Drive under "Output Integrations" using the instructions above, then:
1. Select "xlsx" as the export format
2. Click "Export as Single Excel File"
The results of the Agent will be sent to a single spreadsheet in the specified location.
Each row will represent the results of a Run for the Agent.
Adding or removing Runs from the Agent will add or remove rows from the Google Sheet, respectively.
## Notion (KMS)
Knowledge Management Systems (KMS) can be configured as prompt documents for your Agents.
Supported systems:
* Notion
To connect a KMS platform:
1. While editing a Prompt, open the attachments menu and click "Connect Cloud Documents"
2. Click the "KMS" card
3. If a KMS integration already exists, click "Select" under "KMS" and choose an account. Otherwise, click "Connect" and click to authorize access
## Salesforce / HubSpot (CRM)
CRM (Customer Relationship Management) systems can receive an Agent's results.
Supported systems:
* Salesforce
* HubSpot
To connect a CRM platform to an Agent:
1. Navigate to the Agent you wish to connect
2. From the Workflow graph, click the "Output" node and then "Send to Integration"
3. Click the "CRM" card
4. If a CRM integration already exists, click "Select" under "CRM" and choose an account. Otherwise, click "Connect" and click to authorize access
Supported objects:
* deal/opportunity
* contact
* company
The results of the Agent will be used to create or update supported objects.
## Sharepoint
Sharepoint can be used as an input to an Agent, or an output for its results. To connect a Sharepoint drive to an Agent:
1. Navigate to the Agent you wish to connect
2. From the Workflow graph, click the "Input" node and then "Import from Integration", or click the "Output" node and then "Send to Integration"
3. If a Sharepoint integration already exists, click "Select" under "Sharepoint" and choose an account. Otherwise, click "Connect" and click to authorize access
4. Select the site you wish to connect to, followed by the drive, and then any directory within the drive
#### Excel
Results from an Agent can be exported to a spreadsheet in your SharePoint.
Add SharePoint under "Output Integrations" using the instructions above, then:
1. Select "xlsx" as the export format
2. Click "Export as Single Excel File"
The results of the Agent will be sent to a single spreadsheet in the specified location.
Each row will represent the results of a Run for the Agent.
Adding or removing Runs from the Agent will add or remove rows from the SharePoint Excel file, respectively.
## Webhook
Check out the [Integrate using Webhooks](/webhook) section for details on setting up your service to receive webhook deliveries. Once the your service is ready, you can follow the steps in this section to register your webhook.
A webhook can receive an Agent's results. To connect a webhook URL to an Agent:
- Navigate to the Agent you wish to connect
- From the Workflow graph, click the "Output" node and then "Send to Integration"
- If a Webhook integration already exists, click "Select" under "Webhook" and choose an account. Otherwise, click "Connect" and follow the configuration steps below:
Step 1: Specify Webhook URL
- Enter the webhook URL you wish to connect, e.g. `https://example.com/webhook/document-agent/results`
- Click "Continue"
Step 2: Save the Secret
- Copy the "secret" and save it securely. Use the secret to validate authenticity and integrity of requests from Kolena
- Click "Finish"
- (Optional) Specify an additional path to the selected webhook URL. The final URL would be `/`
- Click "Confirm"
# Credit Limits
Source: https://docs.agents.kolena.com/credit-limits
Control and manage spending with credit limits
## Overview
Credit limits allow you to set spending limits on credit usage at both the Organization and Workspace levels. When a credit limit is reached, Kolena will automatically prevent further credit consumption to help you stay within budget.
Credit limits are an optional feature available to Organizations on credit-based pricing plans.
All limits are set on a monthly-basis.
Usage resets back to zero at the start of each calendar month.
## How Credit Limits Work
Credit limits enforce spending limits by tracking cumulative credit usage and comparing it against configured thresholds:
* **Organization-level limits:** limit total overage credits across the entire Organization
* **Workspace-level limits:** limit total credits (monthly quota + overage) for specific Workspaces
When a limit is reached:
* New Runs cannot be created
* Prompts already running finish, and are billed as usual
* Prompts that have not started yet fail, including Prompts in a Run that is already in progress
* Failed Prompts are not resumed automatically once the limit is raised or the month rolls over — re-run them from the Agent
* Administrators receive email notifications at 90% and 100% of the limit
## Setting Up Credit Limits
### Organization-Level Overage Limit
The Organization-level limit limits how many overage credits can be consumed beyond your monthly quota.
**To set an Organization-level overage limit:**
1. Click "Manage Organization" from your user profile at the bottom of the sidebar, or navigate to [your Organization page](https://agents.kolena.com/organization)
2. Click the "Usage" button
3. Go to the **Usage Limits** section
4. Click the **Configure Overage Limit** button to set the Organization-level overage limit
For example, if your monthly quota is 10,000 credits and you set an overage limit of 5,000 credits:
* You can use up to 15,000 total credits per month (10,000 quota + 5,000 overage)
* After 15,000 credits, new Prompts and Runs will be blocked until the next month
* Prepaid credits are consumed but not counted toward the overage limit
### Workspace-Level Limit
Workspace-level limits limit the total credits (monthly + overage) that can be consumed by a specific Workspace.
**To set a workspace-level limit:**
1. Click "Manage Organization" from your user profile at the bottom of the sidebar, or navigate to [your Organization page](https://agents.kolena.com/organization)
2. Click the "Usage" button
3. Go to the **Usage Limits** section
4. Click the **Configure Limits** button to set the Workspace-level limit
For example, if you set a Workspace limit at 2,000 credits:
* The Workspace can consume up to 2,000 credits from monthly quota and overage combined
* After 2,000 credits, new Prompts and Runs in that Workspace will be blocked
* Other Workspaces remain unaffected
Workspace-level limits are useful for:
* Allocating budgets across different teams or projects
* Limiting usage for experimental or test Workspaces
* Providing guardrails for new users or pilot projects
## Notifications
Administrators receive email alerts when credit usage approaches or exceeds limits:
### Organization-Level Alerts
* **90% threshold**: Email sent when overage usage reaches 90% of the limit
* **100% threshold**: Email sent when overage usage reaches or exceeds 100% of the limit
Organization administrators receive these notifications.
### Workspace-Level Alerts
* **90% threshold**: Email sent when Workspace usage reaches 90% of the limit
* **100% threshold**: Email sent when Workspace usage reaches or exceeds 100% of the limit
Both Organization administrators and Workspace administrators receive these notifications.
Notifications are sent once per threshold per month. If usage fluctuates below and back above a threshold, a new notification will not be sent until the next month.
## Monitoring Credit Usage
To monitor your credit usage and limits:
1. Visit [your Organization page](https://agents.kolena.com/organization?tab=data-and-security)
2. View the **Usage** section to see:
* Current month's credit consumption
* Monthly quota and remaining credits
* Overage credits used (if applicable)
* Progress toward any configured limits
You can also view detailed credit usage by:
* Individual Agent
* Individual Run
* Workspace
* Time period
See [Tracking Usage](/tracking-usage) for more details on viewing and analyzing credit consumption.
## Responding to Limit Alerts
When you receive a 90% threshold alert:
1. Review current usage patterns in [your Organization page](https://agents.kolena.com/organization?tab=data-and-security)
2. Consider increasing the limit if usage is expected to continue
3. Investigate and optimize prompts or workflows if usage is higher than expected
When a limit is reached (100%):
1. Prompts and Runs cannot proceed until the limit is raised or the next billing period begins
2. Contact your Organization administrator to adjust limits if needed
# Custom Roles
Source: https://docs.agents.kolena.com/custom-roles
Combine Allowed Actions into Custom Roles
This is available on the Enterprise Plan. [Contact Kolena](mailto:support@kolena.com) if you’re not on an Enterprise plan but would like to try this feature.
Kolena has three [default Roles](/user-management#assign-roles) which can be applied to Users or Teams.
In some cases you may wish to define customized Roles.
Example use cases include:
* Restricting access to a true "read-only" role.
* Allowing administrative users the ability to manage billing without being able to modify Agents.
## Defining Custom Roles
Custom Roles can be defined from your [Organization page](https://agents.kolena.com/organization?tab=custom-roles).
Click "Add Custom Role" and then provide a name for the Role and select all actions which the Role will be allowed to perform.
All actions have a **scope** associated to them.
This defines the extent in which the action is allowed.
Actions can be scoped to the **Organization** or to the **Workspace**.
For example:
* "Manage User" with Organization scope allows inviting new Users and controlling membership within the Organization.
* "Manage User" with Workspace scope allows modifying the Roles of all Users and Teams within the Workspace.
### Available Actions
The following actions can be assigned to Custom Roles:
| Scope | Action | Description |
| - | - | - |
| Workspace | View Agent | Allows viewing Agents and all associated data including Prompts, Results, and Dashboards within the Workspace. |
| Workspace | Create Agent Run | Allows uploading files to an Agent and creating new Agent Runs within the Workspace. |
| Workspace | Delete Agent Run | Allows deleting files from an Agent and deleting Agent Runs within the Workspace. |
| Workspace | Create Agent Comment | Allows adding comments to results of Agent Runs within the Workspace. |
| Workspace | Delete Agent | Allows deleting Agents within the Workspace. |
| Workspace | Override Agent Result | Allows overriding the result of Agent Runs within the Workspace. |
| Workspace | Manage Agent Data Retention Policy | Allows managing data retention policies for Agents within the Workspace. |
| Workspace | Manage Agent Connections | Allows connecting new Integrations and attaching them to Agents within the Workspace. Updating or removing an Integration afterwards is limited to the person who connected it, or to a Role with the Organization scoped Manage Integration action. |
| Workspace | Manage Agent Dashboards | Allows managing Dashboards for Agents within the Workspace. |
| Workspace | Manage Agent Prompts | Allows managing Prompts for Agents within the Workspace. |
| Workspace | Manage Agent Model Routing | Allows changing the model routing for Agents within the Workspace, including migrating an Agent to the latest generation of models. |
| Workspace | Manage Agent Permissions | Allows managing permissions for Agents within the Workspace. |
| Workspace | Manage Agent Metadata | Allows managing Metadata (including name, notes, icon) for Agents within the Workspace. |
| Workspace | Manage Agent Validation | Allows managing Ground Truths and Validations for Agents within the Workspace. |
| Workspace | Create Agent | Allows creating new Agents within the Workspace. |
| Workspace | Manage Folder | Allows creating, renaming, and deleting folders within the Workspace, and moving Agents between them. |
| Workspace | View Usage | Allows viewing usage statistics for the Workspace. |
| Workspace | Manage Workspace Data Retention Policy | Allows managing data retention policies for the Workspace. |
| Workspace | ⚠️ Manage User | Allows adding and removing Users and Teams in the Workspace and assigning any Workspace Role. **Equivalent to the `admin` Role within the Workspace** (a holder can grant themselves access to every Agent in it). |
| Organization | View Access Logs | Allows viewing access logs for the Organization. Also allows listing all Workspaces in the Organization. |
| Organization | Manage Data Retention Policy | Allows managing data retention policies for the Organization. |
| Organization | Manage IP Whitelist | Allows managing the IP whitelist for the Organization. |
| Organization | Use API Key | Allows managing and using API keys **associated to your User** within the Organization. |
| Organization | View API Key | Allows viewing all API keys within the Organization. |
| Organization | Manage API Key | Allows creating and revoking all API keys within the Organization. |
| Organization | View Usage | Allows viewing usage statistics for the Organization. Also allows listing all Workspaces in the Organization. |
| Organization | Manage Usage | Allows managing usage settings (limits) for the Organization. Also allows listing all Workspaces in the Organization. |
| Organization | View Integration | Allows viewing every Integration connected in the Organization, including who connected each one and which Agents use it. Also allows listing all Workspaces in the Organization. |
| Organization | Manage Integration | Allows updating, testing, and removing any Integration in the Organization, including ones connected by someone else. |
| Organization | ⚠️ Manage User | Allows adding, removing, and modifying Users, Service Users, and Teams, managing Custom Roles, and configuring directory sync. **Equivalent to the `admin` Role** (a holder can assign any Role, including `admin`, to themselves or anyone else). |
**⚠️ `Manage User` is an administrative action.**
At Organization scope it is equivalent to the `admin` Role: a holder can assign any Role, including `admin`, to themselves, and so can reach every action in the Organization.
At Workspace scope it is equivalent to `admin` within that Workspace.
A Custom Role containing `Manage User` cannot be used to restrict what its holder can reach. Grant it only to Users you would make administrators.
## Assigning Custom Roles
Custom Roles can be assigned in all the same places as the default `viewer`, `editor`, `admin` Roles.
Custom Roles can be assigned to individual Users or to Teams.
Assignments can happen at the Organization level from the [Users tab](https://agents.kolena.com/organization?tab=users) or within individual Workspaces.
If your Organization contains multiple Workspaces, any Custom Role which implements an `Organization` scoped action must be assigned at the Organization level to a User or Team.
**Example:** Suppose you have a Custom Role named `Security Auditor` which contains the `View Access Logs` action (Organization scope) and the `View Agent` action (Workspace scope).
You should assign this role in two places:
1. To Users or Teams from the Organization Users/Teams tab *and*
2. To the same Users or Teams from each Workspace's Roles tab.
# Data Retention
Source: https://docs.agents.kolena.com/data-retention
Automatically Purge Data From Kolena
When you upload files to an Agent, Kolena stores both the files and the Prompt results in cloud storage.
Kolena also retains the source file behind any Ground Truth you convert (for example the spreadsheet or
CSV a Ground Truth was created from).
* Deleting an Agent Run (via UI or API) immediately deletes its files **and** results.
* If you do nothing, the data remains until a retention policy triggers or you delete it manually.
## Setting Retention Policies
This is available on the Enterprise Plan. [Contact Kolena](mailto:support@kolena.com) if you’re not on an Enterprise plan but would like to try this feature.
Data retention policies can be set at three levels: Organization, Workspace, and Agent.
These policies dictate the maximum amount of time data can exist on Kolena before it is automatically purged.
The amount of time is measured from the time the file is initially uploaded to Kolena.
When setting a retention policy, any files, Runs, and Ground Truth source files which are older than the new policy will be immediately and permanently deleted.
For example, setting an Organization policy of one year will delete all files and Runs across **all** Agents which were uploaded more than one year ago.
Ground Truth source files older than the policy are removed as well; the Ground Truth itself (its converted values and versions) is kept, but its original source file can no longer be downloaded or re-converted.
### Organization-Level Policy
An Organization policy can be set by `admin` users through the "Data & Security" tab on [your Organization page](https://agents.kolena.com/organization?tab=data-and-security).
This is the highest-level policy and applies to all Workspaces and Agents within the Organization.
### Workspace-Level Policy
Workspace policies can be set by `admin` users through the "Data & Security" section on the Workspace settings page.
A Workspace policy:
* Applies to all Agents within that Workspace
* Must be equal to or more restrictive than the Organization-level policy (if one is set)
* Overrides the Organization policy for Agents in that Workspace (by being more restrictive)
* Can be removed, in which case the Organization policy will apply
This allows different Workspaces to have different data retention requirements while still maintaining compliance with Organization-wide policies.
### Agent-Level Policy
Agent policies can be set individually on each Agent.
This setting can be found on the main page of the Agent.
An Agent policy:
* Applies only to that specific Agent
* Must comply with both the Workspace policy and Organization policy (if set)
* Provides the most granular control over data retention
* If no Agent policy is set, the Workspace policy (if any) will apply, otherwise the Organization policy will apply
## Chat History
Leonard chat sessions are purged automatically as well:
* If an Organization or Workspace retention policy is set, chats are deleted according to the strictest applicable policy.
* If no retention policy is set, chats are deleted 30 days after creation.
As with files and Runs, the retention window is measured from creation time. Agent-level policies do not apply to chats.
# Data Privacy & Security
Source: https://docs.agents.kolena.com/faq/security
Please see [https://trust.kolena.com/](https://trust.kolena.com/) for privacy policies and security reports, including:
* SOC 2 Type 2 reports
* HIPAA compliance reports
* Pen testing reports
## Is my data used to train AI models?
Data uploaded to Kolena is never used for AI model training.
User interactions and input within Kolena are also never used for AI model training.
## Where is my data stored?
Data uploaded to Kolena is stored in US-based cloud data centers.
All data is encrypted at rest and in transit.
## How can I restrict access to my data?
Access to Kolena can be restricted using the following means:
* **User Access Control:** Manage user roles and permissions to control who can access specific Agents and data within your Organization. Learn more [here](/user-management).
* **IP whitelisting:** Restrict access to Kolena to specific IP addresses or CIDR ranges. This is configurable from the "Data & Security" tab on [your Organization page](https://agents.kolena.com/organization?tab=data-and-security).
## Can I control how long my data stays in Kolena?
Yes. Retention policies for uploaded data can be set.
This allows data to automatically be deleted from Kolena's cloud storage based on fixed time intervals.
Learn more about data retention [here](/data-retention).
## Can I view audit or access logs for usage on Kolena?
This is available on the Enterprise Plan. [Contact Kolena](mailto:support@kolena.com) if you’re not on an Enterprise plan but would like to try this feature.
Yes. All access to your data is logged and auditable. The following attributes are recorded for each user event on Kolena:
* Timestamp
* Workspace
* User
* IP address
* Action (e.g., view agent, upload file, delete prompt)
* HTTP method and path
* HTTP response code
These access logs can be retrieved programmatically via our [Query Access Logs API](/api-reference/query-access-logs) or through the [Python client](/python-client/quickstart).
## How do I reset my password?
See [Resetting Your Password](/get-access#resetting-your-password).
# Support
Source: https://docs.agents.kolena.com/faq/support
## How can I contact Kolena support?
On [Kolena](https://agents.kolena.com/) you will see a "Support" button at the bottom of the sidebar.
Clicking this button will open a chat window where you can ask questions and report issues.
Our support team is available during business hours to assist you.
## How can I see the status of Kolena services?
Kolena maintains a [status page](https://agents-status.kolena.com/) where you can see the current status of our services, as well as any past incidents and maintenance events.
Click "Subscribe to updates" on the status page to receive notifications about incidents and maintenance events via email.
In the event that an outage occurs and it is not reported on the status page, an incident can be reported by either:
1. Visiting our [status page](https://agents-status.kolena.com/) and click "Report a problem" to submit a report.
2. Directly contacting our incident response line at **[incidents@kolena.com](mailto:incidents@kolena.com)**.
# File Uploads
Source: https://docs.agents.kolena.com/faq/supported-formats
## What file formats does Kolena support?
Kolena aims to support all data formats from all data sources, without conversion.
If you do not see a format listed here, connect with us and we will prioritize support!
| File Type | File Extension |
| - | - |
| Scanned Documents | `.pdf`, all image extensions |
| PDFs | `.pdf` |
| Emails | `.eml`, `.msg` |
| Office Documents | `.docx`, `.doc`, `.pptx`, `.ppt`, `.xlsx`, `.xls`, `.rtf`, `.odt` |
| Spreadsheets \* | `.csv`, `.xlsx`, `.xls`, `.xlsm` |
| Images | `.jpg`, `.jpeg`, `.gif`, `.png`, `.webp`, `.tiff`, `.tif`, `.bmp`, `.heic`, `.heif`, `.svg`, `.jfif`, `.avif` |
| Webpages | `.html`, `.htm`, `.xhtml` |
| Text | `.txt`, `.tsv`, `.json`, `.jsonl`, `.md`, `.markdown`, `.yaml`, `.yml`, `.xml`, `.xsd`, `.xbrl`, `.log`, `.srt`, `.vtt`, `.py` |
| Audio | `.mp3`, `.mp4`, `.mpeg`, `.mpga`, `.m4a`, `.oga`, `.ogg`, `.opus`,`.wav`, `.webm` |
| Archive | `.zip` |
\* Macros and formulas are removed upon import
## Are there limits on file uploads?
Some limits are applied when uploading files to a run:
* **Number of Files Per Run:** A maximum of 300 files can be uploaded within a single Agent Run.
* **Total File Size Per Run:** A maximum of 2 GB of files can be uploaded within a single Agent Run.
* **Maximum File Size:** Individual files can be up to 250 MB in size.
* **Number of Pages Per Run:** A maximum of 1,500 pages of content can be uploaded within a single Agent Run.
## Are there limits on prompt attachments?
When attaching files to a Prompt, up to 5 files per Prompt can be attached. Each file can be up to **5 MB** in size.
## Are there limits on files I can use when creating prompts?
When [uploading a file to create Prompts](/prompts-from-file), a single file can be uploaded with a maximum size of **20 MB**.
# Language Support
Source: https://docs.agents.kolena.com/faq/supported-languages
## Which languages does Kolena support?
Kolena supports a wide variety of world languages:1
| | | | |
| - | - | - | - |
| Afrikaans | Albanian | Amharic | Arabic |
| Armenian | Assamese | Azerbaijani | Basque |
| Belarusian | Bengali | Bosnian | Bulgarian |
| Catalan | Cebuano | Chinese (Simplified) | Chinese (Traditional) |
| Corsican | Croatian | Czech | Danish |
| Dhivehi | Dutch | English | Esperanto |
| Estonian | Filipino (Tagalog) | Finnish | French |
| Frisian | Galician | Georgian | German |
| Greek | Gujarati | Haitian Creole | Hausa |
| Hawaiian | Hebrew | Hindi | Hmong |
| Hungarian | Icelandic | Igbo | Indonesian |
| Irish | Italian | Japanese | Javanese |
| Kannada | Kazakh | Khmer | Korean |
| Krio | Kurdish | Kyrgyz | Lao |
| Latin | Latvian | Lithuanian | Luxembourgish |
| Macedonian | Malagasy | Malay | Malayalam |
| Maltese | Maori | Marathi | Meiteilon (Manipuri) |
| Mongolian | Myanmar (Burmese) | Nepali | Norwegian |
| Nyanja (Chichewa) | Odia (Oriya) | Pashto | Persian |
| Polish | Portuguese | Punjabi | Romanian |
| Russian | Samoan | Scots Gaelic | Serbian |
| Sesotho | Shona | Sindhi | Sinhala (Sinhalese) |
| Slovak | Slovenian | Somali | Spanish |
| Sundanese | Swahili | Swedish | Tajik |
| Tamil | Telugu | Thai | Turkish |
| Ukrainian | Urdu | Uyghur | Uzbek |
| Vietnamese | Welsh | Xhosa | Yiddish |
| Yoruba | Zulu | | |
## Is translation supported?
Yes, translation between English and the languages listed above is also well-supported, with performance considered state-of-the-art.2
## Can Kolena transcribe audio?
Yes, all supported languages listed above are also supported during audio transcription.3
***
1 Supported with at least 90% accuracy according to language benchmarks, relative to performance using English.
2 Performance for a tested subset of these languages was found to be state-of-the-art when compared against other available AI solutions (as of August 2025).
3 Audio transcription accuracy varies by language, with high accuracy (≤10% [WER](https://en.wikipedia.org/wiki/Word_error_rate)) for primarily widely spoken and well-resourced languages like English, Spanish, French, German and Japanese; good accuracy (10–25% [WER](https://en.wikipedia.org/wiki/Word_error_rate)) for languages such as Arabic, Hindi, Korean, and Vietnamese.
# Usage
Source: https://docs.agents.kolena.com/faq/usage
## What is a Credit?
A **credit** is the unit of usage in Kolena.
Credits are consumed whenever an Agent executes a Prompt.
See more details on how credits are consumed, managed, and tracked in [Tracking Usage](/tracking-usage).
The amount of credit used by a Prompt depends on several factors, including the complexity of the task, the number and type of files processed, and the length of the output generated.
As a rule of thumb:
* Complex tasks, larger input files, and lengthier outputs will consume **more credits**
* Simple tasks, smaller input files, and shorter outputs will consume **fewer credits**
Credits are similar to getting a quote to off-shore or out-source a task: the more complex the task and the greater volume of data, the higher the cost.
For users familiar with the concept of "tokens" in large language models, credits can be thought of as a bundle of tokens encompassing the various operations performed by Kolena Agents, including input analysis, reasoning, and creating output.
### Credit Usage By Common Use Cases
Here are some common use cases and their typical credit consumption per Run:
| Use Case | Credits per Run |
| - | - |
| Lease Abstraction | 1 - 3 Credits per Property |
| Loss Run Analysis | 3 - 4 Credits per Loss Run |
| Compliance Testing | 0.5 - 1 Credit per Account Statement |
## How to Optimize Credit Usage?
Credit usage depends primarly on
* The size of your input files into an Agent
* The length of the output from an Agent
* The number and complexity of Prompts being executed
Below are tips to optimize credit usage.
#### Avoid Sending Unnecessary Files
Uploading only files which are relevant to your task will both improve the quality of your results and lower credit usage.
When possible, avoid sending files which you know beforehand will be irrelevant to the task at hand.
#### Group together Prompts
When extracting "simple" values from documents, you can often use [Form Prompts](/prompts#form) to group multiple "key value" pairs of data.
Prefer to use one Form Prompt instead of many Number or Text Prompts.
#### Use Appropriate Advanced Tools
Some advanced [settings and tools](/prompts#tools) impact credits usage.
Use appropriate settings when you expect they will materially impact performance.
For example:
* Enhanced vision will consume additional credits. Make use of this feature when checkbox states are important and expected to be present.
* If you have a chained Prompt which only needs to analyze the output of other Prompts (not the source files), use [Ignore Run files](/prompts#ignore-run-files).
## Legacy Plans: Page-Based Usage
Some existing customers are on page-based pricing plans.
Kolena will continue to support these plans, but new customers will be on the new user-based pricing plans described above.
Under page-based pricing plans, usage for your Organization is tracked from the number of pages uploaded.
Your Organization's plan comes with a number of new page uploads allowed each month.
See [Tracking Usage](/tracking-usage#legacy-plans%3A-page-based-usage) for details.
# Agent-Level Access Control
Source: https://docs.agents.kolena.com/fine-grained-access-control
Control Agent Level Access on Kolena
This is available on the Enterprise Plan. [Contact Kolena](mailto:support@kolena.com) if you’re not on an Enterprise plan but would like to try this feature.
Access can be controlled at the Agent level.
This allows restricting access to specific Agents at a granular level, allowing specific Users or Teams `viewer` or `editor` access.
## Manage Agent Access
Starting from the main page for an Agent, the `owner`s of the Agent or Workspace `admin`s can manage access by clicking the "eye" icon near the top of the page.
There are two access controls on an Agent.
Under **"Users With Access"**, you can explicitly add Users and Teams as `viewer`, `editor`, or assign someone as the Agent’s owner.
You can also configure the **"General Access"** setting:
* **General (View-Only)**: All Workspace users have `viewer`-only access.
* **General (Viewer/Editor)**: Workspace `viewer`s and `editor`s receive their respective roles. This is the default setting for new Agents.
* **Restricted**: Only Organization and Workspace `admins` and explicitly added Users/Teams can access the Agent.
## Agent-Level Permissions
Users with access to an Agent are assigned one of three roles: `viewer`, `editor`, or `owner`:
| Action | `viewer` | `editor` | `owner` |
| :- | :-: | :-: | :-: |
| View Agent | ✅ | ✅ | ✅ |
| View Integrations | ✅ | ✅ | ✅ |
| View Dashboards | ✅ | ✅ | ✅ |
| View Runs | ✅ | ✅ | ✅ |
| Create Runs | ✅ | ✅ | ✅ |
| Comment on Prompts results | ✅ | ✅ | ✅ |
| Override Prompts results | ✅ | ✅ | ✅ |
| Create/Modify/Delete Data Retention Policies | ❌ | ✅ | ✅ |
| Create/Modify/Delete Prompts | ❌ | ✅ | ✅ |
| Create/Modify/Delete Integrations | ❌ | ✅ | ✅ |
| Create/Modify/Delete Dashboards | ❌ | ✅ | ✅ |
| Delete Agents | ❌ | ✅ | ✅ |
| Manage Agents permissions | ❌ | ❌ | ✅ |
By default, the User who created the Agent is its `owner`, though ownership can be transferred later.
Note that Workspace `admin` Users have `owner` access to all Agents in the Workspace.
Moving an Agent between folders is governed by the Workspace-level `Manage Folder` permission.
It also requires view access to the Agent, so Users reorganize only the Agents they can see.
# Get Access
Source: https://docs.agents.kolena.com/get-access
Create an Account on Kolena
## Requesting Access
If your Organization is not yet a Kolena customer, you can request access to Kolena by [following this link](https://www.kolena.com/request-access/).
Kolena will create a new Organization and an administrator account.
You will receive an email with a link to verify your email address and join the Organization.
## Accepting An Invitation
If you received an invitation email from Kolena, accept by clicking "Join Kolena".
This will take you to Kolena.
On Kolena, click "Join ..." to accept the invitation.
This will take you to a page to [create your account](#creating-an-account).
### What If I Did Not Receive an Invitation?
Invitation emails may be filtered by your Organization's email security settings.
If you did not receive an invitation email, please check your spam folder or contact your Kolena representative.
If you have been invited to join an Organization but did not receive an invite email, you can still create an account by going directly to [agents.kolena.com](https://agents.kolena.com) and following the steps below.
## Creating an Account
You can create an account by using your email address, Google account, or Microsoft Account.
To create an account with your email address, enter your address and click "Continue".
Next, create a password for your account and click "Create Account".
You will receive a verification email in your inbox.
Open this email and click "Confirm my account".
Click "Accept" on the authorization page and you will be redirected to Kolena.
## Resetting Your Password
If you forget your password or want to reset it, you can do so by logging out and returning to the [Kolena login page](https://agents.kolena.com).
Click "Log in" and enter your email address.
Next, click "Forgot password?".
You will receive an email with a link to reset your password.
# Measuring Accuracy
Source: https://docs.agents.kolena.com/how-to/measuring-accuracy
Use Agent Validation to Compare Agent Output Against Known Answers
Contact Kolena to enable this feature for your Organization.
**Agent Validation** lets you compare your Agent's output to known correct answers (**Ground Truths**).
Kolena will score how well the Agent matches these Ground Truths.
This allows you to:
* Estimate the **overall accuracy** of the Agent at a given task
* Perform **change management** by testing accuracy before and after changes to your Prompts
## Overview
Validation has three steps:
1. Create a Ground Truth for your Agent
2. Perform Validation (evaluation between Ground Truth and Agent output)
3. Review results of the Validation
## Prerequisites
To perform validation on an Agent, you must ensure:
* The Agent has Prompts created
* Runs are uploaded to the Agent using inputs for which you have known correct outputs
For example, if you wish to validate a Lease Abstraction Agent:
* Upload the lease documents you wish to abstract into Runs
* Define all Prompts necessary to perform the abstraction
* Ensure you have known answers to compare against for those input documents
## Creating a Ground Truth
Using the UI, navigate to the "Validation" tab for your Agent.
Click "Create New Ground Truth".
Provide a Name for your Ground Truth and click "Continue".
### Associate Ground Truth to Runs
In order to compare Agent outputs to Ground Truths, you need a way to associate the two.
Kolena uses a label on each Run called `user_defined_id` to achieve this.
Both your ground truths and the Agent Runs must use this label to join the two.
Click "Bulk Label Runs" and provide natural language instructions on how to assign this label to each Run on your Agent.
Kolena will take your instruction and define the label for each Run.
You can check progress and then continue when complete.
For example, if you have a Loan Review Agent, use an identifier like the loan ID as the label.
Assign labels to each run using instructions like "Grab the loan ID from the cover sheet".
### Upload Ground Truth
Upload a single file containing your correct answers. Kolena checks whether it already matches the
expected [schema](#ground-truth-schema):
* **If it matches exactly**, the file is saved directly as your Ground Truth.
* **Otherwise**, Kolena converts it for
you, mapping your data to the correct Prompt names and generating the Ground Truth JSON. You can
optionally add instructions to guide the conversion (for example, how to associate ground truth data to particular runs).
Supported file types are `.xlsx`, `.xls`, `.xlsm`, `.csv`, `.json`, and `.txt`.
#### Ground Truth Schema
The expected schema is below. A file that already matches this structure is uploaded directly;
anything else is converted into it.
```json theme={null}
{
"evaluation_instructions": "Values should match exactly.",
"runs": [
{
"user_defined_id": "lease-001",
"data": {
"tenant_name": "Acme Corp",
"lease_start_date": "01/15/2024",
"monthly_rent": 4500
}
},
{
"user_defined_id": "lease-002",
"data": {
"tenant_name": "Globex LLC",
"lease_start_date": "03/01/2024",
"monthly_rent": 6200
}
}
]
}
```
**Fields:**
* `evaluation_instructions` — Natural language guidance for how Kolena should compare outputs to ground truths. Useful for specifying acceptable formats, equivalences (e.g. "\$4,500" vs `4500`), or what counts as a correct partial match.
* `runs` — A list of expected results, one per Agent Run.
* `user_defined_id` — A stable identifier that matches the ground truth to a Run in the Agent.
* `data` — A map from Prompt name to expected value.
## Run a Validation
1. Open a Ground Truth from the **Validation** tab.
2. Click **Run Validation**.
3. Results stream in real-time as each cell is evaluated. When complete, you'll see:
* An **overall Score** (0–100) for the Agent, with its matched, mismatched and skipped field counts
* A **breakdown by field**, ranked worst-first, so the weakest fields surface immediately
* **Per-Prompt** and **per-Run scores** showing where the errors concentrate
* **Cell-level reasoning** explaining why a value was marked incorrect
## Editing Ground Truth
You can update individual expected values without re-uploading the entire file:
1. Open a Validation and click on a cell.
2. Click "Edit Ground Truth" and Edit the expected value in the side pane.
3. Click **Save**. Kolena creates a new version of the Ground Truth, preserving history.
## How Scoring Works
Outputs that match Ground Truth exactly are matched immediately and skip evaluation.
For the rest, an AI coding agent inspects your data and writes and runs a script to compare outputs
**field-by-field**, producing deterministic match / no-match results. Your `evaluation_instructions` guide this
script, including how to normalize formats and how to align table rows.
A natural-language second pass runs only on the mismatches for fields you *explicitly* ask to compare by meaning
(see [When the second pass runs](#when-the-second-pass-runs)).
Field-level results roll up into per-cell, per-Prompt, per-Run, and overall Scores (0–100).
### How the Score is calculated
The Score is the share of compared fields that match:
```
Score = matched fields / (matched fields + mismatched fields) x 100
```
Fields that your Evaluation Instructions exclude are **skipped**: they count towards neither side, so
excluding a field never helps or hurts the Score. A Validation where every field is skipped has no
Score at all.
Every field carries the same weight, whichever Prompt it belongs to. A Prompt extracting twenty fields
therefore moves the Score ten times as much as one extracting two — the Score tracks how much of your
data is right, not how many Prompts are doing well. Watch the per-Prompt scores alongside it to see
whether one Prompt is responsible for most of the errors.
The `score` returned by the API on a completed Validation is this same number.
```mermaid theme={null}
flowchart TD
A[Agent outputs + Ground Truth] --> B{Matches
exactly?}
B -->|Yes| M[✓ Match]
B -->|No| C[Coding agent writes & runs a script:
aligns table rows, normalizes formats
per evaluation_instructions]
C --> D{Field result?}
D -->|Excluded by
instructions| S[— Skipped ]
D -->|Match| K[✓ Match]
D -->|Mismatch| E{Field flagged for
semantic comparison?}
E -->|No| F[✗ Mismatch]
E -->|Yes| G{Same meaning?}
G -->|Yes| H[✓ Match]
G -->|No| I[✗ Mismatch]
M --> Z[Aggregate scores]
K --> Z
F --> Z
H --> Z
I --> Z
S -.excluded.-> Z
```
#### When the second pass runs
The natural-language second pass is **not** automatic. It only re-judges mismatches on fields you explicitly ask
to be compared by meaning — using language like "semantically", "same meaning", or "paraphrase" in your
`evaluation_instructions`. Everything else (date, currency, number, and boolean equivalence, synonym lists,
casing, whitespace) is handled deterministically by the script. If you never request semantic comparison,
a script mismatch stays a mismatch.
### Custom instructions
By default comparison is as literal as possible. **Evaluation Instructions** can be set to customize comparison logic.
Use these to tell Kolena how to handle acceptable variations — for example, equivalent date formats, optional whitespace, or acceptable abbreviations.
This prevents the evaluator from penalizing correct-but-differently-formatted outputs.
**Evaluation Instructions** can be used to provide custom logic per Prompt or to ignore differences in specific outputs.
For example,
> When comparing percentages, convert to numeric and match to 2 decimal places (treat "50%" and 50 as equal)
>
> When comparing currency, convert to numeric and treat equal to the nearest dollar ("\$1,000" == 1000)
>
> When comparing dates/datetimes, treat as equal if equivalent to the nearest hour
> (2025-01-08 02:45PM == 2025-01-08 14:45:00)
>
> When comparing addresses, ignore casing and abbreviations ("123 Main St" == "123 Main Street")
>
> Treat null and None as equal; treat a null ground truth and a false output as equivalent
>
> When comparing the "Summary" field, treat as correct if it conveys the same meaning # triggers the second pass
>
> Skip any "Comments" prompts in the comparison
Most rules are applied deterministically by the script. Only rules that ask for meaning-based comparison trigger
the natural-language [second pass](#when-the-second-pass-runs):
## Using the API
Validation can also be performed programmatically using [Kolena's API](/api-reference/ground-truths/create-ground-truth).
# Introduction
Source: https://docs.agents.kolena.com/introduction
Automate Document-Heavy Workflows with AI
**Kolena** is a platform for creating and running automations powered by state of the art AI.
We call these automations **AI Agents**.
Agents are capable of understanding complicated [documents, images, audio recordings and more](/faq/supported-formats).
Tasks which are well suited for Agents include:
* abstracting legal agreements with amendments like leases
* performing extensive diligence reviews of large documents
* eliminating data entry into financial models
* drafting documents from templates
and more.
AI Agents are a collection of **Prompts**, which are instructions that guide the AI on how to process and analyze your data.
Kolena provides tools to write effective prompts as well as a library of pre-built prompts for common use cases and a means to evaluate their performance.
Agents can be connected to your existing data using our supported [Integrations](/connections) with popular cloud storage, document management platforms, and email.
In addition, Kolena supports a [public API](/connecting-to-kolena) to interact with Agents programmatically.
# IP Whitelists
Source: https://docs.agents.kolena.com/ip-whitelist
Configure Allow List by IP Address or CIDR Range
IP whitelisting allows your Organization to restrict access to the Kolena so that only traffic originating from approved IP addresses or networks is permitted.
This is useful for enforcing security policies, limiting access to corporate networks, or complying with regulatory requirements.
## How to Configure an IP Whitelist
To configure or update the IP whitelist for your organization:
1. Navigate to "Data & Security" tab on [your Organization page](https://agents.kolena.com/organization?tab=data-and-security).
2. Under **IP Whitelist**, click **Configure Whitelist**.
3. In the **IP Addresses** field, enter one or more IP addresses or CIDR ranges.
* Examples:
* `192.0.2.1`
* `192.168.0.0/24`
* Multiple entries can be separated by commas.
4. Click **Set IP Whitelist** to apply the policy.
Your organization’s access will now be restricted to the addresses or ranges you specify.
## Important Notes
* **Be careful not to lock out your Organization.** Ensure that the IP you are currently using is included in the whitelist before saving.
* Changes take effect immediately.
* Removing all entries will revert the organization back to allowing access from any IP address.
# Leonard
Source: https://docs.agents.kolena.com/leonard
Work with Kolena's built-in AI assistant to build, explain, and improve your Agents
Leonard is Kolena's AI assistant, built into the platform. He works alongside you in a side panel:
he can read the Agents in your Workspace, explain what a Prompt did, propose edits for you to review,
build new Agents, and answer how-to questions with links to this documentation.
This feature is in beta and is enabled per Organization. [Contact Kolena](mailto:support@kolena.com) if you'd like it turned on for your Organization.
## Opening Leonard
Click **Work with Leonard** at the bottom of the sidebar, or press `Ctrl+Shift+L` (`⌘⇧L` on Mac).
The panel opens beside your work, so the Agent, Run, or Prompt you were looking at stays visible.
Leonard knows which page you have open, so you can refer to what's in front of you (for example: "why did this
Prompt return null?", "add a Prompt here for the lease end date", "how many credits did this Run
cost?") without pasting ids or instructions into the chat.
## Examples
Building an Agent. Attach the workbook your team fills out by hand, and Leonard creates the Agent and proposes the Prompts that produce it.
Fixing a Prompt. Ask why a value came back wrong; Leonard traces it to the instruction and proposes the edit for you to accept.
## What Leonard can do
* **Build Agents:** Describe the outcome; Leonard creates the Agent and proposes its Prompts.
* **Explain and improve Prompts:** Review an instruction, add a missing field, or fix a Prompt returning the wrong value. Edits are surgical. He can also edit **Agent Guidelines**.
* **Connect Prompts and narrow documents:** [Chain Prompts](/prompts#prompt-inputs-chaining) so one reads another's output, set [Document Filters](/prompts#document-filters) so a Prompt only sees the documents that matter, and add [Conditionals](/prompts#conditionals) so a Prompt only runs when it applies.
* **Explain results:** He reads a Run's results and its source documents. Verify an extracted value, compare two files, or find something no Prompt captures.
* **Search your Workspace:** Ask which Agents exist, where one lives, or which Runs it has.
* **Answer how-to questions:** He searches this documentation and links the page he used.
* **Report credit usage:** Workspace, Organization, per-Agent, or per-Run (limited to usage you can view).
* **Create files to download:** `.xlsx`, `.docx`, `.pptx`, or `.pdf`, attached to the conversation.
* **Start a Validation:** Against an Agent's [Ground Truth](/how-to/measuring-accuracy), after you confirm.
## Nothing changes until you accept
Leonard never edits an existing Agent directly. Every change arrives as a **Proposed Changes** card
in the conversation, listing each Prompt being added, modified, or removed.
* Click any item to open the full diff and see the instruction and settings before and after.
* **Generate a preview** to run the proposed Prompt against a real Run and see the value it produces,
side by side with the current value, before you commit to it.
* **Accept all** applies the update; **Reject all** discards it. If part of an update isn't right,
tell Leonard what to change and he'll propose a revised version.
Leonard can create a **new, empty** Agent when you ask him to build one but all
Prompts still arrive as a proposal for you to review.
Accepting a Prompt change marks existing results for that Prompt out of date. Regenerate them from
the Agent when you're ready — Leonard cannot create Runs or re-run existing ones.
## Attachments and dictation
Attach files to a message when a screenshot or sample document is the fastest way to explain what you
want: up to 10 files per message, 10 MB per file and 20 MB in total. Leonard keeps them for the whole
conversation, so you can refer back to a file you attached earlier without uploading it again.
You can also dictate a message with the microphone in the chat input instead of typing it.
## Chats and history
Each conversation is saved. Use the history menu to search and reopen past chats, or delete ones you
no longer need; **New chat** starts fresh. Long conversations are summarized automatically as they
grow, so Leonard keeps track of what you're working on. Very long chats eventually reach a limit and
ask you to start a new one — start a new chat per task for the best results.
A thumbs up or down on any response (with an optional comment) tells us what to improve.
## What Leonard can't do
* Change an existing Agent without your approval.
* Create Runs, upload documents to a Run, or re-run an existing Run.
* See anything you can't see. Leonard runs with your permissions in your current Workspace.
## Permissions and privacy
Leonard enforces exactly the same access rules as the rest of the platform. He can only read Agents
you have access to, can only propose Prompt changes on Agents you may edit, and can only start a
Validation if your role allows it — including under
[fine-grained access control](/fine-grained-access-control).
Conversations with Leonard are **not billed** and do not consume your credits. As with the rest of
the platform, your data and your interactions are never used to train AI models — see
[Data Privacy & Security](/faq/security).
## Tips for better results
* **Work from the page you're on.** Open the Agent, Run, or Prompt first, then ask — Leonard resolves
"this Prompt" or "this Run" from what you're viewing.
* **Say what's wrong, not just what to write.** "This returns the tenant's name instead of the
landlord's" gets a better edit than "rewrite this Prompt".
* **Point at a Run when accuracy is the problem.** Leonard can read the source documents and see what
the Prompt actually had to work with.
* **Batch related edits.** Ask for all the changes you want in one message and review them as a
single update.
* **Preview before accepting** anything you're unsure about.
* **Start a new chat** when you switch tasks.
# Add Styling to Your Prompt
Source: https://docs.agents.kolena.com/llm-styling-tutorial
Learn how to prompt AI to generate structured, styled reports
When you ask AI to create a report, presentation, or summary, you don't have to settle for plain, boring text.
With the right instructions, you can get beautifully formatted documents that look professional and are easy to read.
Think of it like instructing a junior employee; the more specific you are about what you want, the better your results will be.
Here's a step-by-step guide to help you design effective prompts for generating reports with headers, bullet points, and other formatting elements.
### Step 1: Specify the Report Structure
Define the structure of your report. For example, you might want the output to include headings, subheadings, bullet points, and tables.
Example Prompt:
> Generate a report summarizing the results of a customer survey. The report should include the following sections:
>
> 1\. Executive Summary
> 2\. Key Findings
> 3\. Recommendations
> 4\. Detailed Analysis
Consider the desired style of your output and include instructions which reflect that style.
Here are some examples for different report stuctures and styles:
| Style | Description | Sample Prompt Addition |
| - | - | - |
| **Executive Dashboard** | High-level KPIs, insights, actions | “Create a dashboard-style summary with KPIs, key findings…” |
| **Slide-Style Report** | Each section = one slide (for Google Slides / PowerPoint) | “Format each section like a slide with a title + 3 bullets…” |
| **Analyst Bullet Report** | Dense bullets, bolded labels, zero fluff | “Use a clean bullet-point format with bolded highlights…” |
| **Comparison Table** | Compare multiple products or groups side-by-side | “Include comparison tables and insights per group…” |
| **Q\&A Format** | Conversational, like an interview | “Write the summary as a Q\&A between researcher and analyst…” |
| **Timeline Report** | Chronological milestones, testing phases, or journeys | “Summarize events in a timeline-style with emojis…” |
| **Storytelling Format** | Narrative arc for presentations or internal buy-in | “Write as a story with sections: Background, Discovery, etc.” |
***
### Step 2: Set the Tone and Style
Be specific about the style you want, such as professional, concise, or detailed. For best requests, request the output to be formatted as Markdown.
Example Prompt:
> Format the report in Markdown. Use \*\*bold\*\* for section headers, bullet points for findings, and italics for recommendations. Include a table for the detailed analysis section.
***
### Step 3: Include Clear Instructions on Formatting
For each section, specify how the content should be structured. You may ask the AI to use bullet points, tables, or numbered lists.
Example Prompt:
> \- In the Executive Summary section, summarize the main findings in 3-4 sentences.
> \- In the Key Findings section, list the findings as bullet points.
> \- In the Detailed Analysis section, provide detailed descriptions in paragraphs.
***
### Step 4: Provide Sample Prompts for Clarity
Here's a complete prompt example that follows these steps.
Example Prompt:
> Generate a report summarizing the survey results. The report should have the following sections:
>
> \# Executive Summary
> \- Provide a brief summary of the main findings in 3-4 sentences.
>
> \# Key Findings
> \- List the key findings using bullet points. Use bullet points for each finding.
>
> \# Recommendations
> \- Provide a list of recommendations based on the findings, formatted as bullet points.
> \- Make sure to write recommendations in \*\*bold\*\*.
>
> \# Detailed Analysis
> \- For each question in the survey, include a detailed analysis. Write paragraphs explaining the results and what they imply.
> \- If a table is needed for data, include it with the column names: "Question", "Response", and "Percentage".
Example Output:
> # Executive Summary
>
> This report provides an overview of the recent customer survey results, highlighting key insights and actionable recommendations.
>
> # Key Findings
>
> 80% of customers are satisfied with our product.
>
> 15% of customers noted issues with the website's navigation.
>
> 5% of respondents have never used the product.
>
> # Recommendations
>
> Enhance website navigation to improve the user experience.
>
> Focus on customer engagement for the 5% who haven't used the product.
>
> # Detailed Analysis
>
> Question 1: How satisfied are you with the product?
> 80% of respondents reported being satisfied with the product. This is a positive outcome, but there is still room for improvement to achieve even higher satisfaction levels.
>
> Question 2: What issues have you faced with the product?
> 15% mentioned issues with navigation. This suggests that the interface might be complex for some users. We recommend a review of the UI/UX.
>
> | Question | Response | Percentage |
> | - | - | - |
> | How satisfied are you with the product? | Satisfied | 80% |
> | What issues have you faced with the product? | Navigation | 15% |
> | Have you used the product? | No | 5% |
### Conclusion
By clearly structuring your prompt and specifying how you want the content formatted, you can easily generate detailed and professional reports.
***
## Advanced: Markdown Cheatsheet
Markdown is a format which is well understood by AI and can be used to create structured, styled reports.
When asking for Markdown formatting, you can use specific keywords to get the desired output. Here's a quick reference:
| Element | Prompt Keyword | Example Output |
| - | - | - |
| Headings | `## Executive Summary` | ## Executive Summary |
| Bold Text | `**Key Insight:**` | **Key Insight:** |
| Bullet List | `- Item 1` | – Item 1 |
| Numbered List | `1. First` | 1. First |
| Tables | Ask for: “Markdown table” | Structured rows + columns |
# Prompts
Source: https://docs.agents.kolena.com/prompts
Learn about Prompts, the building blocks of AI Agents in Kolena
Prompts are instructions that guide your AI Agent on how to process and analyze your data.
This page will explain the basics of Prompts including defining **output types**, **attaching files**, and advanced usage like **chaining Prompts** together and performing complex math.
## Output Types
Each Prompt has an output type. This type specifies the format of the response you expect.
When creating a Prompt, Kolena will intelligently guess the output type based on your instructions, but you can also select the desired output type from the dropdown menu.
Click to expand each output type for more details:
**Text Prompts** are the most flexible output type.
They allow the Agent to generate free-form text responses based on the Prompt instructions.
Text output can also be formatted using Markdown syntax.
This is useful for creating structured documents with headings, lists, links, and other formatting elements.
**Table Prompts** enable structured data representation.
It is useful for extracting and organizing information in a tabular format.
When Table is selected, you must define the columns that the Agent should fill in.
Accuracy will be highest when your Prompt includes clear instructions on what data should go into each column as well as instructions for when to create a row.
You can use Table Prompts to directly extract tabular data from documents, such as a rent roll from a PDF, or to organize unstructured information into a table, such as gathering a list of all critical dates within a legal document.
The number of rows returned by the Agent will depend on the content of the input document and your Prompt instructions.
Accuracy of Table Prompts will decrease with very large (20+) numbers of columns or when each row requires many paragraphs of text to be extracted.
**Recommendation**: if the number of columns becomes too large, split your instruction into multiple Prompts.
**Form Prompts** return a set of predefined field/value pairs.
Each field in the Form corresponds to a specific piece of information that the Agent is expected to extract or infer.
When Form is selected, you must define the field that the Agent should fill in.
Accuracy will be highest when your Prompt includes clear instructions on what data should go into each field.
Form Prompts are very efficient because they allow you to group multiple outputs into a single Prompt.
You can use Form prompts to extract many different pieces of information such as key details from a contract (e.g., parties involved, dates, amounts) by section.
Accuracy of Form Prompts will decrease with large (20+) numbers of fields.
**Recommendation**: if the number of fields becomes too large, split your instruction into multiple Prompts.
**Number Prompts** should be used when the expected response is a single numeric value.
**True/False (Boolean) Prompts** should be used when the expected response is a true or false answer.
**Classification Prompts** are a special form of Text Prompt where the Agent is required to choose from a predefined set of categories.
This is useful for tasks like sentiment analysis, topic categorization, or any scenario where the response must belong to a specific set of options.
## Inputs to Your Prompts
In addition to the text instructions, you can provide additional information to your Prompts using file attachments or even the results of other Prompts.
### Attaching Files
Attaching a file to your Prompt allows to provide longer context that may be impractical to include directly in the Prompt instructions.
You can attach files of various types including PDFs, images, spreadsheets, and more.
Some examples of useful attachments include:
* CSVs of lookup tables or reference data
* Guidelines or policy documents you want the Agent to follow
When attaching files, consider the following **best practices**:
* Ensure the attached files are relevant to the Prompt and contain information that will help the Agent generate accurate responses.
* If the file is large or complex, provide additional instructions in the Prompt to guide the Agent on which sections to focus on.
* Use clear and concise language in your Prompt to specify how the Agent should utilize the information from the attached files.
#### Connecting Cloud Documents
If you wish to attach a document stored in a cloud service, you can do so by first adding an integration for that service (see [Supported Integrations](/connections/supported)), then clicking that integration from the Prompt and selecting the file.
Supported integrations include:
* Google Drive
* Notion (KMS)
* SharePoint
### Prompt Inputs (Chaining)
Sometimes a task is too complex to be handled reliably by a single Prompt.
Kolena allows you to define and chain multiple Prompts together, where the output of one Prompt can serve as the input to another.
This can be used in combination with other tools, for example:
1. Use a Table Prompt to extract structured data from a document.
2. Use a Data Analysis tool-enabled Prompt to perform calculations or analysis on the extracted data.
To use another Prompt as the input to your current Prompt, simply select it from the **Prompt Inputs** dropdown item or use the hotkey `@` when editing the Prompt text.
## Tools
Advanced tools can be enabled on your Prompts to enhance their capabilities.
Each tool is designed to overcome a natural limitation of state of the art AI models by leveraging specialized techniques or services.
### Data Analysis
Certain operations, such as mathematical calculations are best handled by specialized tools rather than relying solely on AI models' pattern matching capabilities.
Selecting **Data Analysis** for your Prompt will have the Agent write a piece of code which is then executed to produce the final output.
This is especially powerful for tasks involving numerical data or complex calculations on tabular data.
**When You Should Use Data Analysis:**
* When you want to perform calculations, aggregations, or statistical analysis on data extracted from tabular data.
**How Data Analysis Works:**
1. The Agent will analyze any input document(s) and your Prompt and write a piece of code.
2. This code will be executed and the results returned as the final output of the Prompt.
**When Data Analysis Is Not Suitable:**
* When you require natural language analysis. **Recommendation**: perform the task using two Prompts chained together, the first to extract the data and the second to analyze it using natural language.
If computation logic is complex, and you already have the code implemented in Python, you can provide the script
as a [Prompt attachment](#attaching-files), and add instructions in your Prompt to guide the Agent to use it.
For example, putting the desired processing logic in `transaction_processing.py`:
```python theme={null}
import pandas as pd
def process(history):
df = pd.DataFrame(history)
# perform data processing based on input df
output_df = pd.DataFrame(columns=['Date', 'Amount', 'Interests'])
# ...
return output_df
```
We can create a Prompt with the above code as a Prompt attachment, and automatically instruct the Agent:
> Use the `process` function in `transaction_processing.py`, pass all transaction history in the document as
> `history` argument. Return the result as a table.
This can provide strong guidance for the Agent to run the exact computation.
### Enhanced Vision
State of the art AI models excel in many vision tasks.
However, for a specific subset of tasks, such as accurately reading checkbox states from documents, specialized vision models will provide superior accuracy.
**When You Should Use Enhanced Vision:**
* Prompts which require correctly reading checkbox states
**How Enhanced Vision Works:**
1. The Agent will identify the regions of interest in the document or image based on your Prompt instructions.
2. These regions are then processed using specialized vision models to extract the required information.
**When Enhanced Vision Is Not Suitable:**
* When checkboxes exist on many pages for extraction (5+ pages)
### Web Search
Web Search allows your Agents to find information from the internet to answer questions with verified references.
**When You Should Use Web Search:**
* When your Prompt requires current information from the web or verification of facts.
* When the information needed is likely to be found on publicly accessible web pages through a search engine.
**How Web Search Works:**
1. Based on your Prompt, the Agent will decide if searching the internet is necessary.
2. If so, the Agent will make search engine queries to gather information and refine searches for up to 10 of the most relevant web pages.
3. The Agent will extract at most 120k words and analyze the content to answer your Prompt.
4. The final response will use any documents plus these search results to generate a comprehensive answer with citations.
**When Web Search Is Not Suitable:**
* Web Search cannot access private or paywalled content, nor can it download files like PDFs or images.
* Web Search relies on search engine results and cannot access pages that block bots or crawlers.
**Effective Web Search Prompts**
Craft your Prompts to steer the Agent's search for information by:
* Asking for current information (e.g., "What are the latest developments at Kolena in 2025?" instead of "What's Kolena doing?")
* Using time-sensitive language like "latest," "in the past decade," "breaking news," or specific time periods.
* Requesting verification and fact-checking (e.g., "Verify the current stock price of Company-Name and cite your sources.")
* Hinting at specific sources or types of sources (e.g., "Search for information on Zillow about property prices in NYC" or "Find recent news articles about Topic-Name")
## Advanced Settings
### Inline Citations
Embed file and page references directly within the output text, showing which sources were used for each part of the response.
**Use this when:** You need to trace the source of specific information or when compliance requires detailed source attribution.
Inline Citations are only available for **Text**, **Table**, and **Form** output types. Inline Citations are enabled by default.
### Ignore Run Files
By default, when a Prompt with Input Prompts executes, two sources of information are used as input:
1. The files uploaded to the Run
2. The results of any Input Prompts
When enabled, only the second source will be used as input for the Prompt.
**Use this when:**
You are chaining Prompts together in a multi-step workflow, and the initial Run files are no longer relevant to later steps.
This helps ensure that later Prompts operate strictly on transformed or refined intermediate outputs, rather than being influenced by the original files.
Suppose your goal is to produce a final summarized report based purely on the results of earlier transformation Prompts rather than the original uploaded materials.
Here is an example flow:
> **Prompt A:** Extracts structured data from the uploaded files into a normalized format.
>
> **Prompt B:** Final summarization step.
If Prompt B still has access to the original Run files, the model may accidentally pull details directly from those files instead of relying solely on the refined output from Prompt A.
To avoid this, you would enable Ignore Run Files on Prompt B.
This ensures the final summary is based only on the transformed, cleaned, or reduced information produced by the previous Prompts.
This option is only available when **Input Prompts** are used.
### Filter Documents (deprecated)
**Deprecated:** This feature is deprecated and may be removed in a future release. Avoid using it in new Agents.
The recommended way to filter documents is now a dedicated [**Document Filter**](#document-filters) step, which you define once and connect to any number of Prompts.
When enabled, the system automatically selects only the relevant documents for your Prompt. This can improve extraction quality and reduce noise when a Run includes many files.
**Use this when:**
There are many Run files, but only a few contain what you need. You want to exclude irrelevant files without manually selecting documents for every Run.
For best results, be explicit about which documents should be included (and, if helpful, which should be excluded). Mention the document type or identifying cues like filenames or keywords.
Here is an example:
> Only use invoices from 2026. Ignore receipts, statements, email threads, and invoices from other years.
This is only applied to Runs with more than 10 files or multiple files with more than 200 total pages.
This feature is unavailable when [**Ignore Run Files**](#ignore-run-files) is enabled.
## Control Steps
Beyond the Prompts themselves, you can add steps to your Agent that control what runs.
### Document Filters
A **Document Filter** is a dedicated step you add to your Agent that narrows down which documents your Prompts will see.
It is the recommended way to control document selection: you define a filter once, write instructions describing which documents to include, and connect it to the Prompts that should receive only those documents.
Connecting a Document Filter to your Prompts optimizes both **extraction quality** and **credit usage**, since each connected Prompt only processes the documents that pass the filter rather than every file in the Run.
**When You Should Use a Document Filter:**
* When a Run includes many files but only some are relevant to a given Prompt.
* When several Prompts should all operate on the same relevant subset of documents.
* When you want to reduce credits by preventing Prompts from processing irrelevant files.
**How Document Filters Work:**
1. Add a Document Filter to your Agent and write instructions describing which documents to include.
2. In the filter's **Input** field, choose what the filter reads: **All Run Files** (the default) or [**All Run Filenames**](#all-run-filenames).
3. In the filter's **Output** field, select the Prompts that should receive the filtered documents.
4. When a Run executes, the filter analyzes the Run's documents and passes only the matching subset to each connected Prompt.
5. The filter's result is shown as the number of documents that passed out of the total (for example, `3 / 12 passed`).
Be explicit about which documents should be included (and, if helpful, which should be excluded). Mention the document type or identifying cues like filenames or keywords.
Here is an example:
> Only include invoices from the current year. Exclude receipts, statements, email threads, and invoices from other years.
#### All Run Filenames
By default a Document Filter's **Input** is **All Run Files**, so it reads the contents of each file. Switch the Input to **All Run Filenames** to filter using only the filenames, without reading file contents. It is faster and uses fewer credits.
This works best when filenames are consistent and descriptive. For example:
> Include files whose names contain `Invoice`. Exclude files containing `Receipt` or `Statement`.
If filenames are generic (`scan1.pdf`, `document.pdf`), keep the Input on **All Run Files** so the filter can read the contents.
### Conditionals
A **Conditional** is a step you add to your Agent that decides which of your Prompts run for a given Run.
It works much like a Classification Prompt. You define the set of **conditions** it can choose from (for example, `Invoice`, `Receipt`, `Other`) and write instructions describing how to choose between them.
The difference is what the chosen condition does. When a Run executes, the Conditional picks the matching condition, and each Prompt you attached to that condition runs. Prompts attached to the other conditions are skipped.
Like Document Filters, this improves both extraction quality and credit usage. Each Prompt only runs where it applies, and a skipped Prompt consumes no credits.
**When You Should Use a Conditional:**
* When your Runs contain mixed inputs, such as different document types, and different Prompts apply to each kind.
* When a Prompt only applies in certain scenarios, such as when an optional section is present, or a review step that should only run when an earlier Prompt's check fails.
**How Conditionals Work:**
1. Add a Conditional to your Agent and write instructions describing how to choose the matching condition (for example, "Categorize the files by which company they belong to: Company A, Company B, or another company").
2. Define the **Conditions** the Conditional can choose from.
3. Attach Prompts to conditions, either from the Conditional itself (each condition has an "If ... then run ..." row) or from a Prompt's **Condition** field. Prompts left unattached always run.
Like any Prompt, a Conditional reads the Run's documents, can use other Prompts' results as [inputs](#prompt-inputs-chaining), and can be connected to a [Document Filter](#document-filters).
A Prompt can also carry conditions from more than one Conditional. These combine with OR, so the Prompt runs when any one of its conditions is met.
If a Run doesn't clearly match any condition, the Conditional returns "No condition matched" and every attached Prompt is skipped.
If you want certain Prompts to run in that case, add an explicit catch-all condition such as `Other` and attach them to it.
Avoid repeating the decision inside your Prompt instructions.
Instead of writing "If this is an invoice, extract X, otherwise return nothing" into several Prompts, create one Conditional that decides once and attach those Prompts to its `Invoice` condition.
A skipped Prompt produces no output.
If another Prompt uses a skipped Prompt as an input, it will see no value from it, so when a whole chain of Prompts belongs to one condition, attach every Prompt in the chain, not just the first.
# Creating Many Prompts
Source: https://docs.agents.kolena.com/prompts-from-file
Learn how to create many Prompts at once by providing your desired output
Kolena provides tools to create multiple Prompts very quickly.
You can upload an example of the output you want to create and Kolena will construct Prompts to achieve this output.
These Prompts can subsequently be edited and refined.
## Create Prompts From File
The Create Prompts From File feature allows you to upload a reference file to guide the creation of many Prompts.
For example, you can:
* Upload an abstract template and ask to create Prompts necessary for filling in the template (for example a lease abstract)
* Upload an example spreadsheet and ask to create Prompts necessary to populate a table of data
### Upload Your File
1. On your Agent, click on a Run to edit or create Prompts
2. Click on the "Create Prompt" button
Uploaded files can be a maximum of 10MB. All [Office documents, text, pdf, and images are supported](/faq/supported-formats).
3. Attach your reference file
4. (Optional) Provide instructions on how to interpret the uploaded file, specify formatting requirements, or express preferences about the created Prompts.
Some example instructions could include
> Format all dates as "MM/DD/YYYY"
> Generate a Prompt to populate the table found in the spreadsheet tab called "Master Template"
> Write Prompts to populate the "Covenants" section of my Loan Abstract
5. Click "Send"
Kolena will analyze the uploaded file along with any provided instructions and suggest appropriate Prompts. Once you’re satisfied with the suggested Prompts, you can save them by clicking "Create".
**What happens behind the scenes:**
* Kolena identifies useful fields to extract from your uploaded file
* The documents in the run are treated as examples of the input the agent will process
* Kolena suggests generic Prompts that work across multiple similar documents
**Example:** If you upload a resume, Kolena will identify fields such as the candidate's name, contact information, experience, and skills, selecting the most suitable type (such as number, text, or table) for each Prompt.
If you already have Prompts for experience or GPA, the system recognizes their existence and avoids creating duplicate Prompts.
### Best Practices
* **Focused content**:
Upload files that contain the right amount of information.
If you have a complex file with multiple sections but only need to extract information from one specific area, consider uploading a screenshot or simplified version of only the relevant section.
For instance, if you have an Excel file with 10 sheets but only need to extract data from one sheet, upload a screenshot of that sheet.
This prevents having too many Prompts being generated.
# Quickstart Guide
Source: https://docs.agents.kolena.com/python-client/quickstart
Call Agents from Python
Follow our quickstart guide below or use an [interactive notebook](https://colab.research.google.com/github/kolenaIO/agents-notebooks/blob/main/quickstart.ipynb).
## Installation
To connect to your Kolena Agents using Python, install the `kolena-agents` client from
[PyPI](https://pypi.org/project/kolena-agents/) using any Python package manager such as [pip](https://pypi.org/project/pip/)
or [poetry](https://python-poetry.org):
```shell theme={null}
pip install kolena-agents
```
```shell theme={null}
poetry add kolena-agents
```
## Initialization
An [API Key](/api-keys) is required to use the python client.
Create and copy a key, then store the value in a `KOLENA_API_KEY` environment variable:
```shell theme={null}
export KOLENA_API_KEY="your-api-key"
```
## Usage
Here's an example of how to use the client to add, download and delete Agent Runs:
```python theme={null}
from kolena_agents import Client
client = Client()
# add new Agent Run
new_run = client.agent_run.add(agent_id=1, files=["path/to/file1", "path/to/file2"])
# each entry may be a path, an open binary file object, bytes, or a (filename, bytes_or_file_object) tuple
with open("path/to/large_file", "rb") as f:
streamed_run = client.agent_run.add(agent_id=1, files=[f])
# download Agent Run
run = client.agent_run.get(agent_id=1, run_id=2)
# alternatively, list all Agent Runs
all_runs = client.agent_run.list(agent_id=1)
# delete Agent Run
client.agent_run.delete(agent_id=1, run_id=2)
# list all Agents
all_agents = client.agent.list()
# get an Agent
agent = client.agent.get(agent_id=1)
# update Agent properties
updated_agent = client.agent.update(
agent_id=1,
metadata={
"environment": "production",
"version": 2,
"tags": ["nlp", "extraction"]
}
)
```
### Managing Agent Properties
You can attach key-value pairs metadata to your Agents for organizing, filtering, and tracking purposes. Metadata values can be primitives (strings, numbers, booleans, or null) or arrays (lists of primitive values). See the [API reference](/api-reference/update-agent) for more details.
```python theme={null}
# update Agent properties
agent = client.agent.update(
agent_id=1,
metadata={
"environment": "production",
"version": 2,
"department": "finance",
"tags": ["invoice-processing", "high-priority"],
"threshold": 0.85,
"enabled": True
}
)
# access metadata from retrieved agent
agent = client.agent.get(agent_id=1)
print(agent.metadata)
# clear metadata
client.agent.update(agent_id=1, metadata={})
```
### Synchronous Usage
You can also add an Agent Run synchronously, which creates a Run and waits for processing of all prompts to complete. Note that this endpoint has [rate limits](/api-reference/add-agent-run-wait#rate-limits).
```python theme={null}
# add new Agent Run and wait for processing to complete
new_run = client.agent_run.add_wait(agent_id=1, files=["path/to/file1"])
# if the Run times out (still in "running" status), fall back to polling:
while new_run.status == "running":
new_run = client.agent_run.get(agent_id=1, run_id=new_run.run_id)
time.sleep(10)
```
### Download Templated Output
When an Agent has an [Output Template](/templated-outputs) configured, Runs can be downloaded into the Template.
```py theme={null}
agent = client.agent.get(agent_id=...)
output_template_id = agent.output_templates[0].id
# download Agent Run output as PDF
client.agent_run.download_templated_output(
agent_id=...,
run_id=...,
output_template_id=output_template_id,
output_format="pdf",
filename="output.pdf",
)
```
### Query Access Logs
This is available on the Enterprise Plan. [Contact Kolena](mailto:support@kolena.com) if you’re not on an Enterprise plan but would like to try this feature.
```py theme={null}
time_range = {"start_time": "2025-09-09T00:00:00Z", "end_time": "2025-09-10T23:59:59Z"}
# initial query
response = client.access_logs.query(
time_range=time_range,
page_size=100
)
all_events = response.events
# fetch remaining pages
while response.next_cursor:
response = client.access_logs.query(
time_range=time_range,
page_size=100,
cursor=response.next_cursor
)
all_events.extend(response.events)
```
### View Credit History
Pull credit history to get insights on usage. See the [API reference](/api-reference/list-usage-records) for more details.
```python theme={null}
# list usage records
usage = client.usage.list(page_size=50)
# filter by date range
import datetime
now = datetime.datetime.now(datetime.timezone.utc)
usage = client.usage.list(
created_gte=now - datetime.timedelta(days=30),
created_lte=now,
)
# filter by agent or user
usage = client.usage.list(agent_id=1)
usage = client.usage.list(user="user@example.com")
```
### Manage API Keys
Programmatically manage API keys for automated rotation and monitoring. See the [API reference](/api-reference/create-api-key) reference for more details.
```python theme={null}
from datetime import datetime, timezone
new_key = client.api_key.create(name="New Key", expiration_days=10)
print(f"New key: {new_key.api_key}") # save this immediately!
# monitor keys for expiration
utc_now = datetime.now(timezone.utc)
response = client.api_key.list(page_number=0, page_size=50)
for key in response.api_keys:
if key.status == "active" and key.expires_at:
days_until_expiry = (key.expires_at - utc_now).days
if days_until_expiry < 30:
print(f"Warning: {key.name} expires in {days_until_expiry} days")
key = client.api_key.get(key_id=new_key.id)
print(f"Key status: {key.status}")
# delete an API key
client.api_key.delete(key_id="old-key-id")
```
### Serializing to JSON
All `kolena-agents` objects are standard [`Pydantic`](https://docs.pydantic.dev/latest/) data objects and can be easily
converted to and from JSON:
```python theme={null}
from kolena_agents import Client
from kolena_agents.types.agent_run import AgentRun
client = Client()
run = client.agent_run.get(agent_id=1, run_id=2)
run_dict = run.model_dump(mode="json") # get the AgentRun as a dictionary
run = AgentRun.model_validate(run_dict) # deserialize an AgentRun
```
## Timeouts and Retries
By default the client waits up to 10 minutes for a response, and retries failed requests up to
3 times with exponential backoff. Connection errors, dropped connections and transient HTTP
statuses (`408`, `429`, `500`, `502`, `503`, `504`) are retried automatically for idempotent
requests. Connections that cannot be established normally fail after 5 seconds so they are retried
promptly rather than hanging.
The timeout applies to each network operation rather than to the request as a whole, so a large
upload that is still making progress will not time out. Streaming uploads use the operation timeout
while connecting and sending so the shorter connection timeout cannot interrupt the request body.
```python theme={null}
from kolena_agents import Client
# wait up to 30 seconds for a response
client = Client(timeout=30)
# wait indefinitely
client = Client(timeout=None)
# override the timeout for a single call
run = client.with_options(timeout=5).agent_run.get(agent_id=1, run_id=2)
```
[`add_wait`](#synchronous-usage) is the one exception: the server holds the connection open for
the poll window you request, so the client never gives up before that deadline even if you set a
shorter `timeout`.
Requests that create or modify data, such as `agent_run.add`, are retried only when it is certain
the server did not act on them: failures before the request reaches the server, and responses
(`408`, `429`) where the server rejected the request without processing it. They are not retried
if the connection drops after the request was sent, or on `500`/`502`/`503`/`504`, since the
server may have already applied the request.
## Webhook
Kolena provides a helper function to handle signature verification and parsing. See [Webhook Integration](/connections#webhook) for more information.
```python theme={null}
from kolena_agents import webhook
result = webhook.construct_event(request_body, secret, request_headers)
```
## Supported Python Versions
Python versions 3.8 and later are supported.
# Quickstart
Source: https://docs.agents.kolena.com/quickstart
Set Up Your first Agent in Minutes
## Quick Start Tutorial
Welcome to your getting-started guide for Kolena's **Agents** tool. This tutorial walks you through the steps to build your first Agent. In this example, we will create one that focuses on analyzing customer interactions.
If you'd like to follow along, the files used in the tutorial may be downloaded [here](https://kolena-public-datasets.s3.us-west-2.amazonaws.com/agents/docs/quickstart-customer-support-issues.zip).
***
### What is an Agent?
An **Agent** is an autonomous, intelligent assistant that helps you automate or enhance your processes. Agents work on your behalf to analyze documents, extract structured data, and generate insights, freeing you to focus on strategic tasks.
***
## Navigation Overview
Before you start creating an Agent, take a moment to explore the sidebar.
* **Kolena logo** (top of the sidebar): Returns you to your list of Agents. If your Organization has more than one Workspace, it opens the Workspace switcher instead.
* **Work with Leonard** and **Support** (bottom of the sidebar): Open Kolena's AI assistant, or chat with our support team.
* **Your profile** (bottom of the sidebar): Open **Profile Settings** to manage your account, open the **Trash Bin**, read the **Documentation**, check **System Status**, or **Logout**. Admin users also get **Manage Organization** for managing their Organization, users, and usage.
***
## Step-by-Step: Create Your First Agent
Let's walk through creating a **Customer Support Agent** to analyze customer interactions.
### Creating the Agent
#### Option 1: Build a New Agent
* Go to your main Workspace
* Click **Create Agent**
* Define your **Objective** in your natural language
Example:
`Analyze customer interactions and behaviors`
#### Option 2: Select a Prebuilt Agent
* Go to your main Workspace
* Click **Create Agent**
* Choose from an existing prebuilt Agent option, such as: **Customer Support Triage**
### Upload an Example File
Start by uploading an example of customer interaction (email, support ticket, etc.)
* Click **Add New Support Ticket (sample file of whatever you're working with)**
* Upload a sample email or document
* Hit `Submit` to move to the prompt setup
### Prompts
Prompts are the basic building blocks of an Agent. Think of each Prompt as an independent request to retrieve, compute, or synthesize some information from the uploaded document(s).
### Creating Prompts
Adding a Prompt is as simple as asking (in natural language) what you'd want from the AI. Kolena will intelligently use the context it has to turn that request into a prompt that precisely guides the AI into extracting the relevant information from the uploaded documents.
Once you've provided a description of what you're looking for, you can:
* Let Kolena auto-detect the output type (Create)
* Or preview the prompt, and manually adjust the instructions and output type (Preview)
Once created, Kolena will also save the Prompt to the Agent, so that future file uploads will automatically follow the same logic.
#### Customize Output Types
Each Prompt will also include an output type, which Kolena will match the data to when the Prompt runs.
Types Available:
* **Text** - for names, dates, signatures, formatted numbers, summaries, etc.
* **Table** - for structured data organized in rows and columns
* **Form** - for specific fields with corresponding values
* **Number** - for numerical values
* **True/False** - for boolean values
* **Classification** - for classifying into customizable categories
#### Examples of Prompts
Some useful prompts for our Customer Support Triage Agent:
* **Customer Name** (Text)
* **Issue Summary** (Text)
* **Next Steps for Resolution** (Text or Classification)
#### Advanced Options
There are a few options for more advanced prompts:
* Attach Files: Upload internal SOPs or guides for consistency checks
* Data Analysis: Enable if using structured Excel files or needing calculations
* Web Search: Pull public information as supporting context
***
## Using Your Agent
### Add More Files
Once your Agent is ready:
* Drag and drop additional support tickets
* Choose Import as Multiple Tickets (recommended for broad analysis)
* Or Single Ticket (for deep dive into one customer's issues)
Kolena will automatically run all of the previously defined Prompts on the new files.
### Manage Your Files
From the Agent Runs page (Support Tickets in this example), you can take further action to manage the files for your Agent:
* Delete files: Select all or specific ones to remove
* Download: Export as Excel
* Filter: By customer name, issue type, etc.
### Reporting & Collaboration
In addition to overall view provided by the Agent Runs page, you can also click into a specific Run to:
* View prompts in Editor View
* Modify or delete prompts at any time
* Use the Report View to:
* Print summaries
* Share live links
* See reasoning and citations for insights
***
## You're Ready!
You've now created a powerful Agent that can:
* Automatically parse your support tickets
* Extract key insights
* Organize customer issues and trends
* Provide structured, shareable reports
Refine your Agent over time by:
* [Integrating](/connections) your Agent with other services to bring documents in and send results out
* Adding more prompts
* Uploading more examples
* Iterating on your prompts
Happy automating with Kolena!
# SCIM Setup
Source: https://docs.agents.kolena.com/scim-setup
Automate User Management in Kolena with SCIM
This is available on the Enterprise Plan. [Contact Kolena](mailto:support@kolena.com) if you’re not on an Enterprise plan but would like to try this feature.
You can automate user provisioning and deprovisioning in Kolena through your Organization's identity provider with SCIM (System for Cross-domain Identity Management). This guide covers enabling SCIM, configuring groups, mapping roles, and managing users.
Kolena supports SCIM integration with the following identity providers:
* Okta
* Entra ID (Azure AD)
* Google Workspace
* CyberArk
* JumpCloud
* OneLogin
* PingFederate
* Rippling
## Prerequisites
* You must have admin access to your Kolena Organization
* You must have admin access to your Organization's identity provider
## Step 1: Configure Groups in your Identity Provider
In your identity provider's admin console, create groups for the users you intend on syncing with Kolena. We recommend setting up a group for [Organization `admin` users](/fine-grained-access-control#organization-vs-workspace-admins), plus separate groups that correspond to each Kolena Workspace and role.
**Example Group Names:**
Assuming that there are two Workspaces on Kolena named "Data Science" and "Engineering", you might create the following groups:
* `app-kolena-organization-admin` (for [Organization `admin` users](/fine-grained-access-control#organization-vs-workspace-admins))
* `app-kolena-data-science-admin` (for `admin` users in the "Data Science" Workspace)
* `app-kolena-data-science-editor` (for `editor` users in the "Data Science" Workspace)
* `app-kolena-data-science-viewer` (for `viewer` users in the "Data Science" Workspace)
* `app-kolena-engineering-admin` (for `admin` users in the "Engineering" Workspace)
* `app-kolena-engineering-editor` (for `editor` users in the "Engineering" Workspace)
* `app-kolena-engineering-viewer` (for `viewer` users in the "Engineering" Workspace)
### Add Users to Groups
Within your identity provider, assign users to the appropriate groups based on their desired permissions in Kolena.
## Step 2: Enable SCIM on Kolena
1. Sign in to Kolena
2. Click "Manage Organization" from your user profile at the bottom of the sidebar, or navigate to [your Organization page](https://agents.kolena.com/organization)
3. Click the "SCIM" button
4. Click the "Connect SCIM Provider" button to open a new tab with the connection steps
5. Follow the prompts to connect Kolena to your identity provider (e.g., Okta, Entra ID, Google Workspace). This typically involves generating an API key or OAuth token depending on your provider
Once SCIM is enabled, users can no longer be added manually; all user provisioning is managed exclusively through your identity provider.
### Assign Organization Roles
The next step in the connection process will be assigning user roles to your groups. For user groups that should have Organization `admin` privileges, assign the `admin` role. All other groups can be left unassigned for now, as their Workspace roles will be set later.
In the example above, you would assign `admin` role to `app-kolena-organization-admin` so that users in that group are granted Organization admin privileges in Kolena.
You can always change these role mappings by returning to Kolena and clicking the "Manage SCIM Integration" button which will take you back to the connection page in a new tab
### Verify Connection
After enabling SCIM, you should see a confirmation message indicating a successful connection and that your groups are being synced.
### Assign Workspace Roles
Once the groups are synced into Kolena, you need to assign Workspace roles to each group so that the Users receive the correct permissions within each Workspace.
1. Sign in to Kolena
2. Click "Manage Organization" from your user profile at the bottom of the sidebar, or navigate to [your Organization page](https://agents.kolena.com/organization)
3. Click on "Organization" and locate the desired Workspace, e.g. "Data Science"
4. Click the "Roles" button under "User Access", then click "Assign Roles"
5. Select the appropriate group from the dropdown and assign the corresponding role, e.g. `app-kolena-data-science-editor` as `editor`
6. Repeat for all Groups and Workspaces
If a user is in multiple groups, they are granted the highest permission level out of their groups
## Understanding User Synchronization
Once SCIM is enabled, user synchronization between your identity provider and Kolena happens automatically. However, there are some important aspects to understand about the synchronization process.
### Initial Sync
When you first enable SCIM with groups pre-populated with users, Kolena will sync all group members.
### Ongoing Sync
Changes to group membership (e.g., adding or removing users) in your identity provider are synced automatically. Kolena's sync interval is approximately 1 minute, but your identity provider may introduce additional delays (up to 30 minutes or more) before sending events.
Important Notes
* If users don't appear in Kolena after adding them to a group. Check sync frequency on your identity provider. For example, Google Cloud Identifier defaults to 30 minutes for sync frequency
* Any changes to users on the Kolena platform side will not be reflected back to your identity provider
# Manage Teams
Source: https://docs.agents.kolena.com/teams
Group Users Together for Easy Permission Management
This is available on the Enterprise Plan. [Contact Kolena](mailto:support@kolena.com) if you’re not on an Enterprise plan but would like to try this feature.
Create Teams to group multiple users together. Roles can then be assigned to these groups for easier management.
## Create Teams
To create a new Team in your Organization:
1. Click **"Add Team"** from [your Organization page](https://agents.kolena.com/organization?tab=teams).
2. (Optional) Select Users from the dropdown menu. A User can belong to multiple Teams.
3. (Optional) If multiple Workspaces are present in the Organization, select the Workspaces and roles to assign to the Team. Users in the Team will have access to these Workspaces.
4. Click **"Create Team"**.
Team membership can also be synchronized from an existing system SSO system like Entra ID. See [SCIM Setup](/scim-setup) for details.
# How Templates Work
Source: https://docs.agents.kolena.com/templated-outputs
Save Agent Outputs to Custom Word, CSV, or Excel Templates
Agents can populate a custom **Word**, **Excel**, or **CSV** document.
Common examples include:
* A Lease Abstract Template
* A Financial Model (Spreadsheet)
* A Reporting Template
When an Output Template is added to an Agent, the Agent will replace placeholders in the document with results from its Prompts.
All other styles, formatting, formulas, and macros in the document will be preserved.
## The Template System
Each Agent has three components, shown left to right in the Workflow graph on the Agent's main page:
1. **Input:** Where the Agent will look for source documents
2. **Prompts:** The instructions which the Agent will execute on the source documents
3. **Output:** Where Agent will put the results of its Prompts
We can insert the results of an Agent into an Output Template document.
Each Prompt has an associated placeholder which we can insert into the Output Template and then save to the Agent.
When the Agent completes a Run, placeholders are replaced with the results from that Prompt.
## Setting Up A Template
Starting from your Agent's main page, click the "Output" node in the Workflow graph, then click "Add Output Template".
Next, select the type of Output Template you would like to use.
Four types of templates are supported:
* Word
* CSV
* Excel
* Excel Multiple Runs
Excel Multiple Runs templates can use values from more than one Run in the same Output Template, while the other types use values from a single Run.
After selecting the type of template you want to use, a modal will open where you can upload a template file.
From this modal, you will see each Prompt defined for the Agent as well as their corresponding placeholder.
### Editing Your Template
If you are using Excel or Word for desktop on either PC or Mac, Kolena provides Add-ins for editing your templates:
* [Kolena AI Agents for Excel](/templated-outputs/excel-templates#kolena-ai-agents-for-excel)
* [Kolena AI Agents for Word](/templated-outputs/word-templates#kolena-ai-agents-for-word)
Otherwise, open your template document in a separate window using Word, Excel, or some other document editor.
Copy and paste the appropriate placeholders into your template document.
If necessary, define new [Prompts](/prompts) to populate your template.
Each new prompt will have an associated placeholder.
Kolena will preserve the font and format of the placeholders in Word and Excel documents.
For example, if your placeholder in a Word document is **`【Company Name】`** in bolded, size 24, Times New Roman and your Agent Run has `Company Name` extracted as `Kolena Inc`, the placeholder will be replaced with **Kolena Inc**, also in bolded, size 24, Times New Roman.
All elements in the template files that are not in placeholders (e.g. text, images, and borders) will be preserved.
### Uploading the Template
Once you have inserted the appropriate placeholders into your document, save it and upload it in the "Set Output Template" modal.
When uploading, Kolena will indicate which placeholders are detected in the document.
Click "Submit" to save the template to the Agent.
### Templating the Output File Name
Placeholders can also be used to populate the output file name. After uploading your template file, you can insert placeholders into the output filename in the "Manage Template" modal:
1. From the Agent's main page, click the "Output" node in the Workflow graph, then click the template:
2. The "Manage Template" modal will open. Click in the "Output Filename" input, and type a `@` to bring up a list of placeholders. Click on the desired placeholder to insert it into the filename.
3. As you insert placeholders, the application will show a preview of what the output filename would look like for your latest run.
## Using the Template
Once you've uploaded a template to the Agent, you can use it for direct downloads and for sending results to an Integration automatically.
### Downloading the Output
You can directly download the Templated Output for a given Agent Run:
1. Navigate to the desired Agent Run
2. Click into the "Report" tab
3. Click on the (Download) icon
4. Select your desired template and format from the download menu
Output Templates may be downloaded as either an editable `docx` / `xlsx`, or a generated `pdf`.
### Sending Results to an Integration
You can also specify a template for export on an [Integration](/connections):
1. From the Agent's main page, click the "Output" node in the Workflow graph and click "Send to Integration", or edit an existing Integration
2. Under the "Export Options" section for the Integration, select your desired Output Template as the "Fill Template".
## Template Structure Guides
To learn more about how templates are structured and how to use placeholders, visit the page for the appropriate template type below:
* [Word Output Templates](/templated-outputs/word-templates)
* [Excel Output Templates (Single-Run or Multiple-Run)](/templated-outputs/excel-templates)
* [CSV Output Templates](/templated-outputs/csv-jinja-templates)
# CSV Templates
Source: https://docs.agents.kolena.com/templated-outputs/csv-jinja-templates
Using templated Agent outputs in your CSV Output Templates
For CSV Output Templates, Kolena uses the [Jinja](https://jinja.palletsprojects.com/en/stable/) templating syntax with the [docxtpl](https://docxtpl.readthedocs.io/en/latest/) engine.
This style of template can also be used for creating Word templates if you are
unable to use the [Kolena AI Agents for
Word](/templated-outputs/word-templates) add-in.
## Scalar Outputs
To include scalar outputs (i.e. Text, Number, True/False, Classification) in your Word or CSV template, simply write the placeholder name in curly brackets.
For example, if you have a Prompt named "Company Name" with the placeholder company\_name, you can write:
```
{{ company_name }}
```
## Form Outputs
You can treat the values of a Kolena form Prompt as key value pairs. When using form data in templates, you can access individual fields using bracket notation:
```
{{ person_info["Name"] }} is {{ person_info["Age"] }} years old.
```
If you have a form Prompt with the template placeholder `person_info` with the fields `["Name", "Age", "Email", "Phone"]`, the unused fields are ignored.
## Table Outputs
You can loop over the values of a Kolena table Prompt.
```
Date Payee Payment Value
{%tr for item in payments %}
{{ item["Payment Date"] }} {{ item["Paid To"] }} {{ item["Amount"] }}
{%tr endfor %}
```
In this case, if my `{{ payments }}` Prompt gave me a table with details on individual payments, the above syntax would allow me to replicate that table (with formatting) into my templated output. Note that the field being retrieved from the `item` must match the Prompt's table columns but the header columns used in the template are free to differ.
### Referencing Specific Table Rows
If you wish to reference a specific row from a table Prompt, you can do so using bracket notation.
For instance, to reference the *first* row's Payment Date from a `payments` table Prompt, you can use:
```
{{ payments[0]["Payment Date"] }}
```
Be aware that accessing a row which does not exist will result in an error during template rendering.
To avoid this, you can use a conditional to check that the row exists before accessing it. For example:
```
{{ (payments[0]["Payment Date"] if payments|length > 0 else '') }}
```
## Conditionally Displaying Sections
You can conditionally display a certain section from the template file based on Prompt values using the `if` syntax:
```
{%p if tax_value > 0 %}
Due to local regulations, a tax amount of ${{ tax_value }} is owed.
{%p endif %}
```
The above blurb about tax value will only be displayed if the `{{ tax_value }}` Prompt retrieves a number greater than zero, and will otherwise not be displayed in the templated output.
## Reserved Placeholders
The following placeholders are automatically provided and can be used in templates:
* `{{ _kolena_date }}`: Date of the Agent Run in UTC, formatted as `YYYY-MM-DD`.
* `{{ _kolena_agent }}`: Name of the Agent running the Prompt.
The following placeholders are reserved for internal use by Kolena and **cannot be used** in templates. They will not be rendered in the final output:
* `{{ sheet_name }}`
* `{{ tpl_name }}`
***
# Excel Templates
Source: https://docs.agents.kolena.com/templated-outputs/excel-templates
Creating templated Agent outputs using Excel Output Templates
Excel Output Templates allow you to design templated outputs for your Agents using Excel formulas to reference your Agent outputs. A special worksheet is inserted into your Excel workbook containing Agent outputs as **named ranges** and **structured references**, which you can then reference using Excel formulas throughout your workbook. This style of template supports both single-run templates and multiple-run templates.
If you use Excel on desktop for either PC or Mac, Kolena provides an Add-in
for editing your templates within Excel: [Kolena AI Agents for
Excel](#kolena-ai-agents-for-excel)
## The Agent Worksheet
Excel Output Templates contain a special Agent Worksheet titled "Kolena Agent" that contains Agent outputs as Excel **named ranges** and **structured references**. Each Prompt in your Agent has an associated template placeholder, which can be used to refer to the corresponding output in the Agent Worksheet.
When you download a template for the first time, this worksheet may be hidden.
If you cannot see the Agent Worksheet after [setting up your
template](#working-with-excel-templates), follow the instructions here to
unhide the worksheet: [Hide or Unhide
worksheets](https://support.microsoft.com/en-us/office/hide-or-unhide-worksheets-69f2701a-21f5-4186-87d7-341a8cf53344).
To inspect the outputs available in the Agent Worksheet, you can inspect it directly, and you can also review the list of placeholders using Excel's [Name Manager](https://support.microsoft.com/en-us/office/use-the-name-manager-in-excel-4d8c4c2b-9f7d-44e3-a3b4-9f61bd5c64e4).
The data in the Agent Worksheet is structured differently depending on whether the template is for a single Run, or multiple Runs.
A single Excel cell can hold a maximum of 32,767 characters. An Agent output would be truncated if it exceeds this limit.
## Single-Run Templates
In Single-Run Excel Output Templates:
* Scalar outputs (Text, Number, True/False, Classification) are represented as named ranges
* Form and Table outputs are represented as **structured references**
### Single-Run Scalar Outputs
For simple Text, Number, True/False, or Classification Prompts, use the Prompt's template placeholder directly:
```
=placeholder_name
```
Example: If you have a Prompt named "Customer Name" with the placeholder `customer_name`, use:
```
=customer_name
```
### Single-Run Form Outputs
For form Prompts (key-value pairs), reference specific fields using bracket notation:
```
=placeholder_name[field_name]
```
Example: If you have a form prompt with template placeholder `customer_info` containing fields "Email" and "Phone":
```
=customer_info[Email]
=customer_info[Phone]
```
### Single-Run Table Outputs
For Table Prompts, you can reference:
* **The entire table**: `=placeholder_name`
* **A specific column**: `=placeholder_name[column_name]`
Example: If you have a Table Prompt with template placeholder `transactions` containing columns "Date" and "Amount":
```
=transactions (references the entire table)
=transactions[Date] (references the Date column)
=transactions[Amount] (references the Amount column)
```
Since these are Excel **structured references**, you can also use them anywhere Excel supports structured references (for example in `SUM`, `FILTER`, or `INDEX` formulas).
### Single-Run Reasoning and Citations
Reasoning and citations are stored in structured references:
* Reasoning can be found in the `kolena_reasoning` table
* Citations can be found in the `kolena_citations` table
Both tables have columns named after the Agent's Prompt template placeholders.
Example: If you have a Prompt named "Property Address" with placeholder `property_address`, you can reference the reasoning for this Prompt's output with:
```
=kolena_reasoning[property_address]
```
You can access the citations with:
```
=kolena_citations[property_address]
```
## Multiple-Run Templates
In Multiple-Run Templates, all outputs are stored in **structured references**. Each Prompt has a corresponding table, and each table row has a "Run ID" column that indicates the Run associated with that row.
### Multiple-Run Scalar Outputs
Rows from scalar outputs (Text, Number, True/False, Classification) have a "Value" column that contains the output value for the Run associated with that row:
* Each Run will have a single row in the table.
* Each row has a **Value** column with the value for that row
* Each row has also has a **Reasoning** column containing reasoning, and a **Citations** containing citations
Example: If you have a Prompt named "Customer Age" with template placeholder "customer\_age", you will have an Excel table named `customer_age` with the following structure:
| Run ID | Value | Reasoning | Citations |
| - | - | - | - |
| 1 | 25 | ... | ... |
| 2 | 77 | ... | ... |
| 3 | 45 | ... | ... |
| ... | ... | ... | ... |
To get the list of customer ages, use this formula:
```
=custom_age[Value]
```
To get average customer age across runs, you could use a formula like:
```
=AVERAGE(NUMBERVALUE(customer_age[Value]))
```
Table cells are always formatted as text, so you may need to convert to
numbers using functions such as `NUMBERVALUE` before performing calculations.
### Multiple-Run Form Outputs
Rows from form outputs have columns corresponding to the Prompt's fields:
* Each Run will have a single row in the table
* Each row has a column for each Prompt field
* Each row has also has a **Reasoning** column containing reasoning, and a **Citations** containing citations
Example: If you have a form Prompt named "Tax Rate" with template placeholder "tax\_rate", and three columns "North America", "Europe", and "Asia", you will have an Excel table with the following structure:
| Run ID | North America | Europe | Asia | Reasoning | Citations |
| - | - | - | - | - | - |
| 1 | 0.25 | 0.20 | 0.15 | ... | ... |
| 2 | 0.26 | 0.21 | 0.16 | ... | ... |
| 3 | 0.24 | 0.19 | 0.14 | ... | ... |
| ... | ... | ... | ... | ... | ... |
To get the list of European tax rates, use the formula:
```
=tax_rate[Europe]
```
To get the mininum Asian tax rate, use a formula like:
```
=MIN(NUMBERVALUE(tax_rate[Asia]))
```
### Multiple-Run Table Outputs
Rows from table outputs have columns corresponding to the Prompt's columns:
* Each Run can have multiple rows in the table (one row for each row in the table output)
* Each row has a column for each Prompt column
* Each row has a **Run ID** column that indicates the Run associated with that row
* Each row also has a **Reasoning** column containing reasoning, and a **Citations** column containing citations. Only the first row for each Run ID will have these columns populated.
Example: If you have a Table Prompt named "Transactions" with template placeholder `transactions`, and columns "Date", "Amount", and "Description", you will have an Excel table named `transactions` with the following structure:
| Run ID | Date | Amount | Description | Reasoning | Citations |
| - | - | - | - | - | - |
| 1 | 2024-01-15 | 100.00 | Purchase | ... | ... |
| 1 | 2024-01-16 | 250.50 | Payment | *(empty)* | *(empty)* |
| 2 | 2024-02-01 | 75.25 | Refund | ... | ... |
| 2 | 2024-02-05 | 300.00 | Purchase | *(empty)* | *(empty)* |
| 2 | 2024-02-10 | 50.00 | Fee | *(empty)* | *(empty)* |
| ... | ... | ... | ... | ... | ... |
To get all transactions from Run 1, you could use a formula like:
```
=FILTER(transactions, transactions[Run ID] = 1)
```
To get the sum of all amounts across all runs, use:
```
=SUM(NUMBERVALUE(transactions[Amount]))
```
### Multiple-Run Files
Multiple-run templates have an additional table named `kolena_runs` that keeps track of the input files associated with each run. It has two columns:
* **Run ID**: The Run ID for the row (the same ID used in other Prompt output tables)
* **Files**: A list of the filenames of the input files associated with the run, separated by commas.
An example table would look like:
| Run ID | Files |
| - | - |
| 1 | document1.pdf, invoice\_2024\_01.pdf |
| 2 | contract\_abc.docx |
| 3 | report.xlsx, data.csv, summary.pdf |
| ... | ... |
***
## Kolena AI Agents for Excel
The **Kolena AI Agents for Excel** add-in lets you create and edit [Excel Output Templates](/templated-outputs/excel-templates) directly in Microsoft Excel. You can turn any workbook into an Output Template, reference Agent outputs with Excel formulas, preview how the template behaves with different Agent runs, and save or load templates.
### Requirements
**Kolena AI Agents for Excel** is supported in the following versions of Excel:
* Excel on Windows (Microsoft 365)
* Excel 2019 or later on Mac
* Excel on Mac (Microsoft 365)
The add-in uses the same security model as the rest of the platform: the same
authentication, the same permission checks, and full audit logging for every
action.
### Getting Started
#### Installing the Add-in
##### Sign into Office 365
Before installing the add-in, make sure that you are signed-in to Excel:
* Open Excel, and open **File** > **New From Template**
* If you see a "Sign In" button in the upper-righthand corner, click this and follow the sign in process. If you see your username there already, you are already signed-in.
##### Install from Excel
The simplest way to install the add-in is from within Excel, by searching the Microsoft Add-in Marketplace:
* In Excel, on the **Home** ribbon navigate to **Add-ins** > **More Add-ins**
* Search for "Kolena AI Agents for Excel" and install it
* After installing, the add-in should appear in your **Home** ribbon, or in the list of installed add-ins found by clicking **Home** > **Add-ins**
If the add-in does not appear after installing, [make sure you are signed
in](#sign-into-office-365) and try installing again.
##### Install from the Web
You can also install from the web by following this link to add the add-in to your Office 365 account: [Kolena AI Agents for Excel](https://marketplace.microsoft.com/en-us/product/office/WA200009745?tab=Overview)
* After installing the add-in to your Office 365 account, you should be taken to the app page for Kolena AI Agents for Excel. If not, you can access this page by visiting **Settings** (sidebar) > **Integrated apps** > **Kolena AI Agents for Excel**
* Click the link from the Microsoft 365 Admin Center to open the add-in in Excel: **Actions** > **Open app** > **Open in Excel**
* After installing, you should be presented with a worksheet prompting you to open the add-in:
#### Opening the Add-in
* Once installed, click the **Home** > **Kolena Agents** or **Home** > **Add-ins** > **Kolena Agents** to open the add-in pane
* When you open the add-in, you'll be presented with the login screen
* Click "Log In" to open the authentication dialog window. Follow the normal process to log in with your Kolena credentials
### Setting Up Your Template
#### Creating a New Template
To create a new template, we first need to associate it with the correct Agent:
* To begin, open an existing workbook or create a blank one if you're starting from scratch
* Open the Kolena Agents add-in and log in
* You will see a list of the Agents available in your organization. Click the desired Agent. You can use the search bar to help you locate the correct Agent
* If your Agent does not have any existing templates saved, you will be prompted to enter a name for your new template. Enter a filename and click **Create**
You can use [filename
placeholders](/templated-outputs#templating-the-output-file-name) when
choosing a filename in order to template the output filename.
* If your Agent already has templates saved, you will be prompted to selected a template. Click **Add New** at the bottom of the list, then enter a filename and click **Create**
* The current workbook will be saved as a template to your Agent. You can now begin [editing](#editing-your-template).
#### Working with an Existing Agent Template
If your Agent already has a template saved, the first step is to open the template's Excel workbook. If you don't already have this workbook available, you can retrieve it from Kolena in two ways:
##### 1. Download from the Kolena Agents Excel Add-in
* Open the add-in from any Excel workbook
* If the add-in opens to the template editor interface (because your Workbook is already associated with an Agent template), use the breadcrumbs at the top of the app to navigate back to the "Agents" screen
* Select the Agent whose template you want to load
* On the template selection screen, select the template you want to load
* When prompted to load the template from the server, select "Load template contents from server"
* The template will open in a new Excel window. Open the add-in in the new window to begin editing
You may need to select the appropriate template again in the new window if
this template has never been edited in the add-in before. If the add-in opens
to the Agents list in the new window, follow the steps above but when prompted
to load the template from the server, select "Continue with existing workbook
data"
##### 2. Download from the Kolena Agents Web Application
* From your Agent's main page, click the "Output" node in the Workflow graph
* Click the menu dots next to the template you would like to download, and select **Download Template**
### Editing Your Template
The template editor provides:
* **Breadcrumb navigation** showing your current Agent and template
* **Update Agent Worksheet button** to preview how templated output will look with different Agent runs
* **Save button** to save your changes back to the Agent
* **Placeholder list** showing all available Agent outputs you can reference
### Previewing Templates
#### Updating the Agent Worksheet
You can preview how templated output will look with different Agent runs:
1. Click **Update Agent Worksheet** in the template editor
2. The "Kolena Agent" worksheet will be updated with data from the selected run
3. Your template formulas will automatically recalculate with the new data
#### Selecting Different Runs
To preview with a different Agent run:
1. Click the dropdown arrow next to the **Update Agent Worksheet** button
2. Use the up and down arrow buttons to navigate between runs
3. Click **Update Agent Worksheet** to update the template with the selected run's data
This allows you to:
* Test your template with different data sets
* Verify formulas work correctly across various scenarios
* Ensure formatting looks good with different data volumes
### Saving Templates
#### Saving Your Changes
When you're ready to save your template:
1. Click the **Save** button in the template editor
2. The current workbook will be uploaded and replace the template on the Agent
3. A checkmark will appear briefly to confirm the save was successful
Once saved, the template will be available for:
* Direct downloads from Agent runs
* Automated export to connected Integrations
### Best Practices
* **Save frequently** while editing to avoid losing work
* **Preview with multiple runs** before saving to ensure your template works with different data
* **Test formulas** with edge cases (empty data, long text, etc.)
# Word Templates
Source: https://docs.agents.kolena.com/templated-outputs/word-templates
Using templated Agent outputs in your Word Output Templates
For Word Output Templates, Kolena provides the **Kolena AI Agents for Word Add-In**, which lets you create and edit Word Output Templates directly in Microsoft Word. You can turn any document into an Output Template, reference Agent outputs with template placeholders, preview how the template behaves with different Agent runs, and save or load templates.
Alternatively, if you are unable to use the add-in, you can manually create
templates using [Jinja placeholders](/templated-outputs/csv-jinja-templates).
## Requirements
**Kolena AI Agents for Word** is supported in the following versions of Word:
* Word on Windows (Microsoft 365)
* Word 2019 or later on Mac
* Word on Mac (Microsoft 365)
The add-in uses the same security model as the rest of the platform: the same
authentication, the same permission checks, and full audit logging for every
action.
## Getting Started
### Installing the Add-in
#### Sign into Office 365
Before installing the add-in, make sure that you are signed-in to Word:
* Open Word, and open **File** > **New From Template**
* If you see a "Sign In" button in the upper-righthand corner, click this and follow the sign in process. If you see your username there already, you are already signed-in.
#### Install from Word
The simplest way to install the add-in is from within Word, by searching the Microsoft Add-in Marketplace:
* In Word, on the **Home** ribbon navigate to **Add-ins** > **More Add-ins**
* Search for "Kolena AI Agents for Word" and install it
* After installing, the add-in should appear in your **Home** ribbon, or in the list of installed add-ins found by clicking **Home** > **Add-ins**
If the add-in does not appear after installing, [make sure you are signed
in](#sign-into-office-365) and try installing again.
#### Install from the Web
You can also install from the web by following this link to add the add-in to your Office 365 account: [Kolena AI Agents for Word](https://marketplace.microsoft.com/en-us/product/WA200010075?tab=Overview)
* After installing the add-in to your Office 365 account, you should be taken to the app page for Kolena AI Agents for Word. If not, you can access this page by visiting **Settings** (sidebar) > **Integrated apps** > **Kolena AI Agents for Word**
* Click the link from the Microsoft 365 Admin Center to open the add-in in Word: **Actions** > **Open app** > **Open in Word**
* After installing, you should be presented with a document prompting you to open the add-in:
### Opening the Add-in
* Once installed, click the **Home** > **Kolena Agents** or **Home** > **Add-ins** > **Kolena Agents** to open the add-in pane
* When you open the add-in, you'll be presented with the login screen
* Click "Log In" to open the authentication dialog window. Follow the normal process to log in with your Kolena credentials
## Setting Up Your Template
### Creating a New Template
To create a new template, we first need to associate it with the correct Agent:
* To begin, open an existing document or create a blank one if you're starting from scratch
* Open the Kolena Agents add-in and log in
* You will see a list of the Agents available in your organization. Click the desired Agent. You can use the search bar to help you locate the correct Agent
* If your Agent does not have any existing templates saved, you will be prompted to enter a name for your new template. Enter a filename and click **Create**
You can use [filename
placeholders](/templated-outputs#templating-the-output-file-name) when
choosing a filename in order to template the output filename.
* If your Agent already has templates saved, you will be prompted to selected a template. Click **Add New** at the bottom of the list, then enter a filename and click **Create**
* The current document will be saved as a template to your Agent. You can now begin editing your template.
### Working with an Existing Agent Template
If your Agent already has a template saved, the first step is to open the template's Word document. If you don't already have this document available, you can retrieve it from Kolena in two ways:
#### 1. Download from the Kolena Agents Word Add-in
* Open the add-in from any Word document
* If the add-in opens to the template editor interface (because your document is already associated with an Agent template), use the breadcrumbs at the top of the app to navigate back to the "Agents" screen
* Select the Agent whose template you want to load
* On the template selection screen, select the template you want to load
* When prompted to load the template from the server, select "Load template contents from server"
* The template will open in a new Word window. Open the add-in in the new window to begin editing
You may need to select the appropriate template again in the new window if
this template has never been edited in the add-in before. If the add-in opens
to the Agents list in the new window, follow the steps above but when prompted
to load the template from the server, select "Continue with existing document
data"
#### 2. Download from the Kolena Agents Web Application
* From your Agent's main page, click the "Output" node in the Workflow graph
* Click the menu dots next to the template you would like to download, and select **Download Template**
## Editing Your Template
The template editor provides:
* **Breadcrumb navigation** showing your current Agent and template
* **Preview button** to preview how templated output will look with different Agent runs
* **Save button** to save your changes back to the Agent
* **Placeholder list** showing all available Agent outputs you can reference
## Inserting Placeholders
When editing a template, the add-in displays a list of the available Agent outputs. Within each output's card, will be one or more buttons that can be clicked to insert a placeholder for that output.
Placeholders appear in the document as the Prompt name surrounded by special brackets - for example: `【Property Address】`
### Scalar / Form Placeholders
To insert a placeholder for a scalar output (i.e. a Text, Number, True / False, Classification) or a form output, simply position your cursor in the document where you want the placeholder to go, and click the appropriate placeholder button.
### Table Placeholders
To insert a Table placeholder, first make sure your cursor is positioned within a Word table cell, then click the appropriate placeholder button.
When Table placeholders are used in a Word table, a single table row in your template will be replaced with multiple rows in the final output (one for each row in the Agent Output).
If you insert a table placeholder outside of a Word table cell, it will
function correctly. The placeholder will not be replaced with the Agent
Output.
### Placeholder Styling
After inserting a placeholder, you may style the the placeholder as desired. These styles will carry over when the placeholder is replaced with Agent Output.
## Previewing Templates
### Previewing with a Run
You can preview how templated output will look with different Agent runs:
1. Click **Preview** in the template editor
2. A new Word document window will open with the rendered output from the selected run
3. Your original template document will remain unchanged
### Selecting Different Runs
To preview with a different Agent run:
1. Click the dropdown arrow next to the **Preview** button
2. Use the up and down arrow buttons to navigate between runs
3. Click **Preview** to render the template with the selected run's data
This allows you to:
* Test your template with different data sets
* Verify placeholders render correctly across various scenarios
* Ensure formatting looks good with different data volumes
## Saving Templates
### Saving Your Changes
When you're ready to save your template:
1. Click the **Save** button in the template editor
2. The current document will be uploaded and replace the template on the Agent
3. A checkmark will appear briefly to confirm the save was successful
Once saved, the template will be available for:
* Direct downloads from Agent runs
* Automated export to connected Integrations
## Best Practices
* **Save frequently** while editing to avoid losing work
* **Preview with multiple runs** before saving to ensure your template works with different data
# Organization Tiers
Source: https://docs.agents.kolena.com/tiers
Select a Tier Based on Your Organization's Needs
Kolena offers three tiers: Starter, Professional, and Enterprise.
Each tier includes different features, credit quotas, and user seats as listed below.
## Features By Tier
| Feature | `Starter` | `Professional` | `Enterprise` |
| :- | :-: | :-: | :-: |
| [API + Python SDK Access](/connecting-to-kolena) | ✅ | ✅ | ✅ |
| [Data Analysis](/prompts#data-analysis) | ✅ | ✅ | ✅ |
| [Integrations](/connections) | ✅ | ✅ | ✅ |
| [Templated Outputs](/templated-outputs) | ✅ | ✅ | ✅ |
| Unlimited Agents | ✅ | ✅ | ✅ |
| [Web Search](/prompts#web-search) | ✅ | ✅ | ✅ |
| [Access Audit Logs](/faq/security#can-i-view-audit-or-access-logs-for-usage-on-kolena%3F) | ❌ | ❌ | ✅ |
| [Agent-Level Permissions](/fine-grained-access-control#manage-agent-access) | ❌ | ❌ | ✅ |
| [Custom Roles](/custom-roles) | ❌ | ❌ | ✅ |
| [Data Retention Policies](/data-retention) | ❌ | ❌ | ✅ |
| [Service Users](/api-keys#service-users-and-api-keys) | ❌ | ❌ | ✅ |
| [SSO / SCIM (e.g. Entra ID)](/scim-setup) | ❌ | ❌ | ✅ |
| [Teams](/teams) | ❌ | ❌ | ✅ |
| [Workspaces](/workspaces) | ❌ | ❌ | ✅ |
## Credit Quota By Tier
Each tier comes with a monthly quota of credits.
These credits do not roll over.
If your Organization exceeds the monthly quota, overage credits can be used.
Prepay for overage credits to receive a discounted rate.
All prepaid credits roll over indefinitely.
| Feature | Monthly Credit Quota\* |
| :- | :-: |
| Starter | 800 |
| Professional | 1800 |
| Enterprise | Custom Quote |
\* Additional credit quotas are available with a custom plan.
## User Seats By Tier
Each user seat is a unique login, for instance each email address which needs to log in to the platform.
| Feature | # Users |
| :- | :-: |
| Starter | 3 |
| Professional | 10 |
| Enterprise\* | 15 |
\* Additional seats are available with a custom plan.
# Tracking Usage
Source: https://docs.agents.kolena.com/tracking-usage
View usage within your Organization
## How Usage Is Counted
The unit of usage in Kolena is called a **credit**.
Credits are consumed whenever an Agent executes a Prompt.
See [our FAQ page](/faq/usage) for details on how to optimize credit usage.
## Managing Credits
Each pricing tier comes with a [monthly credit quota](/tiers#credit-quota-by-tier) of credits.
Monthly credit quotas reset on the first day of each month and do not roll over.
If your monthly credit quota is consumed, you can continue using Kolena with **overage credits**.
These are additional credits that can be purchased in bulk or paid for as you go.
All prepaid credits are added to your Organization's credit balance and will roll over indefinitely.
### Viewing Credit Usage
Credit usage is displayed transparently in multiple locations:
* On the [Manage Organization page](https://agents.kolena.com/organization) for overall usage by Agent
* Within [API responses for individual Runs](/api-reference/add-agent-run)
* Within the details for each Run
To view usage for an individual Run, navigate to that Run in Kolena and open the ellipsis menu in the top-right corner:
### Estimating Credit Usage
The most accurate way to estimate credit usage for an Agent is to create the Agent and then execute a new Run on it.
This will provide an exact measurement of real usage that you can multiply for N Runs.
In addition, Kolena provides a **Credit Calculator** tool to help estimate credit usage.
This is available from your [Organization Usage page](https://agents.kolena.com/organization).
An existing Agent can be selected to estimate based on historical usage, or an estimate can be produced using the number of prompts required and the number of pages in an average Run.
## Legacy Plans: Page-Based Usage
Some existing customers are on page-based pricing plans.
Kolena will continue to support these plans, but new customers will be on the new user-based pricing plans described above.
Usage for your Organization is tracked from the number of pages uploaded.
Each pricing plan comes with a credit of new page uploads per month.
You can view your current usage and remaining credits from [your Organization page](https://agents.kolena.com/organization).
To increase your monthly page upload limit, [contact Kolena](mailto:support@kolena.com) to upgrade your subscription to a higher plan or purchase additional pages with bulk pricing.
### How Are Pages Counted?
Page uploads are counted in the following way for different file formats:
| Uploaded File Type | 1 Page Equivalent |
| - | - |
| Scanned Documents | 1 scanned page |
| PDF | 1 PDF page |
| Office Documents | 1 `.docx` or 1 `.pptx` slide |
| Images | 1 image |
| Spreadsheets | \~70 rows |
| Emails, Text | \~500 words of text |
| Audio | \~500 words of conversation |
# Manage Users
Source: https://docs.agents.kolena.com/user-management
Grant Access within your Organization
User membership controls who can login to Kolena within your Organization. To manage this membership, click "Manage Organization" from your user profile at the bottom of the sidebar, or navigate to [your Organization page](https://agents.kolena.com/organization?tab=users).
Each Organization has an allowed number of Users [according to its tier](/tiers#user-seats-by-tier).
## Add Users
To add a new User to your Organization:
1. Click "Add User" from the Organization page
2. Enter the User's email address and select a role
3. Click "Add" to send an invitation and grant access to the User
4. The User can now accept the invitation and join your Organization
User membership can also be synchronized from an existing system SSO system like Entra ID. See [SCIM Setup](/scim-setup) for details.
## Assign Roles
All Users are assigned one of the following roles:
* `viewer`
* `editor`
* `admin`
Based on their role, Users can perform the following actions:
| Action | `viewer` | `editor` | `admin` |
| :- | :-: | :-: | :-: |
| View Agents | ✅ | ✅ | ✅ |
| View Integrations | ✅ | ✅ | ✅ |
| View Dashboards | ✅ | ✅ | ✅ |
| View Prompt results | ✅ | ✅ | ✅ |
| Upload Runs | ✅ | ✅ | ✅ |
| Comment on Prompt results | ✅ | ✅ | ✅ |
| Override Prompt results | ✅ | ✅ | ✅ |
| Create API Keys | ✅ | ✅ | ✅ |
| Create/Modify/Delete Agents | ❌ | ✅ | ✅ |
| Create/Modify/Delete Agent Data Retention Policies | ❌ | ✅ | ✅ |
| Create/Modify/Delete Integrations | ❌ | ✅ | ✅ |
| Create/Modify/Delete Dashboards | ❌ | ✅ | ✅ |
| Create/Modify/Delete Ground Truths and Validation | ❌ | ✅ | ✅ |
| Create/Modify/Delete Folders and move Agents | ❌ | ✅ | ✅ |
| Create/Modify/Delete Prompts | ❌ | ✅ | ✅ |
| Manage Organization Users | ❌ | ❌ | ✅ |
| Manage all API Keys API keys and Service Users | ❌ | ❌ | ✅ |
| Manage Organization Data Retention Policies | ❌ | ❌ | ✅ |
Enterprise customers can assign roles at the Workspace or Agent level. See
Fine Grained Access Control for
details.
# Webhook Integration
Source: https://docs.agents.kolena.com/webhook
Develop handler for webhook integration
When an Agent completes a Run, Kolena will send an HTTP request of the Run result to the webhook URL. The server listening for webhook deliveries at that URL can take action when it receives one.
### Run Result Format
When making a request to your webhook, Kolena will send a JSON object of the following format:
* `agent_id`: Agent id.
* `run_id`: Agent Run id.
* `run_url`: Link to web UI of the Run result.
* `created`: Timestamp when the Run result was created.
* `updated`: Timestamp when the Run result was last updated.
* `files`: List of files of the Run.
* `order`: User specified order of the prompts for the Agent. It is mainly used for UI display.
* `data`: Prompt results of the Run, a dictionary keyed by prompt name.
Here's an example of the JSON object:
```json theme={null}
{
"agent_id": 1,
"run_id": 1,
"run_url": "https://agents.kolena.com/my_org/agents/1/runs/1",
"created": "2025-01-01T00:00:00",
"updated": "2025-01-05T00:00:00",
"files": [
"demo1.pdf",
"demo2.csv"
],
"order": [
"prompt_1",
"prompt_2"
],
"status": "success",
"data": {
"prompt_1": {
"status": "success",
"metadata": {
"citations": [
{
"file": "demo1.pdf",
"pages": [
2,
5
]
}
],
"confidence": 1,
"reasoning": "Looking at file demo1.pdf, ..."
},
"value": "foo"
},
"prompt_2": {
"status": "success",
"metadata": {
"citations": [
{
"file": "demo2.csv",
"pages": []
}
],
"confidence": 1,
"reasoning": "The order amount is listed in demo2.csv"
},
"value": 123
}
}
}
```
### Respond to Webhook Request
Your webhook handler should respond to the webhook request with an HTTP 2xx status within ten seconds. We will retry up to three times if it does not, with exponential back off. If the delivery still fails after that, we will mark the delivery as failed, and will schedule another delivery after a longer period, for up to five times. If these attempts still fail, the Run result will be omitted from any further delivery.
#### Example Servers
Below are example servers demonstrating handling webhook deliveries. Since this is an example server, you can use any arbitrary value for the `KOLENA_WEBHOOK_SECRET` environment variable. When creating your own production server, you should use the secret generated by Kolena after [creating the Webhook integration](/connections#show-webhook-configuration-steps).
```python main.py [expandable] theme={null}
import logging
import os
from fastapi import FastAPI
from starlette.requests import Request
from kolena_agents import webhook
# this is the secret you received when registering your webhook
secret = os.environ["KOLENA_WEBHOOK_SECRET"]
logger = logging.getLogger()
logger.setLevel(logging.INFO)
app = FastAPI()
@app.post("/")
async def root(request: Request) -> dict:
body = await request.body()
result = webhook.construct_event(request_body=body, secret=secret, request_headers=request.headers)
logging.info(result.model_dump_json(indent=2))
return dict(agent_id=result.agent_id, run_id=result.run_id)
```
Start the server:
```
export KOLENA_WEBHOOK_SECRET=
fastapi run --port main.py
```
```python main.py [expandable] theme={null}
import logging
import os
from flask import Flask
from flask import request
from kolena_agents import webhook
logger = logging.getLogger()
logger.setLevel(logging.INFO)
app = Flask(__name__)
secret = os.environ["KOLENA_WEBHOOK_SECRET"]
@app.route("/", methods=["POST"])
def root():
body = request.get_data()
result = webhook.construct_event(request_body=body, secret=secret, request_headers=request.headers)
logging.info(result.model_dump_json(indent=2))
return dict(agent_id=result.agent_id, run_id=result.run_id)
```
Start the server:
```
export KOLENA_WEBHOOK_SECRET=
flask --app main.py run --port
```
### Testing Webhooks
The Python SDK provides a CLI to help test your webhook locally. [Install Python SDK](/python-client/quickstart#installation) and set up an API key.
Forward events from an Agent to your webhook by using `listen` command.
```
export KOLENA_WEBHOOK_SECRET=
kolena-agents listen --agent-id --secret "$KOLENA_WEBHOOK_SECRET" --forward http://localhost:
```
This will listen to new Agent Run results and forward them to your service set in the `--forward` option.
You can use the secret from an existing webhook integration, if you already created one, or any arbitrary value for `KOLENA_WEBHOOK_SECRET`, as we are just locally testing.
The secret passed to the CLI will be used by the `kolena_agents` CLI to sign the request forwarded to your service.
The `--tail ` option can be provided to fetch `N` most recent results of the Agent. If `--tail` isn't included, the command would only listen to new results.
You can test your Agent with demo data without relying on the Agent having active data using the `sample` command.
```
export KOLENA_WEBHOOK_SECRET=
kolena-agents sample --agent-id --secret "$KOLENA_WEBHOOK_SECRET" --forward http://localhost:
```
### Register Webhook
Once your service is ready to process Kolena webhook events, follow the steps in [Integrations](/connections#webhook) to have your Agent send its results to it.
### Technical Details
#### Kolena Custom Headers
Kolena includes additional information in request headers:
* `X-Kolena-Timestamp`: Timestamp of the request
* `X-Kolena-Delivery-ID`: Unique id for the request
* `X-Kolena-Signature`: HMAC value of request body, timestamp, and Delivery ID signed with webhook secret
You can use this information to verify that requests are coming from Kolena, detailed in the next section.
#### Signature Verification
When Kolena makes a request to your webhook URL, it will use the shared secret to create a signature from the timestamp the request is created, the request Delivery ID, and the body of the request.
The signature, timestamp and Delivery ID are put in the request headers `X-Kolena-Signature`, `X-Kolena-Timestamp`, and `X-Kolena-Delivery-ID`, respectively.
Upon receiving a request, use the secret to compute the signature from the `X-Kolena-Timestamp`, `X-Kolena-Delivery-ID` and request body, and verify the signature you computed matches the value in `X-Kolena-Signature`.
It is also advised to verify that `X-Kolena-Timestamp` is within a short time window from the time the request is received.
Kolena provides a utility function `webhook.construct_event` in our [Python SDK](/python-client/quickstart). It performs signature verification and returns the parsed JSON object.
```python theme={null}
from kolena_agents import webhook
# `secret` is the value you receive when registering the webhook
result = webhook.construct_event(request_body, secret, request_headers)
```
# Workspaces
Source: https://docs.agents.kolena.com/workspaces
Isolate Agents, data access, and permissions
This is available on the Enterprise Plan. [Contact Kolena](mailto:support@kolena.com) if you’re not on an Enterprise plan but would like to try this feature.
Kolena supports multiple Workspaces to separate projects or teams with your Organization.
Each Workspace is an isolated environment which can be permissioned independently.
Workspaces are helpful for use cases such as isolating development environments, or to separate different departments within a larger Organization.
## Creating Workspaces
Available Workspaces can be viewed from [your Organization page](https://agents.kolena.com/organization?tab=workspaces).
Upon request, Kolena will create additional Workspaces for your Organization.
## Manage Workspace Access
Users or Teams can be roles assigned per Workspace.
This means one user may have broad access to one Workspace, limited access to another Workspace, and no access at all to other Workspaces.
Based on the Workspace role, Users can perform the following actions, *regardless of their permission on any particular Agent* in the Workspace:
| Action | `viewer` | `editor` | `admin` |
| :- | :-: | :-: | :-: |
| Create API Keys | ✅ | ✅ | ✅ |
| Create new Agents | ❌ | ✅ | ✅ |
| Create/Modify/Delete all Folders, move Agents between them | ❌ | ✅ | ✅ |
| View all Agents | ❌ | ❌ | ✅ |
| Create/Modify/Delete Integrations on all Agents | ❌ | ❌ | ✅ |
| Create/Modify/Delete Data Retention Policies on all Agents | ❌ | ❌ | ✅ |
| Create/Modify/Delete Dashboards on all Agents | ❌ | ❌ | ✅ |
| Create/Modify/Delete Folders for all Agents | ❌ | ❌ | ✅ |
| Create/Modify/Delete Prompts on all Agents | ❌ | ❌ | ✅ |
| Create/Modify/Delete Runs on all Agents | ❌ | ❌ | ✅ |
| Manage permissions for all Agents | ❌ | ❌ | ✅ |
| Delete all Agents | ❌ | ❌ | ✅ |
Organization `admin`s can assign Workspace roles to each User or Team when creating new Users or Teams:
In addition, Workspace roles may be modified by `admin`s by navigating to the "Roles" tab for each Workspace and updating the selected role.
### Organization vs Workspace Admins
When multiple Workspaces are present in an Organization, there are two levels of `admin` roles: Workspace `admin` and Organization `admin`.
| **Action** | **Workspace `admin`** | **Organization `admin`** |
| :- | :-: | :-: |
| Check usage by Agents in a Workspace | ✅ | ✅ |
| Manage permissions within a Workspace | ✅ | ✅ |
| Check usage by Agents in all Workspaces | ❌ | ✅ |
| Manage permissions across all Workspaces | ❌ | ✅ |
| Create or delete Users and Teams | ❌ | ✅ |
| Manage all API keys and Service Users in the Organization | ❌ | ✅ |
| Manage [Data Retention Policies](/data-retention) | ❌ | ✅ |
| Manage [SCIM Integration](/scim-setup) | ❌ | ✅ |
# Writing Effective Prompts
Source: https://docs.agents.kolena.com/writing-effective-prompts
Learn how to get the most from your Agents
Think of your Kolena Agents as junior employees.
They are eager and fast, but they require good instructions in order to do their work.
The more detailed and direct your prompts, the better your results will be.
This guide will walk you through what makes an effective prompt and how you can write them for your use case.
## 1. Provide Clear and Specific Instructions
Tell the Agent exactly what to do, in what order, and to what depth.
| Vague prompt | Improved prompt |
| - | - |
| Summarize this report. | In 150 words or fewer, summarize the *Key Risks* section of the attached Q2 Cyber-Security Report. Highlight any new vulnerabilities and their potential business impact. |
| Get the closing date. | Get the closing date of the transaction. Return the date in MM/DD/YYYY format. If multiple dates are found return the latest one. If no dates are found return "N/A". |
**Tips**
* Break complex tasks into steps (“First…, next…, then…, finally…”).
* Describe the required output (“bullet list,” “table,” “two-sentence summary”).
* Mention any constraints (word limit, tone, region, currency, format, deadline).
Make sure your prompt is not *too* specific.
**Example**: Suppose you want to extract an account balance from statements.
If you expect *all* statements to have a section titled 'Account Summary', you can safely include "Extract the account balance appearing under section 'Account Summary'" in your prompt.
*However*, if the account balance will be present in different sections for each document, keep your prompt flexible. Use wording like "Review the document to find the account balance. Focus on areas of the document like ... to find the value."
***
## 2. Format Your Prompt
Humans understand instructions best when they are organized and readable; your Agents are no different.
Reflect on how you structure information in an email or a document and apply the same thinking to your prompts:
* Use headings and paragraphs to separate major sections or different ideas
* Use numbered or bulleted lists for listing key points
* Use bold text, uppercase, and italics to communicate emphasis and intent
* Use quote blocks for specific reference text
This formatting can be achieved with something called *Markdown*.
Markdown is special characters you can add to your prompt to denote headings, lists, boldness, and more.
Here is a quick reference guide on adding this formatting:
### Markdown Cheat-Sheet
| Purpose | Markdown Syntax | Example in Prompt |
| - | - | - |
| Heading | `# Heading` / `## Subheading` | `## Instructions` |
| Bold | `**bold text**` | `Highlight **important** terms` |
| Italic | `_italic text_` | `_except under the following conditions_`. |
| Bullet list | `- Item` or `* Item` | `- Step one` |
| Numbered list | `1. Item` | `1. Do this` |
| Quote | `> text` | `> Always include context in your prompt` |
***
## 3. Supply Business Context
AI doesn't know your internal jargon, project history, or the audience you're targeting.
Provide this knowledge within your prompt by attaching reference files in your prompts.
For example, it may help to add the following to the prompt:
* **Business objective** - “The report will be presented to the Board to secure budget.”
* **Audience knowledge** - “Assume the audience is the compliance team.”
* **Attach relevant data** - “Use the revenue figures from the attached Excel; ignore years before 2023.”
* **Style preferences** - “Our brand voice is friendly but authoritative; contractions are encouraged.”
***
## 4. Provide Examples
Provide examples of your output in the prompt.
For example
> Identify the top 5 variances by dollar amount.
> Order the results starting with the largest variance.
> Return each as the following format:
>
> \## 1. \
>
> % Variance: ...
>
> Breakdown:
>
> * Date, Description, Debit / Credit
***
## 5. Be Explicit About the Required Output
Tell the Agent exactly **what format** and **what level of detail** you need.
* **Tables** - “Produce a Markdown table with columns: Country, FY24 Revenue, YoY Growth.”
* **Lists vs prose** - “5-point bullet list, no paragraphs.”
* **Multiple outputs** - “Give me two things: (1) a 50-word summary, (2) three hashtags.”
***
## 6. Constrain the Scope
Keep the Agent on guardrails by constraining what it should consider.
* **Time frame** - “Focus on articles published after 1 Jan 2024.”
* **Source limits** - “Cite only Gartner or McKinsey reports.”
* **Perspective** - “Write from the customer's point of view, not ours.”
* **Exclusions** - “Exclude any mention of competitors.”
***
## 7. Mind the Tone and Audience
Match the style to the reader.
Add a single sentence such as *“Use plain-English legal language suitable for a regulator.”*
| Audience | Tone cue |
| - | - |
| C-suite | “Brief, data-driven, no jargon.” |
| Customers | “Warm, encouraging, benefit-oriented.” |
| Regulators | “Formal, precise, reference relevant statutes.” |
***
## 8. Iterate and Refine
1. **Review the first draft** - Does it miss anything?
2. **Add correction cues** - “You overlooked the Asia-Pacific numbers—please include them.”
Remember: even minor tweaks (“shorten to 100 words,” “replace passive voice”) are faster than rewriting by hand.
***
## 9. Common Pitfalls to Avoid
| Pitfall | How to avoid |
| - | - |
| Too many goals in one prompt | Split into separate prompts |
| Relying on “obvious” context | Spell out acronyms and background |
| Contradicting instructions | Don't request a table in your prompt but select "Text" for your output type |
***
### Final Thoughts
Good prompts are an investment: a few extra minutes clarifying your needs can save hours of revision later.
Treat your Agents as capable teammates—give them the *who*, *what*, *why*, and *how*, and they'll handle the *work*.