Data Sources
Admin Panel → Connections → Data Sources (/settings/connectors) connects your external systems read-only into the knowledge base (RAG). Nothing is changed or deleted in the source systems — content is only read and indexed.
This screen is for connectors that feed the knowledge base: the system you connect is read and its content indexed. Nothing is ever written, sent or deleted from here.
General flow
- Open Admin Panel → Connections → Data Sources. A Connected Sources list sits on top, an Add a Connection section below.
- Pick the source type to add (SQL · Google Drive · Dropbox · Notion · Zendesk).
- Each source form has a How do I connect? button at the top — the source-specific steps and field help are available right in the panel too.
- Fill the fields and press Save & connect. Each connected source's row has Content (browse indexed documents), Test (verify), Sync (re-pull), Webhook (copies the webhook URL), Edit and Delete.
- Set how often it re-pulls with Sync interval (min) and full refreshes with Full re-sync.
All passwords, tokens and OAuth secrets are stored encrypted. When a source is deleted, its credentials are removed too.
Ways to connect (OAuth sources)
For the sources that connect with OAuth (Google Drive, Dropbox, Notion) the paths are:
| Path | How | Best for |
|---|---|---|
| Central one click | In the Notion form, press "Connect with Notion"; in the Google Drive and Dropbox forms, leave Client ID and Client secret empty and press "Save & Connect". The provider's consent screen opens, you approve, and you're back. Uses SemAgent's central app (if your operator configured it). You never see credentials. | Fastest, when the operator runs a verified central app. |
| Your own app — one click (BYO, recommended) | For Google Drive and Dropbox, create your own OAuth app, enter just Client ID + Client secret in the panel, and press "Save & Connect". SemAgent runs consent with your app and mints the token for you. Your app can stay in Testing mode — no Google verification / CASA. | Recommended — avoids central verification; each tenant is isolated. |
| Your own app — manual | Mint a refresh_token yourself and paste refresh_token + client_id + client_secret by hand. | When you already have a token or automate provisioning. |
Below we give the detailed steps for each source. For BYO, the one-click flow just needs your Client ID + Client secret in the panel.
Databases (SQL)
Read-only SQL sources: PostgreSQL · MySQL · SQL Server (MSSQL). The result of a SELECT query is indexed row by row.
| Field | Description |
|---|---|
host * | Server address. |
port | PostgreSQL 5432 · MySQL 3306 · MSSQL 1433. |
database * | Database name. |
user | A SELECT-only user is recommended. |
password | Password. |
query * | Must start with SELECT or WITH; write queries are rejected. |
incremental_column | Column for incremental pulls (e.g. updated_at) — fetches only changed rows. |
title_field | Column used as the document title. |
delete_query / delete_incremental_column | To reflect deleted records (optional). |
Step by step: creating a read-only user
So SemAgent can never change anything in your database, create a new user with SELECT-only privileges (ideally on a read replica). By engine:
PostgreSQL:
CREATE USER semagent_ro WITH PASSWORD 'a-strong-password';
GRANT CONNECT ON DATABASE your_database TO semagent_ro;
GRANT USAGE ON SCHEMA public TO semagent_ro;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO semagent_ro;
-- so future tables are readable too:
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO semagent_ro;MySQL / MariaDB:
CREATE USER 'semagent_ro'@'%' IDENTIFIED BY 'a-strong-password';
GRANT SELECT ON your_database.* TO 'semagent_ro'@'%';
FLUSH PRIVILEGES;SQL Server (MSSQL):
CREATE LOGIN semagent_ro WITH PASSWORD = 'a-strong-password';
USE your_database;
CREATE USER semagent_ro FOR LOGIN semagent_ro;
ALTER ROLE db_datareader ADD MEMBER semagent_ro;- Run the statements above to create the user (choose your own password).
- If your server is IP-restricted, ask [email protected] for the addresses to allow, then allow inbound connections from them in your firewall /
pg_hba.conf/ cloud "authorized networks". - Fill in
host,port,database,user,passwordin the panel. - In Query, write a
SELECT(orWITH) that returns the content to index — e.g. your products, FAQ or knowledge table. Write queries are rejected. - For incremental pulls, set an updated-at column (
updated_at) in Incremental column; only changed rows are fetched. - Press Save & connect → Test to verify.
A SELECT-only user guarantees SemAgent can read your data but not change it. On MSSQL, the query must not have a top-level ORDER BY when using incremental pulls.
Cloud storage & documents
Google Drive, Dropbox and Notion. Ways to connect: (1) the platform's central one-click OAuth (if your operator set it up); (2) one-click with your OWN OAuth app (BYO — recommended; Google Drive and Dropbox): you enter just Client ID + Client secret in the panel and press "Save & Connect"; SemAgent runs the consent flow with your app (no need to mint a refresh_token by hand); (3) manual token (you mint and paste it yourself). For BYO you must add the redirect URI below to your app — otherwise you get a redirect_uri_mismatch error. The Client secret you enter is stored encrypted and never shown back.
Redirect URI (Authorized redirect URI) — add EXACTLY this to your provider OAuth app:
- Google:
https://semagent.ai/api/connectors/oauth/google/callback - Dropbox:
https://semagent.ai/api/connectors/oauth/dropbox/callback
The panel also shows this address in the Redirect URI field of the Google Drive and Dropbox forms.
If you'll mint a refresh_token via the OAuth Playground, also add https://developers.google.com/oauthplayground.
Google Drive
One click: in the Google Drive form's "Connect with your own OAuth app (recommended)" box, answer "What should we index?" and press "Save & Connect" → pick your account on Google's consent screen and grant access. If you leave Client ID and Client secret empty, SemAgent's central app is used (if your operator set it up); then you don't need to create your own OAuth app. In "Only the files I pick" mode, after connecting you select the files to index in the Google Picker that "Pick Files" on the card opens. Getting "Access blocked / redirect_uri_mismatch"? See troubleshooting.
With your own OAuth app (BYO) — Google Cloud Console step by step
With your own app there are two modes (chosen in the panel):
- All of Drive (drive.readonly) — recommended: no Picker; scans all of Drive (or a folder) as soon as you connect. The most reliable path with your own app. Your app needs the
drive.readonlyscope enabled. - Only the files I pick (drive.file + Picker): you select individual files — but because
drive.fileonly grants selected files to the app that invoked the Picker, your own app must have the Google Picker API enabled (otherwise picked files come back as "File not found / 0 docs" at sync). If you'd rather skip that setup, use "All of Drive".
Google moved the OAuth screens into the new Google Auth Platform (console.cloud.google.com/auth). The order is:
- Select/create a project: use the project picker at the top, or New Project. Organization — with a personal Gmail account this is usually "No organization", which is fine; leave it. Google Workspace accounts have their org preselected.
- Enable the Drive API: APIs & Services → Library → Google Drive API → Enable.
- Consent screen / Branding: left menu Google Auth Platform → Branding → App name (e.g. SemAgent Data Source), User support email, Developer contact email → Save.
- Audience: Google Auth Platform → Audience →
- User type: choose External to connect personal Gmail or other Workspace accounts. (Choose Internal only for your own Workspace org — no consent screen needed.)
- Publishing status: you can leave it in Testing; if so, ADD the Google account you'll connect to Test users (otherwise you get "Access blocked: app is being tested"). To open it to everyone use Publish app (the sensitive
drive.readonlyscope requires verification; Testing is enough for a test).
- Scopes — Data Access: Google Auth Platform → Data Access → Add or remove scopes → add
https://www.googleapis.com/auth/drive.readonly(read-only) via the list or "Manually add scopes" → Save. (drive.readonly is a restricted/sensitive scope — fine in Testing mode.) - Create an OAuth client: Google Auth Platform → Clients → Create client →
- Application type: Web application.
- Authorized redirect URIs → Add URI:
https://semagent.ai/api/connectors/oauth/google/callback(andhttps://developers.google.com/oauthplaygroundif you'll use the Playground). - Authorized JavaScript origins: leave empty (server-side flow).
- Create → save the returned Client ID and Client secret.
- Connect in the panel (one-click — recommended): Data Sources → Google Drive → the "Connect with your own OAuth app" panel → enter Client ID + Client secret and press "Save & Connect". SemAgent runs the consent flow with YOUR app and mints the
refresh_tokenfor you — no manual token minting. (Your app can stay in Testing mode; remember to add yourself as a Test user.) - Alternative (manual refresh_token): if you prefer, mint one via the OAuth Playground: top-right gear → "Use your own OAuth credentials" → enter Client ID/Secret → left list Drive API v3 →
drive.readonly→ Authorize APIs → Exchange authorization code for tokens → paste therefresh_tokeninto the panel's Refresh token + Client ID + Client secret fields (add the Playground to your redirect URIs). Optional Folder ID (the.../folders/<ID>from a Drive URL) limits to one folder.
Access mode: the panel preselects All of Drive (drive.readonly). The narrowest scope is Only the files I pick (drive.file + Picker): only the files you pick in the Picker are read.
Notion
Two ways: an Integration token (easiest, recommended) or one-click OAuth with the form's "Connect with Notion" button (if your operator set it up). Both go into the same panel field.
With an Integration token — step by step:
- notion.so/profile/integrations (or Settings → Connections → Develop or manage integrations) → New integration → choose Internal and create. (The "Connections → Access token" or "Personal access tokens" on app.notion.com also give a valid API token — any of them works.)
- Copy the Internal Integration Token (starts with
secret_…orntn_…). - Share the page: open the page/database you want indexed in Notion → top-right ••• → Connections → Connect to → [your integration]. ⚠️ Pages you don't share are INVISIBLE to the API — the connection can read "ok" yet return 0 docs.
- Paste the token into Integration token in the panel; to target a single database set the Database ID from the URL → Sync.
Dropbox
Connect one-click with your own Dropbox OAuth app.
- dropbox.com/developers/apps → Create app → Scoped access + Full Dropbox (or "App folder" to scope to one folder).
- Permissions tab: check
files.metadata.read+files.content.read+account_info.readand Submit. - Settings tab → OAuth 2 → Redirect URIs → add the panel's Redirect URI (
https://semagent.ai/api/connectors/oauth/dropbox/callback). Copy the App key and App secret from the same page. - SemAgent → Data Sources → Dropbox → the "Connect with your own OAuth app" panel → put the App key into Client ID and the App secret into Client secret → "Save & Connect".
- Optional: to index a single folder set Folder path to
/Folder(empty = whole Dropbox). Text, PDF and Office (docx/xlsx/pptx) files are converted to text and indexed.
Zendesk
No OAuth app needed — an API token is enough (like Notion). By default Help Center articles are indexed; that's the most valuable source for a support bot.
- In Zendesk open Admin Center → Apps and integrations → APIs → Zendesk API.
- Enable Token access → Add API token → copy the token (shown once).
- SemAgent → Data Sources → Zendesk: Subdomain (the
acmeofacme.zendesk.com), your admin email and the API token → Save & connect. - Optional Content type:
articles(default) ·tickets·both. Usebothto also index support tickets (subject + description).
Troubleshooting
Google: "Access blocked / redirect_uri_mismatch"
redirect_uri_mismatch(Error 400): your OAuth app's Authorized redirect URIs list does not containhttps://semagent.ai/api/connectors/oauth/google/callbackexactly. Add it (no trailing slash, https not http). This error is account-independent — you get it whatever account you pick; fix the URI first.- "Access blocked: app is being tested": your Audience → Publishing status is Testing and the Google account you're connecting isn't in Test users. Add it, or Publish the app.
SemAgent