google-gemini-embeddings
Build RAG systems and semantic search with Gemini embeddings (gemini-embedding-001). 768-3072 dimension vectors, 8 task types, Cloudflare Vectorize integration. Prevents 13 documented errors. Use when: vector search, RAG systems, semantic search, document clustering. Troubleshoot: dimension mismatch, normalization required, batch ordering bug, memory limits, wrong task type, rate limits (100 RPM).
npx skills add majiayu000/claude-skill-registry --skill google-gemini-embeddings-brendadeeznuts1111-tier-1380-omega --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Launches and uses the gemini-embedding-001 model to generate text embeddings for various tasks (retrieval, similarity, clustering, etc.), supports single and batch embeddings, and provides RAG patterns with Cloudflare Vectorize integration. It emphasizes using a specific taskType per use case and covers normalization requirements for non-3072 dimensions.
How it works
- Instantiates Google GenAI with an API key and calls the embedding endpoint via SDK or REST for gemini-embedding-001.
- Supports single and batch embeddings, with taskType specified in config (e.g., RETRIEVAL_QUERY, RETRIEVAL_DOCUMENT, SEMANTIC_SIMILARITY, CLUSTERING).
- For non-3072 dimensions, embeddings MUST be normalized before similarity computations; 3072-dim embeddings are pre-normalized.
- Demonstrates batch handling via batchEmbedContents endpoint and prepares results as arrays of embedding values.
- Shows RAG workflow: embed query (RETRIEVAL_QUERY), search a vector store (e.g., Cloudflare Vectorize), assemble context, then generate an answer.
- Includes rate limits, known batch issues, and workarounds (e.g., smaller batch sizes, backoff strategies).
When to use it
- Use for vector search, RAG systems, semantic search, and document clustering, with specific task types to optimize embeddings.
What it can touch
- Interacts with the gemini-embedding-001 endpoint via SDK or REST calls.
- Integrates with Cloudflare Vectorize for storing and querying embeddings.
- May process batch requests and handle responses containing embedding values arrays.
Caveats
- Dimension options include 768, 1536, 3072, or 128–3071; normalization is required for dimensions other than 3072.
- Batch API has known issues: ordering bug with large batches, memory limits for very large batches, and rate-limit anomalies; recommended workarounds are documented (smaller batches, backoff, and retries).
- Default and recommended dimensions: default 3072; recommended 768/1536/3072 for performance considerations.
- Rate limits vary by tier (RPM, TPM, RPD) and require appropriate billing setup for higher tiers.
# 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. [RAG Patterns](#6-rag-patterns) 7. [Error Handling](#7-error-handling) 8. [Best Practices](#8-best-practices) --- ## 1. Quick Start ### Installation Install the Google Generative AI SDK: ```bash npm install @google/genai@^1.37.0 ``` For TypeScript projects: ```bash npm install -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/genai"; const
- Table of Contents
- 1. Quick Start
- Installation
- Environment Setup
- First Embedding Example
- 2. gemini-embedding-001 Model
- Model Specifications
- Dimensions
- Context Window
- Rate Limits
- Output Format
- 3. Basic Embeddings
- SDK Approach (Node.js)
- Fetch Approach (Cloudflare Workers)
npm install @google/genai@^1.37.0 npm install -D typescript@^5.0.0 export GEMINI_API_KEY="your-api-key-here" npx wrangler vectorize create gemini-embeddings --dimensions 768 --metric cosine
What does the google-gemini-embeddings skill do?
Build RAG systems and semantic search with Gemini embeddings (gemini-embedding-001). 768-3072 dimension vectors, 8 task types, Cloudflare Vectorize integration. Prevents 13 documented errors. Use when: vector search, RAG systems, semantic search, document clustering. Troubleshoot: dimension mismatch, normalization required, batch ordering bug, memory limits, wrong task type, rate limits (100 RPM).
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill google-gemini-embeddings-brendadeeznuts1111-tier-1380-omega --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.
