Generic Site Ingester
sitemap.xml から page を discover し、任意 website の page を knowledge base に sync します
Generic Site Ingester Connector の Functionality
Generic Site Ingester connector は website の page を knowledge base に読み込み、Squid AI agent がその site の content を使用して question に answer できるようにします。
- Squid は sitemaps.org protocol に従って、site の
sitemap.xmlから page を discover します。他の sitemap のみを list 化する sitemap index file はサポートされません。page を直接 list 化する sitemap を connector に指定してください。 - 各 page は fetch され、Markdown に変換されて semantic search 用に index 化されます。
- Squid は site を 1 日に 1 回 sync します。前回の sync 以降 sitemap の
lastmodtimestamp が change していない page は skip され、sitemap に list されなくなった page は knowledge base から remove されます。 - non-English locale に resolve される page(
hreflangalternate または/fr/...のような URL 内の locale segment による)は skip されます。language signal がまったくない page は保持されます。 - connector に接続された AI agent は index 化された content に対して semantic search を実行できるため、user は「password を reset するにはどうすればよいですか?」などの question を尋ね、site を source とする answer を取得できます。
connector は read-only access を提供します。agent は site content を search・reference できますが、変更はできません。
default では、page は client-side JavaScript を実行しない plain HTTP request で fetch されます。site content が client-side で render される場合(single-page app、または initial page load 後に load される content)は、Use Browser Rendering を有効にし、各 page を extraction 前に headless browser で render してください。これは page ごとに低速で resource-intensive になるため、page に content が欠けている場合以外は無効にしてください。ほとんどの server-rendered site と docs/help center では必要ありません。
Squid Application に Generic Site Ingester Connector を追加する
-
Squid Console の Connectors tab に移動します。
-
Available Connectors をクリックします。
-
Generic Site Ingester connector を見つけ、Add Connector を選択します。
-
以下の configuration detail を指定します。
Connector ID: code 内で connector を一意に識別する string。
Type: page の discover 方法。現在サポートされるのは Sitemap のみです。
Sitemap URL: https://example.com/sitemap.xml など、site の sitemap.xml の URL。
Use Browser Rendering: Optional。content の extraction 前に各 page を headless browser で render し、JavaScript-rendered content を capture します。page に content が欠けている場合以外は無効にしてください。
connector の追加後、initial sync が完了するまで時間をおいてください。large sitemap の完全な indexing には時間がかかる場合があります。
Manual Sync の Trigger
connector は 1 日に 1 回、また作成直後または Sitemap URL の変更直後に自動的に sync します。on-demand で sync を trigger するには、webhook を call します。
https://{your-app-id}.{your-region}.squid.cloud/webhooks/syncGenericSiteIngester?integrationId={your-connector-id}
integrationId は常に必要です。以下の optional query parameter を追加できます。
fullResync=true:lastmodtimestamp と以前の failure を無視して、sitemap 内のすべての page を replay します。sync issue の後や、full reindex を強制したい場合に役立ちます。dryRun=true: page content を fetch したり knowledge base を変更したりせず、sync が実行する内容(sync、skip、delete する page)を report します。
既存 connector の Sitemap URL を変更すると sync state が reset されるため、次回 sync では connector の初回 sync と同様に、すべての page が再度 discover・sync されます。
Application で Generic Site Ingester Connector を使用する
No-code Studio
-
Squid Console の Studio tab に移動します。
-
Create AI Agent をクリックします。
-
"docs-agent"と"This agent answers questions using our website's content"のような agent ID と description を指定します。 -
Add Abilities をクリックします。
-
Generic Site Ingester entry を expand し、先ほど作成した connector を選択します。
-
「user が website の content で answer できる可能性がある question を尋ねた場合にこれを call する」など、agent がこの connection を使用する方法の description を指定します。
-
Test をクリックし、site content に関する question を agent に尋ねてみます。
Squid SDK を使用する
Squid SDK を使用して AI agent を作成する場合は、ask() function の connectedIntegrations option に追加して Generic Site Ingester connector を接続します。
- TypeScript
- Python
await this.squid
.ai()
.agent('AGENT_ID')
.ask('How do I reset my password?', {
connectedIntegrations: [
{
integrationId: 'GENERIC_SITE_INGESTER_CONNECTOR_ID',
integrationType: 'generic_site_ingester',
description: 'Call this connector to search our website content',
},
],
});
await squid.ai().agent('AGENT_ID').ask(
'How do I reset my password?',
options={
'connectedIntegrations': [
{
'integrationId': 'GENERIC_SITE_INGESTER_CONNECTOR_ID',
'integrationType': 'generic_site_ingester',
'description': 'Call this connector to search our website content',
}
]
},
)
SDK から agent と interaction する方法の詳細については、AI agent documentationを参照してください。