Cloud Storage Sources

Load content from S3, GCS, SharePoint, GitHub, and Azure Blob into a knowledge base.

Register cloud storage providers on a Knowledge instance with content_sources. Each provider has .file() and .folder() methods that create content references you pass to knowledge.insert().

from agno.knowledge.knowledge import Knowledge
from agno.knowledge.remote_content import S3Config

knowledge = Knowledge(
    vector_db=vector_db,
    contents_db=contents_db,
    content_sources=[
        S3Config(
            id="company-docs",
            name="Company Documents",
            bucket_name="my-docs-bucket",
            region="us-east-1",
        ),
    ],
)

# Insert a single file
knowledge.insert(
    name="Q4 Report",
    remote_content=knowledge.content_sources[0].file("reports/q4-2025.pdf"),
)

# Insert an entire folder
knowledge.insert(
    name="Engineering Specs",
    remote_content=knowledge.content_sources[0].folder("specs/"),
)

Supported Providers

ProviderConfig ClassInstall
Amazon S3S3Configpip install boto3
Google Cloud StorageGcsConfigpip install google-cloud-storage
SharePointSharePointConfigpip install msal
GitHubGitHubConfigNone for token auth. pip install PyJWT cryptography for GitHub App auth.
Azure Blob StorageAzureBlobConfigpip install azure-identity azure-storage-blob (azure-identity is only for Service Principal authentication)

All configs are importable from agno.knowledge.remote_content.

Provider Configuration

S3Config

from agno.knowledge.remote_content import S3Config

s3 = S3Config(
    id="s3-docs",
    name="S3 Documents",
    bucket_name="my-bucket",
    region="us-east-1",
    aws_access_key_id="...",       # optional, falls back to default credential chain
    aws_secret_access_key="...",   # optional, falls back to default credential chain
    prefix="documents/",           # optional, default prefix for browsing
)
FieldTypeDefaultDescription
idstrrequiredUnique identifier for this source
namestrrequiredDisplay name
bucket_namestrrequiredS3 bucket name
regionOptional[str]NoneAWS region
aws_access_key_idOptional[str]NoneAWS access key. Falls back to default credential chain.
aws_secret_access_keyOptional[str]NoneAWS secret key. Falls back to default credential chain.
prefixOptional[str]NoneDefault prefix for browsing and listing

GcsConfig

from agno.knowledge.remote_content import GcsConfig

gcs = GcsConfig(
    id="gcs-docs",
    name="GCS Documents",
    bucket_name="my-gcs-bucket",
    project="my-gcp-project",
)
FieldTypeDefaultDescription
idstrrequiredUnique identifier
namestrrequiredDisplay name
bucket_namestrrequiredGCS bucket name
projectOptional[str]NoneGCP project ID
credentials_pathOptional[str]NonePath to GCP credentials file
prefixOptional[str]NoneDefault prefix

GitHubConfig

from agno.knowledge.remote_content import GitHubConfig

github = GitHubConfig(
    id="my-repo",
    name="My Repository",
    repo="owner/repo",
    token="ghp_...",
    branch="main",
)
FieldTypeDefaultDescription
idstrrequiredUnique identifier
namestrrequiredDisplay name
repoOptional[str]NoneRepository in owner/repo format. Can be overridden per .file() or .folder() call.
tokenOptional[str]NoneGitHub personal access token (needs Contents: read)
branchOptional[str]NoneBranch name
pathOptional[str]NoneDefault path filter
app_idOptional[Union[str, int]]NoneGitHub App ID (GitHub App auth)
installation_idOptional[Union[str, int]]NoneGitHub App installation ID (GitHub App auth)
private_keyOptional[str]NoneGitHub App private key (GitHub App auth)

Authenticate with either a personal access token (token) or a GitHub App (app_id, installation_id, private_key). GitHub App auth requires pip install PyJWT cryptography.

SharePointConfig

from agno.knowledge.remote_content import SharePointConfig

sharepoint = SharePointConfig(
    id="sharepoint-docs",
    name="SharePoint Documents",
    tenant_id="...",
    client_id="...",
    client_secret="...",
    hostname="contoso.sharepoint.com",
    site_path="/sites/Engineering",
)
FieldTypeDefaultDescription
idstrrequiredUnique identifier
namestrrequiredDisplay name
tenant_idstrrequiredAzure AD tenant ID
client_idstrrequiredAzure AD application client ID
client_secretstrrequiredAzure AD application client secret
hostnamestrrequiredSharePoint hostname
site_pathOptional[str]NoneSite path (e.g., /sites/Engineering)
site_idOptional[str]NoneFull site ID
folder_pathOptional[str]NoneDefault folder path

AzureBlobConfig

Supports two authentication methods: Service Principal (Azure AD client credentials) and SAS (Shared Access Signature) token. Provide one or the other, not both.

from agno.knowledge.remote_content import AzureBlobConfig

azure = AzureBlobConfig(
    id="azure-docs",
    name="Azure Blob Documents",
    tenant_id="...",
    client_id="...",
    client_secret="...",
    storage_account="mystorageaccount",
    container="documents",
)
FieldTypeDefaultDescription
idstrrequiredUnique identifier
namestrrequiredDisplay name
tenant_idOptional[str]NoneAzure AD tenant ID (Service Principal auth)
client_idOptional[str]NoneAzure AD application client ID (Service Principal auth)
client_secretOptional[str]NoneAzure AD application client secret (Service Principal auth)
sas_tokenOptional[str]NoneSAS token string (SAS token auth)
storage_accountstrrequiredAzure storage account name
containerstrrequiredBlob container name
prefixOptional[str]NoneDefault prefix

Service Principal auth requires the Storage Blob Data Reader (or higher) role on the storage account.

Inserting Content

Each config has .file() and .folder() methods that return content references for knowledge.insert().

# Single file
knowledge.insert(
    name="Architecture Doc",
    remote_content=s3.file("docs/architecture.pdf"),
)

# Entire folder
knowledge.insert(
    name="All Specs",
    remote_content=gcs.folder("specs/"),
)

# GitHub file from a specific branch
knowledge.insert(
    name="README",
    remote_content=github.file("README.md", branch="develop"),
)

# SharePoint file from a specific site
knowledge.insert(
    name="Policy",
    remote_content=sharepoint.file("Shared Documents/policy.pdf", site_path="/sites/HR"),
)

Browsing S3 Files

S3Config supports paginated file listing with list_files(). This is useful for building file pickers or exploring bucket contents before ingesting.

result = s3.list_files(prefix="reports/", limit=50, page=1)

for folder in result.folders:
    print(f"Folder: {folder['name']}")

for file in result.files:
    print(f"File: {file['name']} ({file['size']} bytes)")

print(f"Page {result.page} of {result.total_pages}")
ParameterTypeDefaultDescription
prefixOptional[str]NonePath prefix filter. Overrides the config's prefix.
delimiterstr"/"Folder delimiter
limitint100Files per page (1-1000)
pageint1Page number (1-indexed)

An async variant alist_files() is also available with the same signature. It requires pip install aioboto3.

Multiple Sources

Register multiple providers on a single Knowledge instance.

knowledge = Knowledge(
    vector_db=vector_db,
    contents_db=contents_db,
    content_sources=[s3, gcs, github, sharepoint, azure],
)

# Insert from different sources
knowledge.insert(name="S3 Doc", remote_content=s3.file("doc.pdf"))
knowledge.insert(name="GitHub Doc", remote_content=github.file("README.md"))

Using sources through AgentOS

When the Knowledge instance is attached to AgentOS, every config registered in content_sources is exposed through the HTTP API. Discover them with GET /knowledge/config (under remote_content_sources), upload with POST /knowledge/remote-content using the config's id, and (for S3) browse files with GET /knowledge/{knowledge_id}/sources/{source_id}/files.

See Remote Content for the full API workflow, source_params overrides, and per-source behavior.

Next Steps

TaskGuide
Ingest via the AgentOS APIRemote Content
Content types overviewContent Types
Filter search resultsFiltering
Set up a vector databaseVector Databases