Knowledge stores

A knowledge store contains your videos plus the understanding the platform derives from them: spatiotemporal context, a typed ontology, and embeddings for semantic retrieval. The KnowledgeStoresClient class provides methods to create and manage knowledge stores.

Methods

Create a knowledge store

Description: This method creates a knowledge store.

Provide a name. Optionally include a description, a metadata map, and an ingestion_config object that controls how content added to the store is processed. The ingestion_config object is immutable after creation.

Function signature and example:

1def create(
2 self,
3 *,
4 name: str,
5 ingestion_config: typing.Optional[IngestionConfig] = OMIT,
6 description: typing.Optional[str] = OMIT,
7 metadata: typing.Optional[typing.Dict[str, str]] = OMIT,
8 request_options: typing.Optional[RequestOptions] = None,
9) -> KnowledgeStore:

Parameters

NameTypeRequiredDescription
namestrYesThe name of the knowledge store.
ingestion_configtyping.
Optional
[IngestionConfig]
NoConfiguration that controls how content added to the knowledge store is processed. Immutable after creation.
descriptiontyping.
Optional[str]
NoAn optional description of the knowledge store.
metadatatyping.
Optional
[typing.Dict
[str, str]]
NoCustom metadata for the knowledge store. Both keys and values must be strings.
request_optionstyping.
Optional
[RequestOptions]
NoPer-call SDK settings such as timeout, retries, and headers. For all fields, see Request options.

The IngestionConfig class contains the following property:

NameTypeRequiredDescription
enrichment_configEnrichmentConfigYesMetadata enrichment configuration. Provide EnrichmentConfig_Description for natural-language instructions that the platform converts into a schema internally, or EnrichmentConfig_JsonSchema for structured extraction conforming to a provided JSON Schema.

Return value

Returns a KnowledgeStore object. The KnowledgeStore class contains the following properties:

NameTypeDescription
idOptional[str]The unique identifier of the knowledge store.
nameOptional[str]The name of the knowledge store.
descriptionOptional[str]An optional description of the knowledge store.
ingestion_configOptional
[IngestionConfig]
The ingestion configuration set when this knowledge store was created. Immutable.
item_countOptional[int]The number of items in the knowledge store.
created_atOptional
[datetime]
The date and time when the knowledge store was created, in the RFC 3339 format.
updated_atOptional
[datetime]
The date and time when the knowledge store was last updated, in the RFC 3339 format.
metadataOptional
[typing.Dict
[str, str]]
Custom metadata for the knowledge store.

API Reference

Create a knowledge store.

Create a knowledge store.

List knowledge stores

Description: This method returns a list of the knowledge stores in your account.

Function signature and example:

1def list(
2 self,
3 *,
4 page: typing.Optional[int] = None,
5 page_limit: typing.Optional[int] = None,
6 sort_by: typing.Optional[KnowledgeStoresListRequestSortBy] = None,
7 sort_option: typing.Optional[str] = None,
8 request_options: typing.Optional[RequestOptions] = None,
9) -> SyncPager[KnowledgeStore]:

Parameters

NameTypeRequiredDescription
pagetyping.
Optional[int]
NoA number that identifies the page to retrieve. Default: 1.
page_limittyping.
Optional[int]
NoThe number of items to return on each page. Default: 10. Max: 50.
sort_bytyping.
Optional
[KnowledgeStoresListRequestSortBy]
NoThe field to sort on. The following options are available:
- created_at: Sorts by the time, in the RFC 3339 format (“YYYY-MM-DDTHH:mm:ssZ”), when the knowledge store was created.
- updated_at: Sorts by the time, in the RFC 3339 format (“YYYY-MM-DDTHH:mm:ssZ”), when the knowledge store was updated. Default: created_at.
sort_optiontyping.
Optional[str]
NoThe sorting direction. The following options are available:
- asc
- desc Default: desc.
request_optionstyping.
Optional
[RequestOptions]
NoPer-call SDK settings such as timeout, retries, and headers. For all fields, see Request options.

Return value

Returns a SyncPager[KnowledgeStore] object that allows you to iterate through the paginated list of knowledge stores. For the properties of each KnowledgeStore object, see Create a knowledge store.

API Reference

List knowledge stores.

Retrieve a knowledge store

Description: This method retrieves the details of a specific knowledge store.

Function signature and example:

1def retrieve(
2 self,
3 knowledge_store_id: str,
4 *,
5 request_options: typing.Optional[RequestOptions] = None,
6) -> KnowledgeStore:

Parameters

NameTypeRequiredDescription
knowledge_store_idstrYesThe unique identifier of the knowledge store.
request_optionstyping.
Optional
[RequestOptions]
NoPer-call SDK settings such as timeout, retries, and headers. For all fields, see Request options.

Return value

Returns a KnowledgeStore object. For its properties, see Create a knowledge store.

API Reference

Retrieve a knowledge store.

Update a knowledge store

Description: This method updates the specified knowledge store. Only the name, description, and metadata fields can be updated.

Function signature and example:

1def update(
2 self,
3 knowledge_store_id: str,
4 *,
5 name: typing.Optional[str] = OMIT,
6 description: typing.Optional[str] = OMIT,
7 metadata: typing.Optional[typing.Dict[str, str]] = OMIT,
8 request_options: typing.Optional[RequestOptions] = None,
9) -> KnowledgeStore:

Parameters

NameTypeRequiredDescription
knowledge_store_idstrYesThe unique identifier of the knowledge store.
nametyping.
Optional[str]
NoThe name of the knowledge store.
descriptiontyping.
Optional[str]
NoAn optional description of the knowledge store.
metadatatyping.
Optional
[typing.Dict
[str, str]]
NoCustom metadata for the knowledge store. Both keys and values must be strings. The provided object replaces the existing metadata in full, so include every key you want to keep. To clear all metadata, set this field to an empty object ({}). A null value is stored as an empty string.
request_optionstyping.
Optional
[RequestOptions]
NoPer-call SDK settings such as timeout, retries, and headers. For all fields, see Request options.

Return value

Returns a KnowledgeStore object. For its properties, see Create a knowledge store.

API Reference

Update a knowledge store.

Delete a knowledge store

Description: This method deletes the specified knowledge store and all its items.

Function signature and example:

1def delete(
2 self,
3 knowledge_store_id: str,
4 *,
5 request_options: typing.Optional[RequestOptions] = None,
6) -> None:

Parameters

NameTypeRequiredDescription
knowledge_store_idstrYesThe unique identifier of the knowledge store.
request_optionstyping.
Optional
[RequestOptions]
NoPer-call SDK settings such as timeout, retries, and headers. For all fields, see Request options.

Return value

This method does not return a value.

API Reference

Delete a knowledge store.