Indexing SDK
Describe your source. Get a connector.
Install the Connector Builder plugin and tell your coding agent what you want indexed. It explores the source's API, plans the connector with you, generates it against this SDK, and tests it before anything reaches your index.
$ claude plugin marketplace add gleanwork/glean-indexing-sdk ✔ Added marketplace: glean-indexing-sdk $ claude plugin install glean-connector-builder@glean-indexing-sdk ✔ Installed: glean-connector-builder > Build a connector for our internal wiki at wiki.acme.com. It has a REST API with cursor pagination and per-page ACLs. ● Reading the wiki API docs ● Confirmed scope: 12,400 pages, 3 permission groups ● Generating connector.py, data_client.py, tests ● Phase 1 tests: 8 passed, 0 failed ● Ready to index — run it when you are
Install the Connector Builder
Point your agent's plugin host at the SDK repository, which doubles as the marketplace.
claude plugin marketplace add gleanwork/glean-indexing-sdk claude plugin install glean-connector-builder@glean-indexing-sdk
Then describe your source
I want to push my Webex data to Glean. Build a connector for me.
Build a connector for our internal wiki at wiki.acme.com. It has a REST API with cursor pagination, and each page carries a list of groups that can read it.
The agent asks for whatever scope it still needs, confirms a plan with you, generates the connector, and runs the mocked and recorded test phases before offering to index anything. Hosts pull from the repository, so updating is a marketplace refresh rather than a rebuild — claude plugin marketplace update glean-indexing-sdk, then claude plugin update glean-connector-builder@glean-indexing-sdk.
What the agent does
Eight skills coordinate the build. You confirm scope and review the result; the agent does the reading, wiring, and iterating.
Plain language is enough: what system, what content, and who should be able to see it.
Reads the source's documentation to establish endpoints, auth, pagination, and where permissions live.
Scope, connector type, and permission model come back for your approval before any code is written.
Writes the data client and connector against this SDK, including pagination, rate limiting, and ACL mapping.
Runs the mocked phase, then the real-source phase against recorded fixtures — before anything is uploaded to Glean.
Check the review items below, then run a full crawl and confirm documents are searchable.
The eight skills
connector-builderTop-level workflow coordinating the rest.connector-api-explorationReading and confirming the source's API documentation.connector-authAuthentication patterns for source systems.connector-pullData clients, pagination, rate limiting.connector-pushUploading documents and identities.connector-testingThe three-phase testing workflow.connector-observabilityLogging and metrics wiring.connector-deploymentGenerating and applying deployment artifacts.They encode the same guidance as these docs — notably crawl semantics, the rule most easily got wrong: a full crawl must cover the entire confirmed scope before completing, because stale-document deletion removes anything absent from the run. The sources live in skills/ if you want to add one.
Before you trust it, review these
An agent produces a plausible connector quickly. These are the places a plausible connector is most often wrong — and the reason the rest of these docs exist.
Two methods, five stages
Whether an agent writes it or you do, a connector is the same pipeline. This is the shape of what gets generated.
get_source_data()Fetch raw recordstransform()Map to Glean documentsPushUploaderBatch, retry, uploadWhat's in the box
The agent wires these up as your source needs them. Each page is also the reference for doing it yourself.
Pick a base class
The four connector types differ in how data flows through them, not in what they produce. Start with the first if you're unsure.
The whole dataset fits comfortably in memory. Wikis, service catalogs, config databases.
BaseDataClientDocumentDefinitionThe dataset is large or paginated and your source client is synchronous.
BaseStreamingDataClientDocumentDefinitionSame as streaming, but your source client is async — httpx.AsyncClient, aiohttp.
BaseAsyncStreamingDataClientDocumentDefinitionYou're indexing employee and identity records rather than documents.
BaseDataClientEmployeeInfoDefinitionThree test phases, one added dependency at a time
Each phase swaps exactly one thing from mocked to real, so a failure tells you which layer broke.
run_connector with a static data client. No network at all.
Records real source responses to NDJSON, then replays them offline.
No mocking. Uploads to whatever GLEAN_SERVER_URL points at.
SDK or the Indexing API directly?
Both push into the same index. The difference is how much you build yourself.
Use the SDK for a connector that runs on a schedule against a source system — most custom connectors. Use the API directly when indexing from a non-Python service, pushing occasional one-off documents, or attaching custom metadata to documents already in Glean. The SDK is a client for the Indexing API, not a replacement — the API documentation stays the reference for the wire protocol.