> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cognigy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# createKnowledgeSource

<Warning>
  As of Cognigy.AI 2026.5.0, the `createKnowledgeSource` function is deprecated. For Knowledge Connectors, use [`upsertKnowledgeSource`](/ai/for-developers/knowledge-connector/upsertKnowledgeSource) to create or update Knowledge Sources that also support knowledge synchronization.
</Warning>

## Syntax

`api.createKnowledgeSource(params)`

## Description

Creates a [Knowledge Source](/ai/agents/develop/knowledge-ai/knowledge-source/overview) in a [Knowledge Store](/ai/agents/develop/knowledge-ai/knowledge-store). A Knowledge Source is a container for [Knowledge Chunks](/ai/agents/develop/knowledge-ai/knowledge-chunk/knowledge-chunk) to organize and manage your AI Agents' knowledge.

**Parameters:**

* `params`: `CreateKnowledgeSourceParams` — configuration object for the Knowledge Source. The object contains the following parameters:

| Parameter     | Type   | Required | Description                                                                 |
| ------------- | ------ | -------- | --------------------------------------------------------------------------- |
| `name`        | String | Yes      | The name of the Knowledge Source. Must be unique for each Knowledge Source. |
| `description` | String | No       | A description of the Knowledge Source.                                      |
| `tags`        | Array  | No       | Tags associated with the Knowledge Source, used to filter searches.         |
| `chunkCount`  | Number | Yes      | The number of Knowledge Chunks in the Knowledge Source.                     |

**Returns:** `Promise<{ knowledgeSourceId: string }>` — a promise that resolves to an object containing the ID of the created Knowledge Source.

## Example

```js theme={null}
const result = await api.createKnowledgeSource({
  name: "Customer Support FAQ",
  description: "Frequently asked questions from the support portal",
  tags: ["support", "faq", "customer-service"],
  chunkCount: 75
});

console.log(result.knowledgeSourceId);
```
