技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
glean-core-workflow-a【数据与研究】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".
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
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:
Build search and chat experiences using the Glean Client API. Covers full-text search with filters, AI-powered chat answers, and autocomplete suggestions.
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 ?? ''}`);
});
const chatResponse = await fetch(`${GLEAN}/client/v1/chat`, {
method: 'POST', headers: searchHeaders,
body: JSON.stringify({
messages: [{ role: 'USER', content: 'What is our deployment process for production?' }],
applicationId: 'my-app',
}),
}).then(r => r.json());
console.log('Answer:', chatResponse.messages?.[0]?.content);
console.log('Sources:', chatResponse.citations?.map((c: any) => c.title).join(', '));
const suggestions = await fetch(`${GLEAN}/client/v1/autocomplete`, {
method: 'POST', headers: searchHeaders,
body: JSON.stringify({ query: 'deploy', datasourceFilter: 'confluence' }),
}).then(r => r.json());
suggestions.results?.forEach((s: any) => console.log(` ${s.text}`));
| Error | Cause | Solution |
|---|---|---|
| Empty results | Query too specific or datasource not indexed | Broaden query, check datasource status |
| Chat returns no citations | Content not indexed for chat | Verify documents have body text |
| 403 on search | User permissions | Ensure token has search scope |
Return a redacted workflow receipt containing datasource scope, correlation ID, result-count band, allow/deny outcomes, and fallback used. Never record query text, titles, snippets, transcripts, or credentials.
Run a fictional query against sandbox-handbook, verify one authorized identity sees the sample while a denied identity sees none, and record scope=sandbox-handbook; allow=1; deny=0; fallback=none.
For bulk indexing workflow, see glean-core-workflow-b.