Skip to main content

Common Knowledge

Create Common Knowledge

POST https://api.inworld.ai/studio/v1/workspaces/{workspace_name}/common-knowledge

Initiates the creation of common knowledge that requires subsequent deployment for activation.

Request Body

commonKnowledgerequired

CommonKnowledge

The common knowledge to create.

curl -L -X POST 'https://api.inworld.ai/studio/v1/workspaces/magic_world/common-knowledge' \
-H 'Grpc-Metadata-X-Authorization-Bearer-Type: studio_api' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic WlpONVlON01ETU5HSQ==' \
-d '{
"description": "info about dragon",
"displayName": "Magic Dragon",
"memory_records": [
"dragon lives in the magic forest"
]
}'

Get Common Knowledge

GET https://api.inworld.ai/studio/v1/workspaces/{workspace_id}/common-knowledge/{common_knowledge_id}

Get a specific common knowledge entry within a workspace.

curl -L -X GET 'https://api.inworld.ai/studio/v1/workspaces/{workspace_id}/common-knowledge/70adc1cc-8478-4ce9-860a-c70efded11b6' \
-H 'Grpc-Metadata-X-Authorization-Bearer-Type: studio_api' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic WlpONVlON01ETU5HSQ=='

Deploy Common Knowledge

POST https://api.inworld.ai/studio/v1/workspaces/{workspace_id}/common-knowledge/{common_knowledge_id}:deploy

Asynchronously deploys common knowledge. The deployment process is managed as a long-running operation (LRO). The progress and result of this operation should be monitored using the returned LRO object. Upon successful completion, all characters and scenes that incorporate this common knowledge will reflect the updates during their interactions. In the event of a failure, the operation should be retried.

curl -L -X POST 'https://api.inworld.ai/studio/v1/workspaces/magic_world/common-knowledge/{common_knowledge_id}:deploy' \
-H 'Grpc-Metadata-X-Authorization-Bearer-Type: studio_api' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic WlpONVlON01ETU5HSQ=='

List Common Knowledge

GET https://api.inworld.ai/studio/v1/workspaces/{workspace_id}/common-knowledge/{common_knowledge_id}

Returns a list of common knowledge that can be filtered by several criteria. When using pagination, ensure that all other parameters provided initially remain unchanged.

Filters can be applied to ListCommonKnowledgeRequest. Filters follow the Google AIP-160 guidelines.

  • common_knowledge.name: This filter accepts only the full resource name of common_knowledge. For example, to filter a specific common knowledge item, use common_knowledge.name=workspaces/{workspace_id}/common-knowledge/{uuid}.
  • Multiple Filters: You can also combine multiple filters using the 'OR' condition. For instance, to filter by two different common knowledge items, use common_knowledge.name=workspaces/{workspace}/common-knowledge/{uuid1} OR common_knowledge.name=workspaces/{workspace}/common-knowledge/{uuid2}.

Request Body

pageSizeoptional

int32

Max number of items to retrieve per page. Default is 50.

pageTokenoptional

string

A page token, received from a previous ListCommonKnowledge call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListCommonKnowledgeRequest must stay the same.

filteroptional

string

CommonKnowledge filter. Filters follow the Google AIP-160 guidelines

curl -L -X POST 'https://api.inworld.ai/studio/v1/workspaces/magic_world/common-knowledge' \
-H 'Grpc-Metadata-X-Authorization-Bearer-Type: studio_api' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic WlpONVlON01ETU5HSQ=='

Update Common Knowledge

PATCH https://api.inworld.ai/studio/v1/workspaces/{workspace_id}/common-knowledge{common-knowledge_id}

Updates the specified common knowledge. Changes to common knowledge are not reflected in conversation until common knowledge is deployed.

Request Body

commonKnowledgerequired

CommonKnowledge

The common knowledge to update.

curl -L -X PATCH 'https://api.inworld.ai/studio/v1/workspaces/magic_world/common-knowledge/70adc1cc-8478-4ce9-860a-c70efded11b6' \
-H 'Grpc-Metadata-X-Authorization-Bearer-Type: studio_api' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic WlpONVlON01ETU5HSQ==' \
-d '{
"description": "Information about the dragon",
"memory_records": [
"The dragon is not nice",
"The dragon is very strong"
]
}'

Delete Common Knowledge

DELETE https://api.inworld.ai/studio/v1/workspaces/{workspace_id}/common-knowledge/{common_knowledge_id}

Delete a specific common knowledge entry within a workspace.

curl -L -X DELETE 'https://api.inworld.ai/studio/v1/workspaces/magic_world/common-knowledge/70adc1cc-8478-4ce9-860a-c70efded11b6' \
-H 'Grpc-Metadata-X-Authorization-Bearer-Type: studio_api' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic WlpONVlON01ETU5HSQ=='

Check Deployment Status

GET https://api.inworld.ai/studio/v1/workspaces/{workspace_id}/common-knowledge/{common_knowledge_id}/operations/{operation_id}

Retrieves the current status of a long-running operation. Clients can use it to periodically poll for the operation's result, following the interval recommendations provided by the API service. This approach is useful for tracking the progress and completion status of operations that are not immediately finalized.

curl -L -X GET 'https://api.inworld.ai/studio/v1/workspaces/magic_world/common-knowledge/70adc1cc-8478-4ce9-860a-c70efded11b6/operations/1704230000638-3DlHAa' \
-H 'Grpc-Metadata-X-Authorization-Bearer-Type: studio_api' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic WlpONVlON01ETU5HSQ=='

Schemas

CommonKnowledge

displayNameoptional

string

Display name of the common knowledge.

descriptionoptional

string

Free form description outlining the character's behavior and purpose. See https://docs.inworld.ai/docs/tutorial-basics/common-knowledge/

memoryRecordsoptional

string

A list of memory records in a flexible free form format. Maximum length of individual record is 255 characters. Maximum amount of records per knowledge is 10000.