Create a knowledge store
This guide shows you how to create a knowledge store and optionally customize what the platform extracts during indexing.
Key concepts
- Knowledge store: A persistent store of your videos and images plus the understanding the platform derives from them — spatiotemporal context, a typed ontology, and embeddings — that together enable corpus-level reasoning.
- Ingestion configuration: An optional set of instructions that controls what the platform extracts during indexing. You can provide a natural-language description or a JSON schema.
Prerequisites
-
To use the platform, you need an API key:
-
Depending on the programming language you are using, install the TwelveLabs SDK by entering one of the following commands:
Example
Copy and paste the code below, replacing the placeholders surrounded by <> with your values.
Code explanation
Python
Node.js
To create a knowledge store, call the knowledge_stores.create method.
Parameters:
name: A name for the knowledge store.- (Optional)
ingestion_config: An object that shapes what the platform extracts from your content during indexing. For the available approaches, see the Configure ingestion page. - (Optional)
metadata: An object of up to 16 key-value pairs (string keys and values) to label and organize your stores.
Return value: An object of type KnowledgeStore with a field named id representing the unique identifier of the newly created knowledge store.
Next steps
- Add assets to a knowledge store - add your uploaded assets to the knowledge store for indexing