glean-hello-world

Featured

Index documents into Glean and search them back using the Indexing and Client APIs. Use when starting a new Glean custom connector, testing search quality, or learning the index/search pattern. Trigger: "glean hello world", "glean example", "glean index document", "glean search".

AI & Automation 2,926 stars 433 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Glean Hello World ## Overview Index documents into Glean and search them. Two steps: set up a custom datasource with the Indexing API, then query with the Client API. ## Instructions ### Step 1: Set Up Custom Datasource ```typescript const GLEAN = `https://${process.env.GLEAN_DOMAIN}/api`; const idxHeaders = { 'Authorization': `Bearer ${process.env.GLEAN_INDEXING_TOKEN}`, 'Content-Type': 'application/json', }; // Create or configure a custom datasource await fetch(`${GLEAN}/index/v1/adddatasource`, { method: 'POST', headers: idxHeaders, body: JSON.stringify({ name: 'my_wiki', displayName: 'Internal Wiki', datasourceCategory: 'PUBLISHED_CONTENT', urlRegex: 'https://wiki.company.com/.*', iconUrl: 'https://wiki.company.com/favicon.ico', }), }); ``` ### Step 2: Index Documents ```typescript // Index individual documents await fetch(`${GLEAN}/index/v1/indexdocuments`, { method: 'POST', headers: idxHeaders, body: JSON.stringify({ datasource: 'my_wiki', documents: [{ id: 'doc-001', title: 'Getting Started Guide', url: 'https://wiki.company.com/getting-started', body: { mimeType: 'text/plain', textContent: 'This guide covers onboarding steps...' }, author: { email: 'jane@company.com' }, updatedAt: new Date().toISOString(), permissions: { allowAnonymousAccess: true }, }], }), }); console.log('Document indexed.'); ``` ### Step 3: Search ```typescript const searchHeaders = { 'Authoriz...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category