README.md files or a docs folder. SiteGPT connects with a GitHub personal access token that you create. There is no “Sign in with GitHub” step.
Before you start
- An active plan. Each plan has a page limit. See Plans and limits.
- The Super Admin, Admin, or Manager role on the chatbot. Agents cannot add content.
- Permission in GitHub to create a fine-grained personal access token for the repository owner.
- A workspace without HIPAA mode. HIPAA workspaces cannot use cloud connectors. See HIPAA.
Create a token in GitHub
1
Open token settings
In GitHub, go to Settings > Developer settings > Personal access tokens > Fine-grained tokens, and generate a new token.
2
Name the token
Enter a Token name.
3
Choose the owner
In Resource owner, select the user or organization that owns the repository.
4
Set the expiration
Choose an Expiration. The SiteGPT form recommends No expiration. If the token expires, SiteGPT can no longer read the repository. Auto-sync and resync then fail until you add a new token with Update Access Token.
5
Choose repositories
Under Repository access, select Only select repositories and choose the repositories.
6
Set the permission
Under Permissions, add Contents with Read-only access.
7
Copy the token
Generate the token and copy it.
Connect the repository
1
Open the GitHub connector
In the chatbot sidebar, go to Files & Data Sources > GitHub.
2
Start a connection
Select Connect Account. The New GitHub Connection form opens.
3
Name the connection
In Connection Label, enter a name you will recognize, for example
Product docs.4
Enter the owner
In Repository Owner, enter the same owner you chose for the token, for example
my-org.5
Paste the token
Paste the token into Personal Access Token.
6
Save the connection
Select Create Connection.
Choose the files
After you create the connection, the Add GitHub Files form opens. To open it later, go to Files & Data Sources > GitHub, select the settings icon, and select Add files or Add more files. Repository Owner is already filled in from the connection.1
Enter the repository
In Repository Name, enter the repository name, for example
example-repo.2
Enter the branch
In Branch Name, enter the branch, for example
main. Branch names that contain a slash, such as feature/docs, do not work.3
Enter file patterns
In File patterns to add, enter one pattern per line. See File patterns.
4
Choose a schedule (optional)
In Auto Sync Frequency, choose how often SiteGPT reads the repository again. This field shows only if your plan includes auto-sync.
5
Add the files
Select Add Files. The message “Added GitHub files to the queue” appears.
File patterns
Patterns use glob syntax and match file paths from the repository root.- Enter at least 1 and up to 10 patterns.
- Patterns are case-sensitive.
- A set of patterns can match up to 5,000 files. If it matches more, use more specific patterns.
- If no files match, SiteGPT shows “No files matched the provided patterns”.
- SiteGPT always leaves out
.envfiles,node_modules,.git, and lock files such aspackage-lock.json.
Check that it works
- Go to Files & Data Sources > Files List.
- Wait for the files to show Success.
- Ask the chatbot a question that one of the files answers.
Keep the repository up to date
If you chose an Auto Sync Frequency, SiteGPT reads the repository again on that schedule. It adds new files that match your patterns and refreshes existing files. It does not remove files that you deleted from the repository. Delete those in Files List. To refresh now, select the files in Files List and select Resync N Selected. For schedules and plans, see Keep content up to date.Change or remove the connection
Open Files & Data Sources > GitHub and select the settings icon. Then:- To use a new token, select Update Access Token.
- To disconnect, select Revoke Access. The content that is already trained stays. To remove it, delete the files in Files List.