Cortex
Cortexes are AI agents that can be easily customized to accomplish specific tasks. Cortexes can be customized with custom instructions about the task it should accomplish, and catalogs of documents that it has access to when generating content and answers.
Create or update a cortex
Cortexes are created and updated through the same configureCortex
method available on the client:
Cortex configuration reference
CortexConfig
The CortexConfig
type defines the configuration options for a Cortex instance.
Field | Type | Description |
---|---|---|
friendlyName | string | The name that this Cortex should refer to itself as (e.g., "Acme Assistant", "Acme AI"). |
catalogs | string[] | (Optional) The catalogs that should be referenced when generating content and answering questions. |
instructions | string[] | A complete description of the goal task and a list of steps this cortex should follow when generating content and answering questions. |
public | boolean | Whether or not this Cortex should be available on the internet without authentication. Common for scenarios like publishing blog content and customer support. |
customizations | object | (Optional) Fine-tuned control over the verbosity, tone, and rules used to generate content. |
chatConfig | object | (Optional) Configuration for the embedded hosted chat UI. |
overrides | object | (Optional) Override org-level defaults. |
CortexConfig.customizations
Field | Type | Description |
---|---|---|
rules | string[] | (Optional) A list of "dos and don'ts" that the cortex should follow. |
personality | string[] | (Optional) Personality traits or characteristics for the cortex. |
CortexConfig.chatConfig
Field | Type | Description |
---|---|---|
greeting | string | The initial greeting message rendered in chat. |
intro | string | An introductory message that explains the purpose of this Cortex and what it can help with. |
examples | string[] | A list of questions that will be rendered and suggested to users when they load the chat window. |
CortexConfig.overrides
Field | Type | Description |
---|---|---|
inheritRules | boolean | (Optional) Whether or not global org-level rules should be followed. Defaults to 'true'. |
companyName | string | (Optional) The company name. |
companyInfo | string | (Optional) A description of your company, industry, and products and services provided. |
Get a cortex
Chat
The Cortex
class exposes convenient methods for starting a streaming or synchornous chat:
Streaming chat
To stream chat responses, set the stream
parameter to true
:
Synchronous chat
Generate content
The Cortex
class exposes methods for generating content via streaming and synchronous methods:
Streaming content generation
To stream content as it is generated, set the stream
parameter to true
: