Skip to main content
Combine multiple remote content sources in a single Knowledge instance. Sources dispatch by config_id and write into a shared vector DB.
multi_source.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export your OpenAI API key

4

Run PgVector

5

Install optional cloud clients

Install only the clients for the optional remote sources you enable:
6

Configure optional cloud sources

Set only the variables for the remote sources you enable. GitHub uses GITHUB_TOKEN and optionally GITHUB_DEFAULT_REPO. S3 uses S3_BUCKET_NAME and AWS_REGION. Google Cloud Storage uses GCS_BUCKET_NAME and GCP_PROJECT. SharePoint uses SHAREPOINT_TENANT_ID, SHAREPOINT_CLIENT_ID, SHAREPOINT_CLIENT_SECRET, SHAREPOINT_HOSTNAME, and optionally SHAREPOINT_SITE_ID. Azure Blob Storage uses AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_STORAGE_ACCOUNT, and AZURE_CONTAINER.
7

Run the example

Save the code above as multi_source.py, then run:
Full source: cookbook/07_knowledge/05_integrations/cloud/06_multi_source.py