agentleFS
Ghost7802Ghost7802/awesome-api-skills/skills/cohere/SKILL.md

cohere

Skill13 starsChanged 27 days agoMITView on GitHub

  • Reads credentials
  • Installs packages

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Rerank Format: Ensure documents passed to rerank are either strings or objects with a text property.

    line 72

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Cohere API Skill

Overview

Cohere provides industry-leading semantic search embeddings (Embed v3), document reranking (Rerank v3), and conversational reasoning with citations (Command R+).

Installation

npm install cohere-ai
pip install cohere

Authentication & Client Setup

import { CohereClient } from 'cohere-ai';

const cohere = new CohereClient({
  token: process.env.COHERE_API_KEY,
});

Core API Operations

1. Embed v3 with Mandatory inputType

// When embedding documents into vector storage:
const docEmbeddings = await cohere.embed({
  model: 'embed-english-v3.0',
  texts: ['PostgreSQL handles ACID transactions', 'Redis is an in-memory cache'],
  inputType: 'search_document', // Required for Embed v3
});

// When embedding user search query:
const queryEmbedding = await cohere.embed({
  model: 'embed-english-v3.0',
  texts: ['how does Postgres ensure data integrity?'],
  inputType: 'search_query', // Required for Embed v3
});

2. Rerank Document Candidates (RAG Optimization)

const reranked = await cohere.rerank({
  model: 'rerank-english-v3.0',
  query: 'How to configure SSL certificates in Nginx?',
  documents: [
    'Nginx is an HTTP and reverse proxy server.',
    'To configure SSL in Nginx, add ssl_certificate and ssl_certificate_key directives in the server block.',
    'Apache HTTP server uses SSLCertificateFile.',
  ],
  topN: 2,
});

console.log(reranked.results);

3. Command R+ Chat with Citations

const response = await cohere.chat({
  model: 'command-r-plus',
  message: 'Explain zero-knowledge rollups.',
  documents: [
    { title: 'ZK Rollups', snippet: 'ZK-rollups bundle transactions into a single cryptographic proof.' },
  ],
});

console.log(response.text);
console.log(response.citations);

AI Pitfalls & Anti-Hallucination Guidelines

  • Missing inputType: Failing to pass inputType: 'search_document' or 'search_query' will result in a 400 validation error in Embed v3.
  • Rerank Format: Ensure documents passed to rerank are either strings or objects with a text property.

Production Verification Checklist

  • inputType verified across indexing and query pipelines
  • Cohere Rerank layer integrated after initial vector search
  • Citations mapped to source document IDs in UI

Last Verified: 2026-07-03

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.