Agent skill · Backend & API

google-gemini-embeddings

Google Gemini embeddings API (gemini-embedding-001) for RAG and semantic search. Use for vector search, Vectorize integration, or encountering dimension mismatches, rate limits, text truncation.

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill google-gemini-embeddings-secondsky-claude-skills --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 19 KB
Bundled scripts: none
Version: 1.0.0
Path: skills/ai-llm/google-gemini-embeddings-secondsky-claude-skills/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

Review
written from the skill's own SKILL.md · Aug 5, 2026

What it does

Generates text embeddings using the gemini-embedding-001 model for use in RAG, semantic search, and vector-based workflows. It covers single and batch embeddings, task-type options, and dimension handling to align with vector indices and storage. It emphasizes embedding content with explicit task types (e.g., RETRIEVAL_QUERY, RETRIEVAL_DOCUMENT) and specified output dimensionality (e.g., 768) to match downstream indices.

How it works

The skill instructs the agent to:

  • Install and use the Google GenAI SDK (e.g., bun add @google/genai@^1.27.0) and, for TS, include typings.
  • Authenticate via GEMINI_API_KEY environment variable and call models.embedContent with model: 'gemini-embedding-001'.
  • Provide content or contents (for batch) and a config object containing taskType and outputDimensionality (e.g., 768).
  • For batch processing, send multiple texts in one request or chunk long datasets to respect rate limits, using a retry strategy for 429s.
  • Use appropriate task types (e.g., RETRIEVAL_QUERY for queries, RETRIEVAL_DOCUMENT for documents) and be mindful of dimension settings to avoid mismatches with indices.
  • Parse the response to obtain embedding.values (and embedding.values.length for dimension checks).
  • Implement basic utilities like chunking, exponential backoff, and caching to optimize usage and reliability.

When to use it

Use when building RAG, semantic search, document clustering, or vector-based indexing where embeddings are needed and you must align dimensions with your vector store. Use specific task types to optimize embedding quality and ensure dimensionality matches your index (e.g., 768). Be mindful of rate limits on the free tier and plan batch processing accordingly.

What it can touch

  • Tool: claude-code (as declared)
  • Code examples show usage with the Google GenAI SDK and REST-like fetch patterns for edge environments.
  • It references environment variables and REST endpoints for gemini-embedding-001:embedContent calls.

Caveats

  • Input limit is 2,048 tokens per text; texts longer must be chunked to avoid silent truncation.
  • Default dimension may be 3072 if not explicitly set; always specify outputDimensionality to match vector indices.
  • Rate limits exist (Free tier RPM 100, etc.); implement exponential backoff for 429 errors.
  • Experimental embeddings model may exist; do not use deprecated variants (e.g., gemini-embedding-exp-03-07).
From the SKILL.md

# Google Gemini Embeddings **Complete production-ready guide for Google Gemini embeddings API** This skill provides comprehensive coverage of the `gemini-embedding-001` model for generating text embeddings, including SDK usage, REST API patterns, batch processing, RAG integration with Cloudflare Vectorize, and advanced use cases like semantic search and document clustering. --- ## Table of Contents 1. [Quick Start](#1-quick-start) 2. [gemini-embedding-001 Model](#2-gemini-embedding-001-model) 3. [Basic Embeddings](#3-basic-embeddings) 4. [Batch Embeddings](#4-batch-embeddings) 5. [Task Types](#5-task-types) 6. [Top 5 Errors](#6-top-5-errors) 7. [Best Practices](#7-best-practices) 8. [When to Load References](#8-when-to-load-references) --- ## 1. Quick Start ### Installation Install the Google Generative AI SDK: ```bash bun add @google/genai@^1.27.0 ``` For TypeScript projects: ```bash bun add -d typescript@^5.0.0 ``` ### Environment Setup Set your Gemini API key as an environment variable: ```bash export GEMINI_API_KEY="your-api-key-here" ``` Get your API key from: https://aistudio.google.com/apikey ### First Embedding Example ```typescript import { GoogleGenAI } from "@google/gena

What's inside
Steps it walks through
  1. Table of Contents
  2. 1. Quick Start
  3. Installation
  4. Environment Setup
  5. First Embedding Example
  6. 2. gemini-embedding-001 Model
  7. Model Specifications
  8. Dimensions
  9. Rate Limits
  10. Context Window
  11. 3. Basic Embeddings
  12. SDK Approach (Node.js)
  13. Fetch Approach (Cloudflare Workers)
  14. Response Parsing
Ships with 1 file
  • metadata.json
Commands it runs
bun add @google/genai@^1.27.0
bun add -d typescript@^5.0.0
export GEMINI_API_KEY="your-api-key-here"
More from claude-skill-registry
All skills →
About this skill
What does the google-gemini-embeddings skill do?

Google Gemini embeddings API (gemini-embedding-001) for RAG and semantic search. Use for vector search, Vectorize integration, or encountering dimension mismatches, rate limits, text truncation.

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill google-gemini-embeddings-secondsky-claude-skills --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going