Loading...
Loading...
Use when the user needs self-hosted or local Chroma for semantic search, including `ChromaClient`, `HttpClient`, or Python `EphemeralClient`, local persistence, Docker or `chroma run`, or OSS Chroma without Chroma Cloud features.
npx skill4agent add chroma-core/agent-skills chroma-localchroma runHttpClientChromaClientEphemeralClient@chroma-core/default-embed@chroma-core/openaichroma runlocalhost:8000EphemeralClientgetOrCreateCollection()get_or_create_collection()getOrCreateCollection()get_or_create_collection()localhost:8000EphemeralClientChromaClientHttpClientClientSchema()Search()chroma runlocalhost:8000import { ChromaClient } from 'chromadb';
import { DefaultEmbeddingFunction } from '@chroma-core/default-embed';
const client = new ChromaClient();
const embeddingFunction = new DefaultEmbeddingFunction();
const collection = await client.getOrCreateCollection({
name: 'my_collection',
embeddingFunction,
});
// Add documents
await collection.add({
ids: ['doc1', 'doc2'],
documents: ['First document text', 'Second document text'],
});
// Query
const results = await collection.query({
queryTexts: ['search query'],
nResults: 5,
});import chromadb
client = chromadb.HttpClient(host="localhost", port=8000)
collection = client.get_or_create_collection(name="my_collection")
# Add documents
collection.add(
ids=["doc1", "doc2"] ,
documents=["First document text", "Second document text"],
)
# Query
results = collection.query(
query_texts=["search query"],
n_results=5,
)llms.txt