[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6F8XDBJRXNP6Y898GFA9TCN":3,"skill-same:01M6F8XDBJRXNP6Y898GFA9TCN":74},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":51,"commitSha":52,"skillDirectory":53,"forksCount":54,"repositoryHtmlUrl":55,"repositoryHomepageUrl":56,"ownerHtmlUrl":57,"ownerBlogUrl":6,"ownerDescription":58,"updatedAt":59,"install":60,"resources":73},"01M6F8XDBJRXNP6Y898GFA9TCN","cohere-core-workflow-a",null,"Build a complete RAG pipeline with Cohere Chat, Embed, and Rerank.\nUse when implementing retrieval-augmented generation, building\ngrounded Q&A systems, or combining search with LLM generation.\nTrigger with phrases like \"cohere RAG\", \"cohere retrieval\",\n\"cohere grounded generation\", \"cohere search and answer\".","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fjeremylongshore\u002Fclaude-code-plugins-plus-skills\u002Fcohere-core-workflow-a\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"workflow","cohere core workflow a","cohere","core","edit","nlp","rag","rag pipeline","embed","complete","trigger","io","use","write","read","Bash","saas","pipeline","search","code","2026-11-10 10:12:30",false,"---\nname: cohere-core-workflow-a\ndescription: |\n  Build a complete RAG pipeline with Cohere Chat, Embed, and Rerank.\n  Use when implementing retrieval-augmented generation, building\n  grounded Q&A systems, or combining search with LLM generation.\n  Trigger with phrases like \"cohere RAG\", \"cohere retrieval\",\n  \"cohere grounded generation\", \"cohere search and answer\".\nallowed-tools: Read, Write, Edit, Bash(npm:*), Grep\nversion: 1.0.0\nlicense: MIT\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\ntags: [saas, ai, nlp, cohere]\ncompatible-with: claude-code\n---\n\n# Cohere RAG Pipeline (Core Workflow A)\n\n## Overview\nEnd-to-end Retrieval-Augmented Generation using Cohere's three core endpoints: Embed (vectorize), Rerank (sort by relevance), Chat (generate grounded answer with citations).\n\n## Prerequisites\n- Completed `cohere-install-auth` setup\n- `cohere-ai` package installed\n- Understanding of vector similarity search\n\n## Instructions\n\n### Step 1: Embed Your Documents\n\n```typescript\nimport { CohereClientV2 } from 'cohere-ai';\n\nconst cohere = new CohereClientV2();\n\n\u002F\u002F Your knowledge base\nconst documents = [\n  { id: 'doc1', text: 'Cohere Command A has 256K context and supports tool use.' },\n  { id: 'doc2', text: 'Embed v4 generates 1024-dim vectors with 128K token context.' },\n  { id: 'doc3', text: 'Rerank v3.5 scores relevance from 0 to 1 across 100+ languages.' },\n  { id: 'doc4', text: 'The Chat API v2 requires model as a mandatory parameter.' },\n  { id: 'doc5', text: 'Cohere supports structured JSON output via response_format.' },\n];\n\n\u002F\u002F Embed documents for storage\nconst docEmbeddings = await cohere.embed({\n  model: 'embed-v4.0',\n  texts: documents.map(d => d.text),\n  inputType: 'search_document',\n  embeddingTypes: ['float'],\n});\n\n\u002F\u002F Store vectors alongside document text in your vector DB\nconst vectors = docEmbeddings.embeddings.float;\nconsole.log(`Embedded ${vectors.length} docs, ${vectors[0].length} dimensions each`);\n```\n\n### Step 2: Search — Embed the Query\n\n```typescript\nasync function searchDocuments(query: string, topK = 10) {\n  \u002F\u002F Embed the query (note: inputType is 'search_query', not 'search_document')\n  const queryEmbedding = await cohere.embed({\n    model: 'embed-v4.0',\n    texts: [query],\n    inputType: 'search_query',\n    embeddingTypes: ['float'],\n  });\n\n  const queryVector = queryEmbedding.embeddings.float[0];\n\n  \u002F\u002F Cosine similarity search (replace with your vector DB query)\n  const scores = vectors.map((vec, i) => ({\n    index: i,\n    score: cosineSimilarity(queryVector, vec),\n  }));\n\n  return scores\n    .sort((a, b) => b.score - a.score)\n    .slice(0, topK)\n    .map(s => documents[s.index]);\n}\n\nfunction cosineSimilarity(a: number[], b: number[]): number {\n  let dot = 0, magA = 0, magB = 0;\n  for (let i = 0; i \u003C a.length; i++) {\n    dot += a[i] * b[i];\n    magA += a[i] * a[i];\n    magB += b[i] * b[i];\n  }\n  return dot \u002F (Math.sqrt(magA) * Math.sqrt(magB));\n}\n```\n\n### Step 3: Rerank Retrieved Documents\n\n```typescript\nasync function rerankResults(query: string, candidates: typeof documents) {\n  const response = await cohere.rerank({\n    model: 'rerank-v3.5',\n    query,\n    documents: candidates.map(d => d.text),\n    topN: 3,\n  });\n\n  return response.results.map(r => ({\n    ...candidates[r.index],\n    relevanceScore: r.relevanceScore,\n  }));\n}\n```\n\n### Step 4: Generate Grounded Answer with Citations\n\n```typescript\nasync function ragAnswer(query: string) {\n  \u002F\u002F 1. Retrieve\n  const candidates = await searchDocuments(query);\n\n  \u002F\u002F 2. Rerank\n  const topDocs = await rerankResults(query, candidates);\n\n  \u002F\u002F 3. Generate with inline citations\n  const response = await cohere.chat({\n    model: 'command-a-03-2025',\n    messages: [{ role: 'user', content: query }],\n    documents: topDocs.map(d => ({\n      id: d.id,\n      data: { text: d.text },\n    })),\n  });\n\n  const answer = response.message?.content?.[0]?.text ?? '';\n  const citations = response.message?.citations ?? [];\n\n  return { answer, citations, sources: topDocs };\n}\n\n\u002F\u002F Usage\nconst result = await ragAnswer('What context length does Command A support?');\nconsole.log('Answer:', result.answer);\nconsole.log('Citations:', result.citations.length);\n```\n\n## Complete Pipeline (Copy-Paste Ready)\n\n```typescript\nimport { CohereClientV2 } from 'cohere-ai';\n\nconst cohere = new CohereClientV2();\n\nasync function rag(query: string, knowledgeBase: string[]) {\n  \u002F\u002F 1. Rerank the knowledge base directly (skip embed for small corpora)\n  const ranked = await cohere.rerank({\n    model: 'rerank-v3.5',\n    query,\n    documents: knowledgeBase,\n    topN: 5,\n  });\n\n  \u002F\u002F 2. Feed top docs to Chat for grounded answer\n  const docs = ranked.results.map((r, i) => ({\n    id: `doc-${i}`,\n    data: { text: knowledgeBase[r.index] },\n  }));\n\n  const response = await cohere.chat({\n    model: 'command-a-03-2025',\n    messages: [{ role: 'user', content: query }],\n    documents: docs,\n  });\n\n  return response.message?.content?.[0]?.text ?? '';\n}\n```\n\n## Output\n- Embedded document vectors (float, int8, or binary)\n- Reranked candidates with relevance scores (0.0-1.0)\n- Grounded answer with fine-grained citations pointing to source documents\n\n## Error Handling\n| Error | Cause | Solution |\n|-------|-------|----------|\n| `input_type is required` | Missing embed inputType | Use `search_document` or `search_query` |\n| `embedding_types required` | Missing for v3+ models | Add `embeddingTypes: ['float']` |\n| Empty citations | Docs too short\u002Firrelevant | Improve document quality or chunking |\n| `too many documents` | >1000 rerank docs | Batch into groups of 1000 |\n\n## Resources\n- [RAG Complete Example](https:\u002F\u002Fdocs.cohere.com\u002Fdocs\u002Frag-complete-example)\n- [RAG Citations](https:\u002F\u002Fdocs.cohere.com\u002Fdocs\u002Frag-citations)\n- [Embed API](https:\u002F\u002Fdocs.cohere.com\u002Freference\u002Fembed)\n- [Rerank Best Practices](https:\u002F\u002Fdocs.cohere.com\u002Fdocs\u002Freranking-best-practices)\n\n## Next Steps\nFor tool-use and agents workflow, see `cohere-core-workflow-b`.\n\n","# Cohere RAG Pipeline (Core Workflow A)\n\n## Overview\nEnd-to-end Retrieval-Augmented Generation using Cohere's three core endpoints: Embed (vectorize), Rerank (sort by relevance), Chat (generate grounded answer with citations).\n\n## Prerequisites\n- Completed `cohere-install-auth` setup\n- `cohere-ai` package installed\n- Understanding of vector similarity search\n\n## Instructions\n\n### Step 1: Embed Your Documents\n\n```typescript\nimport { CohereClientV2 } from 'cohere-ai';\n\nconst cohere = new CohereClientV2();\n\n\u002F\u002F Your knowledge base\nconst documents = [\n  { id: 'doc1', text: 'Cohere Command A has 256K context and supports tool use.' },\n  { id: 'doc2', text: 'Embed v4 generates 1024-dim vectors with 128K token context.' },\n  { id: 'doc3', text: 'Rerank v3.5 scores relevance from 0 to 1 across 100+ languages.' },\n  { id: 'doc4', text: 'The Chat API v2 requires model as a mandatory parameter.' },\n  { id: 'doc5', text: 'Cohere supports structured JSON output via response_format.' },\n];\n\n\u002F\u002F Embed documents for storage\nconst docEmbeddings = await cohere.embed({\n  model: 'embed-v4.0',\n  texts: documents.map(d => d.text),\n  inputType: 'search_document',\n  embeddingTypes: ['float'],\n});\n\n\u002F\u002F Store vectors alongside document text in your vector DB\nconst vectors = docEmbeddings.embeddings.float;\nconsole.log(`Embedded ${vectors.length} docs, ${vectors[0].length} dimensions each`);\n```\n\n### Step 2: Search — Embed the Query\n\n```typescript\nasync function searchDocuments(query: string, topK = 10) {\n  \u002F\u002F Embed the query (note: inputType is 'search_query', not 'search_document')\n  const queryEmbedding = await cohere.embed({\n    model: 'embed-v4.0',\n    texts: [query],\n    inputType: 'search_query',\n    embeddingTypes: ['float'],\n  });\n\n  const queryVector = queryEmbedding.embeddings.float[0];\n\n  \u002F\u002F Cosine similarity search (replace with your vector DB query)\n  const scores = vectors.map((vec, i) => ({\n    index: i,\n    score: cosineSimilarity(queryVector, vec),\n  }));\n\n  return scores\n    .sort((a, b) => b.score - a.score)\n    .slice(0, topK)\n    .map(s => documents[s.index]);\n}\n\nfunction cosineSimilarity(a: number[], b: number[]): number {\n  let dot = 0, magA = 0, magB = 0;\n  for (let i = 0; i \u003C a.length; i++) {\n    dot += a[i] * b[i];\n    magA += a[i] * a[i];\n    magB += b[i] * b[i];\n  }\n  return dot \u002F (Math.sqrt(magA) * Math.sqrt(magB));\n}\n```\n\n### Step 3: Rerank Retrieved Documents\n\n```typescript\nasync function rerankResults(query: string, candidates: typeof documents) {\n  const response = await cohere.rerank({\n    model: 'rerank-v3.5',\n    query,\n    documents: candidates.map(d => d.text),\n    topN: 3,\n  });\n\n  return response.results.map(r => ({\n    ...candidates[r.index],\n    relevanceScore: r.relevanceScore,\n  }));\n}\n```\n\n### Step 4: Generate Grounded Answer with Citations\n\n```typescript\nasync function ragAnswer(query: string) {\n  \u002F\u002F 1. Retrieve\n  const candidates = await searchDocuments(query);\n\n  \u002F\u002F 2. Rerank\n  const topDocs = await rerankResults(query, candidates);\n\n  \u002F\u002F 3. Generate with inline citations\n  const response = await cohere.chat({\n    model: 'command-a-03-2025',\n    messages: [{ role: 'user', content: query }],\n    documents: topDocs.map(d => ({\n      id: d.id,\n      data: { text: d.text },\n    })),\n  });\n\n  const answer = response.message?.content?.[0]?.text ?? '';\n  const citations = response.message?.citations ?? [];\n\n  return { answer, citations, sources: topDocs };\n}\n\n\u002F\u002F Usage\nconst result = await ragAnswer('What context length does Command A support?');\nconsole.log('Answer:', result.answer);\nconsole.log('Citations:', result.citations.length);\n```\n\n## Complete Pipeline (Copy-Paste Ready)\n\n```typescript\nimport { CohereClientV2 } from 'cohere-ai';\n\nconst cohere = new CohereClientV2();\n\nasync function rag(query: string, knowledgeBase: string[]) {\n  \u002F\u002F 1. Rerank the knowledge base directly (skip embed for small corpora)\n  const ranked = await cohere.rerank({\n    model: 'rerank-v3.5',\n    query,\n    documents: knowledgeBase,\n    topN: 5,\n  });\n\n  \u002F\u002F 2. Feed top docs to Chat for grounded answer\n  const docs = ranked.results.map((r, i) => ({\n    id: `doc-${i}`,\n    data: { text: knowledgeBase[r.index] },\n  }));\n\n  const response = await cohere.chat({\n    model: 'command-a-03-2025',\n    messages: [{ role: 'user', content: query }],\n    documents: docs,\n  });\n\n  return response.message?.content?.[0]?.text ?? '';\n}\n```\n\n## Output\n- Embedded document vectors (float, int8, or binary)\n- Reranked candidates with relevance scores (0.0-1.0)\n- Grounded answer with fine-grained citations pointing to source documents\n\n## Error Handling\n| Error | Cause | Solution |\n|-------|-------|----------|\n| `input_type is required` | Missing embed inputType | Use `search_document` or `search_query` |\n| `embedding_types required` | Missing for v3+ models | Add `embeddingTypes: ['float']` |\n| Empty citations | Docs too short\u002Firrelevant | Improve document quality or chunking |\n| `too many documents` | >1000 rerank docs | Batch into groups of 1000 |\n\n## Resources\n- [RAG Complete Example](https:\u002F\u002Fdocs.cohere.com\u002Fdocs\u002Frag-complete-example)\n- [RAG Citations](https:\u002F\u002Fdocs.cohere.com\u002Fdocs\u002Frag-citations)\n- [Embed API](https:\u002F\u002Fdocs.cohere.com\u002Freference\u002Fembed)\n- [Rerank Best Practices](https:\u002F\u002Fdocs.cohere.com\u002Fdocs\u002Freranking-best-practices)\n\n## Next Steps\nFor tool-use and agents workflow, see `cohere-core-workflow-b`.\n\n",{"name":5,"tags":44,"author":46,"license":15,"version":47,"description":48,"allowed-tools":49,"compatible-with":50},[35,45,24,21],"ai","Jeremy Longshore \u003Cjeremy@intentsolutions.io>","1.0.0","Build a complete RAG pipeline with Cohere Chat, Embed, and Rerank.\nUse when implementing retrieval-augmented generation, building\ngrounded Q&A systems, or combining search with LLM generation.\nTrigger with phrases like \"cohere RAG\", \"cohere retrieval\",\n\"cohere grounded generation\", \"cohere search and answer\".\n","Read, Write, Edit, Bash(npm:*), Grep","claude-code","main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fjeremylongshore\u002Fclaude-code-plugins-plus-skills\u002Fcohere-core-workflow-a",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":61,"prompt":71,"zipAvailable":72},[62,65,68],{"tool":63,"command":64},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill cohere-core-workflow-a",{"tool":66,"command":67},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill cohere-core-workflow-a",{"tool":69,"command":70},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill cohere-core-workflow-a","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fjeremylongshore\u002Fclaude-code-plugins-plus-skills\u002Fcohere-core-workflow-a\u002FSKILL.md",true,[],[75,84,93,102,108,114],{"skillNo":76,"name":77,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":39},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[81,82,83],"model","model hierarchy","model hierarchy skill",{"skillNo":85,"name":86,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":39},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[90,91,92],"MCP","zoom","zoom mcp",{"skillNo":94,"name":95,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":39},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[99,100,101,91],"sdk","zoom apps sdk","apps",{"skillNo":103,"name":104,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":39},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[104],{"skillNo":109,"name":110,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":39},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[110],{"skillNo":115,"name":116,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":39},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[116]]