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

# Importing knowledge bases

The `orchestrate knowledge-bases import` command enables you to import the knowledge bases that you create in your active environment. To import a knowledge base, run this command in the ADK CLI and set the path of the file that contains your knowledge base configurations.

```bash BASH theme={null}
orchestrate knowledge-bases import -f <knowledge-base-file-path>
```

## Connecting to external knowledge base providers

In some cases, to connect to external knowledge base providers, such as Milvus or Elasticsearch, you must provide credentials to authenticate to these services.

To do that, you must create a new [connection](../connections/managing_connections) and provide the connection in the command by using the `--app-id` or `-a` flag.

When creating the connection, use `--component knowledge` to indicate that the connection is for a knowledge base, and `--category` to specify the provider type. The supported values for `--category` are:

| `--category` value | Provider      |
| ------------------ | ------------- |
| `milvus`           | Milvus        |
| `elastic_search`   | Elasticsearch |
| `custom_service`   | Custom search |
| `astra_db`         | AstraDB       |
| `open_search`      | OpenSearch    |

The URL (including the port) for your external content source must be set on the connection using the `--server-url` flag of the `connections configure` command.

Use `--safe` to add a confirmation step before updating or importing a Knowledge Base that already exists.

```bash BASH theme={null}
orchestrate connections add -a <my_credentials> --component knowledge --category milvus
orchestrate connections configure -a <my_credentials> --env draft --kind basic --type team --server-url <https://my.server-url.com:port>
orchestrate connections set-credentials -a <my_credentials> --env draft -u <username> -p <password>
orchestrate knowledge-bases import -f <my_knowledge_base_file> -a <my_credentials>
```

<Note>
  When creating or updating a knowledge base, the system validates that it can connect to your content source using the provided credentials and `--server-url`. If the connection cannot be established, you will receive a `Connection credential validation failed:` error. Verify that your `--server-url` and credentials are correct before retrying.
</Note>

If your service requires a different type of authentication, see [Connections](../connections/overview) for more authentication options.
