| name | glean-core-workflow-a |
| description | Execute Glean primary workflow: search, chat, and AI-powered answers across enterprise data.
Use when building search integrations, implementing Glean chat, or creating AI assistants.
Trigger: "glean search API", "glean chat", "glean AI answers", "enterprise search".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Bash(curl:*), Grep |
| version | 1.8.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","enterprise-search","glean"] |
| compatibility | Designed for Claude Code |
Glean Core Workflow A: Search & Chat
Overview
Build search and chat experiences using the Glean Client API. Covers full-text search with filters, AI-powered chat answers, and autocomplete suggestions.
Instructions
Step 1: Search with Filters and Facets
const results = await fetch(`${GLEAN}/client/v1/search`, {
method: 'POST', headers: searchHeaders,
body: JSON.stringify({
query: 'kubernetes deployment best practices',
pageSize: 20,
requestOptions: {
datasourceFilter: 'confluence,github',
facetFilters: [{ fieldName: 'author', values: ['engineering-team'] }],
},
}),
}).then(r => r.json());
results.results?.forEach((r: any) => {
console.log(`[${r.datasource}] ${r.title}`);
console.log(` ${r.snippets?.[0]?.snippet ?? ''}`);
});
Step 2: AI Chat (Glean Assistant)
const chatResponse = (, {
: , : searchHeaders,
: .({
: [{ : , : }],
: ,
}),
}).( r.());
.(, chatResponse.?.[]?.);
.(, chatResponse.?.( c.).());