Chroma Vector Database
Orchestra-Research/AI-Research-SKILLs
Shows how to store documents and embeddings in Chroma, query them by similarity with metadata filters, and persist them to disk for RAG and semantic search projects.
Embedding strategies, ANN algorithms, hybrid search, RAG chunking strategies, and reranking for semantic search and retrieval.
$ npx skills add majiayu000/claude-skill-registry --skill vector-db-patterns -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install majiayu000/claude-skill-registry vector-db-patterns --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/majiayu000/claude-skill-registry.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/ai-ml/vector-db-patterns .claude/skills/vector-db-patterns && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "vector-db-patterns" agent skill from https://github.com/majiayu000/claude-skill-registry/tree/main/skills/ai-ml/vector-db-patterns into .claude/skills/vector-db-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "vector-db-patterns", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/majiayu000/claude-skill-registry/tree/main/skills/ai-ml/vector-db-patternsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add majiayu000/claude-skill-registry --skill vector-db-patterns -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install majiayu000/claude-skill-registry vector-db-patterns --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/majiayu000/claude-skill-registry.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/ai-ml/vector-db-patterns .agents/skills/vector-db-patterns && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "vector-db-patterns" agent skill from https://github.com/majiayu000/claude-skill-registry/tree/main/skills/ai-ml/vector-db-patterns into .agents/skills/vector-db-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "vector-db-patterns", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add majiayu000/claude-skill-registry --skill vector-db-patterns -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install majiayu000/claude-skill-registry vector-db-patterns --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/majiayu000/claude-skill-registry.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/ai-ml/vector-db-patterns .cursor/skills/vector-db-patterns && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "vector-db-patterns" agent skill from https://github.com/majiayu000/claude-skill-registry/tree/main/skills/ai-ml/vector-db-patterns into .cursor/skills/vector-db-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "vector-db-patterns", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/majiayu000/claude-skill-registry.git --path skills/ai-ml/vector-db-patterns--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add majiayu000/claude-skill-registry --skill vector-db-patterns -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install majiayu000/claude-skill-registry vector-db-patterns --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/majiayu000/claude-skill-registry.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/ai-ml/vector-db-patterns .gemini/skills/vector-db-patterns && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "vector-db-patterns" agent skill from https://github.com/majiayu000/claude-skill-registry/tree/main/skills/ai-ml/vector-db-patterns into .gemini/skills/vector-db-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "vector-db-patterns", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install majiayu000/claude-skill-registry vector-db-patternsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add majiayu000/claude-skill-registry --skill vector-db-patterns -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/majiayu000/claude-skill-registry.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/ai-ml/vector-db-patterns .github/skills/vector-db-patterns && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "vector-db-patterns" agent skill from https://github.com/majiayu000/claude-skill-registry/tree/main/skills/ai-ml/vector-db-patterns into .github/skills/vector-db-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "vector-db-patterns", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add majiayu000/claude-skill-registry --skill vector-db-patterns -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install majiayu000/claude-skill-registry vector-db-patterns --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/majiayu000/claude-skill-registry.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/ai-ml/vector-db-patterns .opencode/skills/vector-db-patterns && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "vector-db-patterns" agent skill from https://github.com/majiayu000/claude-skill-registry/tree/main/skills/ai-ml/vector-db-patterns into .opencode/skills/vector-db-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "vector-db-patterns", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
vector-db-patternsEmbedding strategies, ANN algorithms, hybrid search, RAG chunking strategies, and reranking for semantic search and retrieval.
Vector DB Patterns is an agent skill from majiayu000/claude-skill-registry. Embedding strategies, ANN algorithms, hybrid search, RAG chunking strategies, and reranking for semantic search and retrieval.
Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `metadata.json`).
It sits in AI & LLM Engineering, covering Retrieval-augmented generation and Embeddings. The repository describes itself as: Searchable Claude Code skills catalog with source-linked guides and generated registry artifacts. The licence is MIT.
Read from SKILL.md and the folder at commit 2d14a69. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).
From the folder's file list and the shell code blocks in SKILL.md.
Hosts in commands or code, which the agent is likely to contact:
api.cohere.aiFrom URLs in SKILL.md, links to its own repository left out.
Names these keys or tokens, usually read from environment variables:
COHERE_API_KEYFrom names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Vector DB Patterns loads about 2.2k tokens when it runs. Until then it costs about 36 tokens; SKILL.md has 130 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from majiayu000/claude-skill-registry at commit 2d14a69, republished under its MIT licence (© majiayu000). 130 words, ~2,223 tokens.
.claude/skills/vector-db-patterns/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.Semantic search and retrieval-augmented generation (RAG) patterns with vector databases.
import { OpenAI } from 'openai'
const openai = new OpenAI()
// Batch embedding for efficiency (max 2048 inputs per request for text-embedding-3-small)
async function embedTexts(texts: string[]): Promise<number[][]> {
const BATCH_SIZE = 2048
const allEmbeddings: number[][] = []
for (let i = 0; i < texts.length; i += BATCH_SIZE) {
const batch = texts.slice(i, i + BATCH_SIZE)
const response = await openai.embeddings.create({
model: 'text-embedding-3-small', // 1536 dimensions, good cost/quality
input: batch,
dimensions: 512, // Reduce dims for speed (Matryoshka)
})
allEmbeddings.push(...response.data.map(d => d.embedding))
}
return allEmbeddings
}
// Embed with prefix for asymmetric retrieval
async function embedForSearch(query: string): Promise<number[]> {
const [embedding] = await embedTexts([`search_query: ${query}`])
return embedding
}
async function embedForStorage(document: string): Promise<number[]> {
const [embedding] = await embedTexts([`search_document: ${document}`])
return embedding
}interface Chunk {
id: string
text: string
metadata: {
sourceId: string
chunkIndex: number
startChar: number
endChar: number
}
}
// Recursive character splitting with overlap
function chunkText(
text: string,
chunkSize: number = 512,
overlap: number = 50
): Chunk[] {
const separators = ['\n\n', '\n', '. ', ' ']
return recursiveSplit(text, separators, chunkSize, overlap)
}
function recursiveSplit(
text: string,
separators: string[],
chunkSize: number,
overlap: number
): Chunk[] {
if (text.length <= chunkSize) {
return [{ id: crypto.randomUUID(), text, metadata: {} as any }]
}
const separator = separators.find(s => text.includes(s)) ?? ''
const parts = text.split(separator)
const chunks: Chunk[] = []
let current = ''
for (const part of parts) {
const candidate = current ? current + separator + part : part
if (candidate.length > chunkSize && current) {
chunks.push({ id: crypto.randomUUID(), text: current.trim(), metadata: {} as any })
// Overlap: keep last N chars of previous chunk
const overlapText = current.slice(-overlap)
current = overlapText + separator + part
} else {
current = candidate
}
}
if (current.trim()) {
chunks.push({ id: crypto.randomUUID(), text: current.trim(), metadata: {} as any })
}
return chunks
}
// Semantic chunking: split at topic boundaries using embeddings
async function semanticChunk(text: string, threshold: number = 0.3): Promise<Chunk[]> {
const sentences = text.match(/[^.!?]+[.!?]+/g) ?? [text]
const embeddings = await embedTexts(sentences)
const chunks: string[][] = [[sentences[0]]]
for (let i = 1; i < sentences.length; i++) {
const similarity = cosineSimilarity(embeddings[i - 1], embeddings[i])
if (similarity < threshold) {
// Low similarity = topic boundary = new chunk
chunks.push([sentences[i]])
} else {
chunks[chunks.length - 1].push(sentences[i])
}
}
return chunks.map((sentences, i) => ({
id: crypto.randomUUID(),
text: sentences.join(' ').trim(),
metadata: { sourceId: '', chunkIndex: i, startChar: 0, endChar: 0 }
}))
}// Using Pinecone
import { Pinecone } from '@pinecone-database/pinecone'
const pinecone = new Pinecone()
const index = pinecone.index('documents')
// Upsert with metadata
async function indexDocument(doc: Document, chunks: Chunk[]): Promise<void> {
const embeddings = await embedTexts(chunks.map(c => c.text))
const vectors = chunks.map((chunk, i) => ({
id: chunk.id,
values: embeddings[i],
metadata: {
text: chunk.text,
sourceId: doc.id,
sourceTitle: doc.title,
category: doc.category,
createdAt: doc.createdAt.toISOString(),
chunkIndex: i,
}
}))
// Upsert in batches of 100
for (let i = 0; i < vectors.length; i += 100) {
await index.upsert(vectors.slice(i, i + 100))
}
}
// Query with metadata filter
async function searchDocuments(
query: string,
filters?: { category?: string; after?: Date },
topK: number = 10
): Promise<SearchResult[]> {
const queryEmbedding = await embedForSearch(query)
const filter: Record<string, any> = {}
if (filters?.category) {
filter.category = { $eq: filters.category }
}
if (filters?.after) {
filter.createdAt = { $gte: filters.after.toISOString() }
}
const results = await index.query({
vector: queryEmbedding,
topK,
includeMetadata: true,
filter: Object.keys(filter).length > 0 ? filter : undefined,
})
return results.matches.map(m => ({
id: m.id,
score: m.score ?? 0,
text: m.metadata?.text as string,
sourceId: m.metadata?.sourceId as string,
sourceTitle: m.metadata?.sourceTitle as string,
}))
}// Combine vector similarity with BM25 keyword matching
async function hybridSearch(
query: string,
topK: number = 10,
alpha: number = 0.7 // 0.7 = 70% semantic, 30% keyword
): Promise<SearchResult[]> {
// Run both searches in parallel
const [vectorResults, keywordResults] = await Promise.all([
vectorSearch(query, topK * 2),
keywordSearch(query, topK * 2), // BM25 via Elasticsearch
])
// Reciprocal Rank Fusion (RRF)
const k = 60 // RRF constant
const scores = new Map<string, number>()
vectorResults.forEach((r, rank) => {
const current = scores.get(r.id) ?? 0
scores.set(r.id, current + alpha * (1 / (k + rank + 1)))
})
keywordResults.forEach((r, rank) => {
const current = scores.get(r.id) ?? 0
scores.set(r.id, current + (1 - alpha) * (1 / (k + rank + 1)))
})
// Sort by combined score, return top K
const allResults = [...vectorResults, ...keywordResults]
const uniqueResults = new Map(allResults.map(r => [r.id, r]))
return [...scores.entries()]
.sort((a, b) => b[1] - a[1])
.slice(0, topK)
.map(([id, score]) => ({
...uniqueResults.get(id)!,
score,
}))
}// Cross-encoder reranking: slower but much more accurate than bi-encoder
async function rerankResults(
query: string,
results: SearchResult[],
topK: number = 5
): Promise<SearchResult[]> {
// Use Cohere Rerank or cross-encoder model
const response = await fetch('https://api.cohere.ai/v1/rerank', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.COHERE_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'rerank-english-v3.0',
query,
documents: results.map(r => r.text),
top_n: topK,
return_documents: false,
}),
})
const data = await response.json()
return data.results.map((r: any) => ({
...results[r.index],
score: r.relevance_score,
}))
}
// RAG pipeline: retrieve → rerank → generate
async function ragQuery(query: string): Promise<string> {
// Step 1: Retrieve candidates (broad, fast)
const candidates = await hybridSearch(query, 20)
// Step 2: Rerank (narrow, accurate)
const reranked = await rerankResults(query, candidates, 5)
// Step 3: Generate answer with context
const context = reranked.map(r => r.text).join('\n\n')
const response = await openai.chat.completions.create({
model: 'gpt-4o',
messages: [
{ role: 'system', content: `Answer based on the context below.\n\nContext:\n${context}` },
{ role: 'user', content: query },
],
})
return response.choices[0].message.content!
}© majiayu000, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file in skills/ai-ml/vector-db-patterns of majiayu000/claude-skill-registry.
Open the folder on GitHubat commit 2d14a69
We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in majiayu000/claude-skill-registry, which our catalogue first saw on October 7, 2026.
Vector DB Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Vector DB Patterns this skillmajiayu000/claude-skill-registry | 666 | 1 repos | ~2.2k | Automated safety check: Pass | MIT | |
| Chroma Vector DatabaseOrchestra-Research/AI-Research-SKILLs | 13k | 8 repos | ~2.3k | Automated safety check: Pass | MIT | |
| Ms Agent Framework RAGshuyu-labs/WebCode | 278 | — | ~1.1k | Automated safety check: Pass | Custom licence | |
| Pgvector Semantic Searchtimescale/pg-aiguide | 1.9k | 1 repos | ~3.8k | Automated safety check: Pass | Apache-2.0 | |
| Evaluate RAGai-evals-course/evals-skills | 1.5k | — | ~1.9k | Automated safety check: Pass | Apache-2.0 | |
| RAG ArchitectJeffallan/claude-skills | 12k | 1 repos | ~2k | Automated safety check: Pass | MIT |
Orchestra-Research/AI-Research-SKILLs
Shows how to store documents and embeddings in Chroma, query them by similarity with metadata filters, and persist them to disk for RAG and semantic search projects.
shuyu-labs/WebCode
Comprehensive guide for building Agentic RAG systems using Microsoft Agent Framework in C.
timescale/pg-aiguide
A skill your agent uses for setting up vector similarity search with pgvector for AI/ML embeddings, RAG applications, or semantic search.
ai-evals-course/evals-skills
Guides evaluation of a RAG system by diagnosing failures in traces, building a retrieval test set and scoring retrieval and generation separately.
Jeffallan/claude-skills
Designs retrieval-augmented generation systems: document chunking, embeddings, vector store setup, hybrid search, reranking and retrieval evaluation, with checks at each step.
profbernardoj/everclaw-community-branches
Diagnose and fix broken memory search in OpenClaw. An agent skill from profbernardoj/everclaw-community-branches.
majiayu000/claude-skill-registry
Multi-source deep research using firecrawl and exa MCPs. An agent skill from majiayu000/claude-skill-registry.
majiayu000/claude-skill-registry
Neural search via Exa MCP for web, code, and company research.
majiayu000/claude-skill-registry
Unified media generation via fal.ai MCP — image, video, and audio.
majiayu000/claude-skill-registry
Interact with Zotero reference management libraries using the pyzotero Python client.
majiayu000/claude-skill-registry
Search scientific papers and retrieve structured experimental data extracted from full-text studies via the BGPT MCP server.
majiayu000/claude-skill-registry
Perform pairwise sequence alignment using Biopython Bio.Align.PairwiseAligner.
Categories
Embedding strategies, ANN algorithms, hybrid search, RAG chunking strategies, and reranking for semantic search and retrieval. Vector DB Patterns is an agent skill from majiayu000/claude-skill-registry. Embedding strategies, ANN algorithms, hybrid search, RAG chunking strategies, and reranking for semantic search and retrieval.
Vector DB Patterns fits situations like: tasks that involve Retrieval-augmented generation; tasks that involve Embeddings.
Run `npx skills add majiayu000/claude-skill-registry --skill vector-db-patterns -a claude-code`. Or copy the skill folder (skills/ai-ml/vector-db-patterns in majiayu000/claude-skill-registry) into .claude/skills/vector-db-patterns in your project. Claude Code loads it when a task matches its description.
Run `npx skills add majiayu000/claude-skill-registry --skill vector-db-patterns -a codex`. Or copy the skill folder (skills/ai-ml/vector-db-patterns in majiayu000/claude-skill-registry) into .agents/skills/vector-db-patterns in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add majiayu000/claude-skill-registry --skill vector-db-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/vector-db-patterns, .gemini/skills/vector-db-patterns, .github/skills/vector-db-patterns and .opencode/skills/vector-db-patterns in your project.
Going by SKILL.md and its folder, Vector DB Patterns needs credentials named COHERE_API_KEY. Our summary lists: A credential in COHERE_API_KEY.
SKILL.md names 1 domain. In commands or code: api.cohere.ai; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Vector DB Patterns is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.2k tokens (SKILL.md is roughly 8.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Vector DB Patterns: Chroma Vector Database (Orchestra-Research/AI-Research-SKILLs, 13k stars), Ms Agent Framework RAG (shuyu-labs/WebCode, 278 stars), Pgvector Semantic Search (timescale/pg-aiguide, 1.9k stars) and Evaluate RAG (ai-evals-course/evals-skills, 1.5k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
majiayu000 (a GitHub user) maintains it in majiayu000/claude-skill-registry, which has 666 GitHub stars. The repository holds 1,273 skills in this directory. The repository was last updated on October 7, 2026.
Source: majiayu000/claude-skill-registry on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.