> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.twelvelabs.io/v1.3/agents/guides/create-a-knowledge-store/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.twelvelabs.io/_mcp/server. # 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. # Prerequisites * To use the platform, you need an API key: If you don't have an account, [sign up](https://playground.twelvelabs.io/) for a free account. Go to the [API Keys](https://playground.twelvelabs.io/dashboard/api-keys) page. If you need to create a new key, select the **Create API Key** button. Enter a name and set the expiration period. The default is 12 months. Select the **Copy** icon next to your key to copy it to your clipboard. * Depending on the programming language you are using, install the TwelveLabs SDK by entering one of the following commands: **`Python`** ```shell Python pip install --upgrade twelvelabs ``` **`Node.js`** ```shell Node.js yarn add twelvelabs-js@latest # or npm install twelvelabs-js@latest ``` # Example Copy and paste the code below, replacing the placeholders surrounded by `<>` with your values. **`Python`** ```python Python maxlines=13 from twelvelabs import TwelveLabs client = TwelveLabs(api_key="") store = client.knowledge_stores.create( name="", # ingestion_config=..., # Optional. Shape what the platform extracts during indexing. # metadata={"team": "marketing", "quarter": "2026-Q1"}, # Optional. Up to 10 key-value pairs. ) print(f"Knowledge store created: {store.id}") ``` **`Node.js`** ```javascript Node.js maxlines=13 import { TwelveLabs } from "twelvelabs-js"; const client = new TwelveLabs({ apiKey: "" }); const store = await client.knowledgeStores.create({ name: "", // ingestionConfig: ..., // Optional. Shape what the platform extracts during indexing. // metadata: { team: "marketing", quarter: "2026-Q1" }, // Optional. Up to 10 key-value pairs. }); console.log(`Knowledge store created: ${store.id}`); ``` # Code explanation #### Python To create a knowledge store, call the [`knowledge_stores.create`](/v1.3/sdk-reference/python/knowledge-stores#create-a-knowledge-store) 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](/v1.3/agents/guides/create-a-knowledge-store/configure-ingestion) page. * *(Optional)* `metadata`: An object of up to 10 key-value pairs to label and organize your stores. Keys are strings; values can be a string, a number, a boolean, or an array of strings.\ **Return value**: An object of type `KnowledgeStore` with a field named `id` representing the unique identifier of the newly created knowledge store. #### Node.js To create a knowledge store, call the [`knowledgeStores.create`](/v1.3/sdk-reference/node-js/knowledge-stores#create-a-knowledge-store) method. You pass all parameters as properties of a single object.\ **Parameters**: * `name`: A name for the knowledge store. * *(Optional)* `ingestionConfig`: An object that shapes what the platform extracts from your content during indexing. For the available approaches, see the [Configure ingestion](/v1.3/agents/guides/create-a-knowledge-store/configure-ingestion) page. * *(Optional)* `metadata`: An object of up to 10 key-value pairs to label and organize your stores. Keys are strings; values can be a string, a number, a boolean, or an array of strings.\ **Return value**: An `HttpResponsePromise` that resolves to 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](/v1.3/agents/guides/add-assets) - add your uploaded assets to the knowledge store for indexing # Jupyter notebook [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/twelvelabs-io/twelvelabs-developer-experience/blob/main/quickstarts/jockey/guides/building_knowledge_stores.ipynb) ## Docs - [Configure ingestion](https://docs.twelvelabs.io/agents/guides/create-a-knowledge-store/configure-ingestion.md)