Agent skill

Glean Performance Tuning

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Optimize Glean search relevance and indexing throughput with batch sizing, datasource configuration, and content quality improvements.

MITAuto-check passedBackend & APIs

Install Glean Performance Tuning

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill glean-performance-tuning -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace glean-performance-tuning --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/glean-performance-tuning .claude/skills/glean-performance-tuning && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
glean-performance-tuning
GitHub stars
2.8k
Token cost
~1.5k tokens
SKILL.md length
428 words
Files
1
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Optimize Glean search relevance and indexing throughput with batch sizing, datasource configuration, and content quality improvements.

  • Works in 5 steps: Establish a baseline and target one… → Test bounded batch and concurrency… → Confirm cache invalidation after ACL and… → …
  • Tasks that involve Search implementation
  • SKILL.md covers Overview, Caching Strategy, Batch Operations and Connection Pooling, plus 10 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Glean Performance Tuning is an agent skill from jeremylongshore/tons-of-skills-marketplace. Optimize Glean search relevance and indexing throughput with batch sizing, datasource configuration, and content quality improvements. Trigger: "glean performance", "glean search quality", "glean indexing speed".

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts. Compatibility notes: Designed for Claude Code

It sits in Backend & APIs, covering Search implementation. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Tasks that involve Search implementation

Example prompts

  • “glean performance”
  • “glean search quality”
  • “glean indexing speed”
  • “/glean-performance-tuning”

Requirements

  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Establish a baseline and target one bottleneck at a time: source read, transform, index submission, permission sync, or query.
  2. Test bounded batch and concurrency changes in staging with backpressure, idempotency, and strict retry limits.
  3. Confirm cache invalidation after ACL and document updates so lower latency never serves unauthorized or stale results.
  4. Canary one datasource, monitor latency, freshness, rate limits, and synthetic allow/deny probes, then promote or roll back.
  5. Record the configuration revision and review cost, error budget, and authorization evidence together.

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • developers.glean.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Glean Performance Tuning loads about 1.5k tokens when it runs. Until then it costs about 59 tokens; SKILL.md has 428 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~59
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 428 words, ~1,464 tokens.

Download SKILL.mdSave it as .claude/skills/glean-performance-tuning/SKILL.md (or your agent's skills folder).
name
glean-performance-tuning
description
Optimize Glean search relevance and indexing throughput with batch sizing, datasource configuration, and content quality improvements. Trigger: "glean performance", "glean search quality", "glean indexing speed".
allowed-tools
Read, Write, Edit
compatibility
Designed for Claude Code
version
1.8.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, enterprise-search, glean

Glean Performance Tuning

Overview

Glean's enterprise search API handles search queries across multiple connectors, bulk document indexing, and connector sync throughput. Search latency compounds when querying across dozens of datasources simultaneously. Large indexing jobs (10K+ documents) require careful batching to avoid rate limits and maintain connector sync schedules. Optimizing batch sizes, caching frequent search results, and tuning connector configurations reduces search P95 latency and keeps indexing pipelines within SLA windows.

Caching Strategy

typescript
const cache = new Map<string, { data: any; expiry: number }>();
const TTL = { search: 60_000, suggestions: 30_000, datasources: 600_000 };

async function cached(key: string, ttlKey: keyof typeof TTL, fn: () => Promise<any>) {
  const entry = cache.get(key);
  if (entry && entry.expiry > Date.now()) return entry.data;
  const data = await fn();
  cache.set(key, { data, expiry: Date.now() + TTL[ttlKey] });
  return data;
}
// Search results expire fast (1 min). Datasource metadata is stable (10 min).

Batch Operations

typescript
import PQueue from 'p-queue';
const BATCH_SIZE = 100;

async function indexDocsBatched(glean: any, dsName: string, docs: any[]) {
  const batches = [];
  for (let i = 0; i < docs.length; i += BATCH_SIZE) batches.push(docs.slice(i, i + BATCH_SIZE));
  const queue = new PQueue({ concurrency: 3, interval: 500 });
  await Promise.all(batches.map(batch =>
    queue.add(() => glean.indexDocuments(dsName, batch))
  ));
}

Connection Pooling

typescript
import { Agent } from 'https';
const agent = new Agent({ keepAlive: true, maxSockets: 15, maxFreeSockets: 5, timeout: 30_000 });
// High socket count for parallel indexing across multiple datasources

Rate Limit Management

typescript
async function withGleanRateLimit(fn: () => Promise<any>): Promise<any> {
  try { return await fn(); }
  catch (err: any) {
    if (err.status === 429) {
      const retryMs = parseInt(err.headers?.['retry-after'] || '5') * 1000;
      await new Promise(r => setTimeout(r, retryMs));
      return fn();
    }
    throw err;
  }
}

Monitoring

typescript
const metrics = { searches: 0, indexOps: 0, cacheHits: 0, p95LatencyMs: 0, errors: 0 };
const latencies: number[] = [];
function trackSearch(startMs: number, cached: boolean) {
  const lat = Date.now() - startMs; latencies.push(lat); metrics.searches++;
  if (cached) metrics.cacheHits++;
  latencies.sort((a, b) => a - b);
  metrics.p95LatencyMs = latencies[Math.floor(latencies.length * 0.95)] || 0;
}

Performance Checklist

  • Batch indexing calls at 100 docs per request with 3 concurrent workers
  • Use incremental indexing for real-time updates (< 100 docs)
  • Switch to bulkindexdocuments for daily full refreshes (> 1K docs)
  • Cache repeated search queries with 1-min TTL
  • Set descriptive document titles and full body text for relevance
  • Keep connector sync schedules staggered to avoid burst load
  • Monitor P95 search latency and indexing throughput
  • Enable keep-alive connections with high socket count for parallel ops

Error Handling

IssueCauseFix
Slow cross-datasource searchToo many connectors queried in parallelPrioritize datasources, set query scope
429 on bulk indexingBatch size or concurrency too highReduce to 100/batch, 3 concurrent, 500ms interval
Stale search resultsIndex lag after document updatesUse incremental indexing with webhooks on change
Connector sync timeoutLarge datasource with no checkpointingEnable incremental sync with cursor tracking
Missing documents in resultsIncomplete metadata during indexingInclude title, body, author, and updated_at fields
Show full SKILL.md (194 more words)Show less

Prerequisites

  • A baseline for latency percentiles, error rate, freshness lag, queue depth, and authorized-search coverage by datasource.
  • A staging workload made of synthetic, bounded data and an approved error budget; do not capture real queries or content as a performance trace.
  • A rollback revision for cache TTL, concurrency, batching, and connector schedules before production changes.

Instructions

  1. Establish a baseline and target one bottleneck at a time: source read, transform, index submission, permission sync, or query.
  2. Test bounded batch and concurrency changes in staging with backpressure, idempotency, and strict retry limits.
  3. Confirm cache invalidation after ACL and document updates so lower latency never serves unauthorized or stale results.
  4. Canary one datasource, monitor latency, freshness, rate limits, and synthetic allow/deny probes, then promote or roll back.
  5. Record the configuration revision and review cost, error budget, and authorization evidence together.

Output

Return a tuning receipt with baseline and canary percentile bands, batch/concurrency/TTL revisions, rate-limit and freshness outcomes, authorization probes, owner approval, and rollback reference. Use aggregates only.

Examples

source=sandbox-guides; p95=420ms->310ms; batch=50; concurrency=2; freshness=pass; allow=pass; deny=pass; rollback=perf-r9 documents a safe canary.

Resources

Next Steps

See glean-reference-architecture.

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/.curated/glean-performance-tuning of jeremylongshore/tons-of-skills-marketplace.

Open the folder on GitHubat commit cfae287

Compare with similar skills

Glean Performance Tuning next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Glean Performance Tuning compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Glean Performance Tuning this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.5kAutomated safety check: PassMIT
Product Full-Text Searchlobehub/lobehub83k—~4.1kAutomated safety check: PassCustom licence
Elasticsearch Query Optimizationelastic/agent-skills592—~2.8kAutomated safety check: PassApache-2.0
Infra AuditSethGammon/Citadel924—~2.1kAutomated safety check: NotesMIT
Postgres Migrationspr-pm/prpm1221 repos~3.1kAutomated safety check: PassMIT
Pp Pokeapimvanhorn/printing-press-library2.1k—~7.6kAutomated safety check: NotesApache-2.0

Similar skills

  • Guides work on LobeHub's own product search: the shared search repository, provider choice, Elasticsearch mappings, change syncing and reindexing.

    83k GitHub stars~4.1k tokensUpdated today
    Backend & APIsAuto-check passed
  • Official

    Diagnose slow Elasticsearch Query DSL searches and propose measured fixes.

    592 GitHub stars~2.8k tokensUpdated 3 days ago
    Backend & APIsAuto-check passed
  • Infra Audit

    SethGammon/Citadel

    Reads docker-compose, env files, ORM configs, and connection strings to map current infrastructure.

    924 GitHub stars~2.1k tokensUpdated yesterday
    DatabasesAuto-check: notes
  • Comprehensive guide to PostgreSQL migrations - common errors, generated columns, full-text search, indexes, idempotent migrations, and best practices for database schema changes

    122 GitHub starsUsed in 1 repo~3.1k tokens
    DatabasesAuto-check passed
  • Pp Pokeapi

    mvanhorn/printing-press-library

    PokéAPI as a fully offline Pokédex with SQL, full-text search, type math, and a damage calculator no other Pokémon tool ships as a CLI.

    2.1k GitHub stars~7.6k tokensUpdated yesterday
    Backend & APIsAuto-check: notes
  • Firecrawl Search Integration

    firecrawl/firecrawl

    Guidance for adding Firecrawl's /search endpoint to product code and agent workflows when a feature starts from a query rather than a URL.

    190k GitHub starsUsed in 1 repo~1.1k tokens
    Backend & APIsAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Questions about Glean Performance Tuning

What does Glean Performance Tuning do?

Optimize Glean search relevance and indexing throughput with batch sizing, datasource configuration, and content quality improvements. Glean Performance Tuning is an agent skill from jeremylongshore/tons-of-skills-marketplace. Optimize Glean search relevance and indexing throughput with batch sizing, datasource configuration, and content quality improvements.

When should I use Glean Performance Tuning?

Glean Performance Tuning fits situations like: tasks that involve Search implementation.

How do I install Glean Performance Tuning in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill glean-performance-tuning -a claude-code`. Or copy the skill folder (skills/.curated/glean-performance-tuning in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/glean-performance-tuning in your project. Claude Code loads it when a task matches its description.

How do I install Glean Performance Tuning in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill glean-performance-tuning -a codex`. Or copy the skill folder (skills/.curated/glean-performance-tuning in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/glean-performance-tuning in your project. Codex loads it when a task matches its description.

Can I use Glean Performance Tuning in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill glean-performance-tuning -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/glean-performance-tuning, .gemini/skills/glean-performance-tuning, .github/skills/glean-performance-tuning and .opencode/skills/glean-performance-tuning in your project.

What does Glean Performance Tuning need to run?

SKILL.md names no scripts, command-line tools or credentials: Glean Performance Tuning is instructions for the agent only. Its frontmatter pre-approves these tools: Read, Write, Edit. Compatibility (from SKILL.md): Designed for Claude Code.

Does Glean Performance Tuning access the network?

SKILL.md names 1 domain. As links in the text: developers.glean.com. This is read from the text; nothing was executed.

Is Glean Performance Tuning safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Glean Performance Tuning use?

Glean Performance Tuning is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Glean Performance Tuning use?

About 1.5k tokens (SKILL.md is roughly 5.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Glean Performance Tuning?

Skills that share tags, products or a category with Glean Performance Tuning: Product Full-Text Search (lobehub/lobehub, 83k stars), Elasticsearch Query Optimization (elastic/agent-skills, 592 stars), Infra Audit (SethGammon/Citadel, 924 stars) and Postgres Migrations (pr-pm/prpm, 122 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Glean Performance Tuning?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.