Contextual AI icon

Contextual AI

Access Contextual AI tools for agents, parsing, querying, and reranking.

Agent → Create Agent

AI-generated

Summary

Create a new Contextual AI agent by optionally creating or associating datastores, uploading documents from binary input fields, and configuring the agent with predefined or custom ACL YAML. Returns the newly created agent ID, associated datastore IDs, and document upload statuses.

Inputs

  • Agent Name (required) — Name for the new agent.
  • Agent Description — Description of the agent's purpose.
  • Configuration Mode — Choose between using pre-built ACL YAML templates or providing a custom YAML configuration.
  • Pre-Built Template — Select a pre-built agent template (Simple Search or Agentic Search) when using pre-built configuration mode.
  • Custom Template — Paste custom ACL YAML configuration when using custom configuration mode.
  • Datastore Configuration (required) — Choose either to create a new datastore by name or use existing datastore IDs.
  • Datastore Name — Name for creating a new datastore; mutually exclusive with Datastore IDs.
  • Datastore IDs — Comma-separated list of existing datastore UUIDs to associate; mutually exclusive with Datastore Name.
  • Input Binary Field(s) — Comma-separated binary field names on input items to upload documents from. Defaults to 'data'.
  • Document Metadata (JSON String) — Stringified JSON to attach as metadata to each uploaded file.
  • System Prompt — Instructions that the agent references when generating responses.
  • No Retrieval System Prompt — Instructions used when no relevant retrievals are found.
  • Multiturn System Prompt — Instructions for handling multi-turn conversations.
  • Filter Prompt — Prompt used to filter irrelevant chunks.
  • Suggested Queries — Comma-separated list of suggested queries shown in the UI.
  • Agent Configs (JSON String) — Optional advanced agent configuration as a stringified JSON object.

Output shape

a JSON object containing the new agent's ID, the datastore IDs associated with it, the ID of any newly created datastore, and a list describing the result of each document uploaded from binary fields including errors if any.

The response includes: agentId (UUID string), datastoreIds (array of UUIDs), createdDatastoreId (UUID if created), and uploaded (array matching each binary document upload status with item index, property name, document ID, file name, and any errors). Multiple input items and multiple binary fields are processed sequentially for document uploads. Agent creation will fail if required parameters are missing or invalid, or if datastore creation fails.

Examples

Example 1: Create an agent named 'Customer Support Bot' that uses a pre-built 'Agentic Search' template, creates a new datastore named 'Product Documentation', uploads documents from the binary field 'data', and includes a system prompt.

Set 'Agent Name' to 'Customer Support Bot', 'Configuration Mode' to 'Pre-Built', 'Pre-Built Template' to 'Agentic Search', 'Datastore Configuration' to 'Create New Datastore (By Name)', 'Datastore Name' to 'Product Documentation', 'Input Binary Field(s)' to 'data', and add optional prompts as needed.

Links

Discussion