Skip to main content
Important:This feature is currently in public preview. Functionality and behavior may change in future updates.
Use a connector-backed knowledge base to ingest documents from a third-party content source such as Box, SharePoint, or OneDrive. You create a connection for the source credentials, identify source paths in the knowledge base specification, and import the specification with the ADK CLI. watsonx Orchestrate supports only key_value connections. Use --kind key_value or --kind kv for each source. Other OAuth connection kinds are not validated end-to-end for knowledge base content sources. A connector-backed knowledge base does not upload document files through the ADK. The knowledge base specification identifies the external system in content_source and identifies the source paths in documents. During a sync, watsonx Orchestrate retrieves the files, converts and chunks their content, and indexes the chunks in the built-in vector store. To customize the embedding model and the chunking parameters, use the vector_index field in the specification. The source documents must meet these requirements:
  • Give each file a unique name.
  • Include no more than 100 files in one knowledge base specification.
  • Limit each .xlsx file to 1 MB.
  • Limit each .docx, .pdf, and .pptx file to 25 MB.
  • Limit each .csv, .html, and .txt file to 5 MB.

Before you begin

  • Register an application or service account with your content provider.
  • Collect the required credentials from the provider.
  • If you use Developer Edition, start the server with connector support:
BASH

Required credentials

Each third-party source requires a different set of credentials from its own developer console or app registration. Pass each credential as a separate --entries "<key>=<value>" option on orchestrate connections set-credentials.

Connecting to a third-party content source

1

Create a connection

Create a connection with an application ID that identifies the external source:
BASH
Configure a team connection in the draft environment:
BASH
Set the credentials. Use the fields for your source from the required credentials table:
BASH
To use the knowledge base in the live environment, configure the connection and set its credentials again with --env live.
Note:Keep private keys and passwords out of source control. The connection stores these values separately from the knowledge base specification.
2

Define the knowledge base

Create a YAML file with content_source and documents:
YAML
string
required
The connector to use. Accepted values are box, sharepoint-file, and onedrive.
array
required
List of file and folder paths in the source system. Add a trailing / to a path to identify a folder — the sync ingests files directly in that folder but not files in its subfolders.
object
Optional. To customize the embedding model, set the embeddings_model_name field in the vector_index object. To customize how watsonx Orchestrate splits your documents into chunks, set the chunk_size and chunk_overlap fields.
Example
Do not set content_source.connection_id in the specification. The import command resolves the connection ID automatically from the connection that matches --app-id.
3

Import and perform the initial sync

Import the specification and provide the application ID from the connection:
BASH
On the first import, watsonx Orchestrate starts a sync and the CLI waits for it to finish.When you import an existing knowledge base, the command updates the specification without starting a sync. Add --sync to update the specification and sync its content:
BASH
If the sync fails, the knowledge base remains available. Correct the credentials or connector configuration, and then start another sync.
4

Check status and sync content

Check the detailed status:
BASH
The response includes sync_state, sync_state_msg, and last_sync_stats for a connector-backed knowledge base.A detailed response can contain these fields:
JSON
After a sync, use the verbose status output to confirm which files were indexed. If a path does not exist in the source, the import still succeeds but watsonx Orchestrate does not index those files. Correct the paths in the specification and re-import with --sync.Start an on-demand sync after you change files in the source or update the document paths:
BASH
The command waits for the sync to finish. A knowledge base supports one active sync at a time. During a sync, the knowledge base continues to answer questions with the previous index. A successful sync promotes the new index. A failed sync keeps the previous index available.

Enforce document permissions at retrieval

By default, every user of an agent can retrieve content from every document in the knowledge base. For a connector-backed knowledge base, you can instead restrict retrieval to the documents that each user is authorized to see in the source system. When you turn on access control list (ACL) based retrieval, watsonx Orchestrate captures the document-level access controls when it ingests files from the source. At query time, it returns content only from the documents that the requesting user can access. To turn on ACL-based retrieval, set acl_retrieval.enabled to true in the conversational_search_tool section of the knowledge base specification:
YAML
boolean
Whether to filter retrieval results by the access controls of the source documents. The default is false, which returns content from all documents in the knowledge base to every user of the agent.
If you use the Python SDK, set the field on ConversationalSearchConfig:
Python
After you change the setting, import the specification again.

Remove the knowledge base and connection

Remove the knowledge base:
BASH
This command removes the indexed content from watsonx Orchestrate. It does not remove files from the external source. Remove the connection when you no longer need it:
BASH

Examples

Box uses a JWT service account. Get the credential values from your Box Developer Console application and its generated key pair.
BASH
Create the knowledge base specification:
YAML
Import the specification:
BASH

Troubleshooting