Azure AI Search
Give agents a read-only semantic layer over an Azure AI Search index you own
Overview
The Azure AI Search connector binds one index of an Azure AI Search service you own to a read-only Squid knowledge base. Nothing is ingested or copied: every search runs live against your index, and Squid keeps only a small semantic layer (an index card, facet concepts, and optionally an entity graph) so agents understand what the index holds.
Saving the connector creates the knowledge base; deleting the connector deletes it. The knowledge base cannot be written to (upsertContext and deleteContexts fail with KNOWLEDGE_BASE_READ_ONLY), and it cannot be deleted while the connector exists.
Use this connector when you already run retrieval on Azure AI Search and want Squid agents to answer over it without re-indexing the content into Squid.
Adding the connector
-
Navigate to the Connectors tab in the Squid Console, click Available Connectors, and select Azure AI Search.
-
Provide the configuration:
Connector ID: A string that uniquely identifies the connector.
Service Endpoint: The service URL alone, for example
https://my-service.search.windows.net. No path, query, or credentials.API Version: The pinned data-plane API version,
2026-04-01by default. An index with native ACLs needs a preview version such as2025-05-01-preview, which has no SLA.Authentication: Service principal (Entra app) with Tenant ID, Client ID, and Client Secret, or a Query Key. Grant the identity the Reader and Search Index Data Reader roles; never use an admin key or a write role. A query key cannot read the index definition, so with one you must set Field Roles yourself.
Max Requests Per Second: Caps the load Squid puts on your replicas, per Squid server (default 10, up to 200). Background sync uses at most half of it.
Index Name: The index to search. Fixed once saved.
Knowledge Base ID: The ID of the knowledge base Squid creates and keeps bound to the index. It must not already exist, and cannot change.
Field Roles (optional): Overrides the roles Squid proposes by reading the index definition, as JSON, for example
{ "key": "id", "title": "title", "content": ["chunk"], "metadata": ["category"] }. Required with query key auth.Security Filter (optional): Filters every search on a security field. Security Field names a filterable string (or string collection) field, Public Values marks records visible to everyone, and Scope Resolver names the backend function that resolves a caller's values, as
ServiceName:functionName. Leave the section off for an index with no document-level security or with native ACLs.
On save, Squid probes the index, proposes field roles from its definition (key, title, content, URL, timestamp, metadata, and vector fields), and reports prerequisites. A save fails with KB_SOURCE_BINDING_FAILED when the index cannot be read or no key or content field can be found.
Using the knowledge base
Agents attach the bound knowledge base like any other, with connectedKnowledgeBases:
await this.squid
.ai()
.agent('hr-copilot')
.setAgentOptionInPath('connectedKnowledgeBases', [
{
knowledgeBaseId: 'hr-handbook', // the Knowledge Base ID from the connector
description: 'The HR handbook, searchable by policy topic.',
},
]);
You can also search it directly. A search without the app API key is allowed only when the knowledge base enforces access control, which this connector sets up only in the Security Filter mode, so search from backend code:
const chunks = await this.squid
.ai()
.knowledgeBase('hr-handbook')
.search({ prompt: 'parental leave policy', searchMode: 'hybrid' });
Searches run in keyword, vector, and hybrid modes. Vector mode requires a vector field with a vectorizer on the index, so the index can embed the query text itself; without one, vector searches fail with VECTOR_SEARCH_NOT_AVAILABLE. Hybrid mode uses the index's semantic configuration when it has one. Metadata filters compile to OData filters on the index's filterable fields.
To check the binding's health, read its status from backend code: squid.ai().knowledgeBase('hr-handbook').getExternalSourceStatus() returns the prerequisites Squid assessed, the index card, and sync state. refreshExternalSource() re-reads the index definition after you change it.
Document security
The connector supports three security modes:
- None: every caller searches the whole index. Only this mode supports building a knowledge graph over the index.
- Security filter: every search is filtered on your Security Field. A record is visible when the field holds one of the caller's values (resolved by your Scope Resolver function) or one of the Public Values.
- Native ACLs: the index itself enforces per-document permissions, and searches run as the signed-in user.
Native ACLs
When the index definition declares permission filter fields (an Azure AI Search preview feature), Squid detects it and runs every caller-facing read with the caller's own Entra access token, sent to Azure as the query source authorization. Each user retrieves only documents they can read at the source.
Requirements:
- A preview API Version on the connector, so the permission fields are visible in the index definition.
- Callers sign in with a Microsoft Entra ID auth integration. To derive the search token from the sign-in automatically, add the Entra auth integration's Client Secret (for token exchange); otherwise each request must send a token for the connector in
integrationAccessTokens. On an agent request the tokens ride in the ask options; on a direct knowledge base search they go in the second argument:search(options, { integrationAccessTokens }). See Connector access modes for the full flow.
A search without a usable user token fails with USER_TOKEN_REQUIRED before anything runs. Squid's own background reads run as the connector's identity, so under native ACLs the facet catalog stays empty and the index card holds no sample records.
Limits and behavior
- The entity graph and incremental sync require the index to hold at most 100,000 records (Azure's pagination cap) and, for the graph, no document security.
- A filterable, sortable timestamp field (named like
last_modifiedorupdated_at) enables incremental sync of the semantic layer; without one, Squid re-scans. - Requests are paced to Max Requests Per Second; 429 and 503 answers are retried honoring
Retry-After. A caller request that would wait more than 10 seconds fails withAZURE_AI_SEARCH_RATE_LIMITED. - On Squid's SaaS, the service must be reachable at its public endpoint on port 443; Private Link endpoints are not reachable.
Error handling
| Error | Meaning and fix |
|---|---|
KB_SOURCE_BINDING_FAILED | The save-time probe failed: a missing index, a wrong key or secret, or an unmet prerequisite. The message carries the cause. |
KNOWLEDGE_BASE_ID_TAKEN | The Knowledge Base ID already exists. Choose another. |
AZURE_AI_SEARCH_TOKEN_FAILED | Entra rejected the service principal: check the tenant ID, client ID, and client secret. |
AZURE_AI_SEARCH_REQUEST_FAILED | Azure answered an error; the message carries the status and body. |
AZURE_AI_SEARCH_RATE_LIMITED | The request queue exceeded 10 seconds at the configured rate cap. Raise Max Requests Per Second or add replicas. |
VECTOR_SEARCH_NOT_AVAILABLE | The index has no vector field with a vectorizer. Use keyword or hybrid search, or add a vectorizer to the index. |
UNSUPPORTED_FILTER_FIELD | A metadata filter named a field that is not one of the knowledge base's metadata fields. |
USER_TOKEN_REQUIRED | The index enforces native ACLs and the request carried no usable user token. See Native ACLs. |
KNOWLEDGE_BASE_READ_ONLY | Something tried to write to the bound knowledge base. The index is the source of truth; write to Azure instead. |