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
The common knowledge to create.
- Curl
- Response
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"
]
}'
{
"name": "workspaces/magic_world/common-knowledge/70adc1cc-8478-4ce9-860a-c70efded11b6",
"displayName": "Magic Dragon",
"description": "info about dragon",
"memoryRecords": [
"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
- Response
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=='
{
"name": "workspaces/magic_world/common-knowledge/70adc1cc-8478-4ce9-860a-c70efded11b6",
"displayName": "Magic Dragon",
"description": "info about dragon",
"memoryRecords": [
"dragon lives in the magic forest"
]
}
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
- Response
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=='
{
"name": "workspaces/{workspace_id}/common-knowledge/{common_knowledge_id}/operations/{operation_id}",
"metadata": {
"@type": "type.googleapis.com/ai.inworld.studio.v1alpha.DeploySceneAsyncMetadata"
},
"done": false
}
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
int32
Max number of items to retrieve per page. Default is 50.
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.
string
CommonKnowledge filter. Filters follow the Google AIP-160 guidelines
- Curl
- Response
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=='
{
"commonKnowledge": [
{
"name": "workspaces/magic_world/common-knowledge/70adc1cc-8478-4ce9-860a-c70efded11b6",
"displayName": "Magic Dragon",
"description": "info about dragon",
"memoryRecords": [
"dragon lives in the magic forest"
]
}
],
"nextPageToken": "1-50"
}
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
The common knowledge to update.
- Curl
- Response
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"
]
}'
{
"name": "workspaces/magic_world/common-knowledge/70adc1cc-8478-4ce9-860a-c70efded11b6",
"displayName": "Magic Dragon",
"description": "Information about the dragon",
"memoryRecords": [
"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
- Response
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
- Response
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=='
{
"name": "workspaces/magic_world/common-knowledge/70adc1cc-8478-4ce9-860a-c70efded11b6/operations/1704230000638-3DlHAa",
"metadata": {
"@type": "type.googleapis.com/ai.inworld.studio.v1.DeployCommonKnowledgeMetadata"
},
"done": true,
"response": {
"@type": "type.googleapis.com/ai.inworld.studio.v1.DeployCommonKnowledgeResponse"
}
}
Schemas
CommonKnowledge
string
Display name of the common knowledge.
string
Free form description outlining the character's behavior and purpose. See https://docs.inworld.ai/docs/tutorial-basics/common-knowledge/
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.