cohere-api

Installation
SKILL.md

cohere-api

Purpose

This skill integrates the Cohere API to handle AI tasks like generating embeddings, implementing Retrieval-Augmented Generation (RAG), reranking results, and performing semantic search. It's designed for enhancing AI workflows with Cohere's language models, using real-time API calls for efficient processing.

When to Use

Use this skill when processing text for vector embeddings in ML pipelines, building RAG systems for accurate query responses, reranking search results for relevance, or conducting semantic searches on large datasets. Apply it in scenarios requiring API-based AI enhancements, such as chatbots needing contextual retrieval or applications analyzing text similarity.

Key Capabilities

  • Generate embeddings: Convert text to vectors via the /embed endpoint, supporting models like "embed-english-v3.0" for up to 512 tokens per request.
  • RAG implementation: Fetch and augment responses using /generate with external data sources, handling up to 2048 tokens for input and output.
  • Reranking: Use the /rerank endpoint to score and reorder lists of texts based on query relevance, with options for top-k results.
  • Semantic search: Leverage embeddings for similarity searches, integrating with vector databases like Pinecone or Weaviate.
  • Rate limiting: API enforces 60 requests per minute; monitor usage via response headers.
  • Model selection: Specify models in requests, e.g., "command" for generation or "embed-multilingual-v2.0" for cross-language embeddings.

Usage Patterns

To use this skill, first set the environment variable for authentication: export COHERE_API_KEY=your_api_key. Then, make API calls via HTTP requests or the Cohere SDK. For embeddings, structure requests with JSON payloads containing text arrays. In RAG patterns, retrieve documents first, then pass them to /generate for context-aware responses. Always handle asynchronous patterns by checking response status codes. For reranking, pipe search results through the endpoint in a single call. Use try-except blocks in code to wrap API interactions for reliability.

Related skills
Installs
24
GitHub Stars
5
First Seen
Mar 5, 2026