Terminal
Terminal/Skill
Guides running Chroma locally or on your own server for semantic search, covering persistence, Docker, chroma run, and test clients.
By Chroma
Works with
npx skills add chroma-core/agent-skills --skill chroma-localDetermine these before writing code. Prefer discovering them from the repo and the user request. Ask only when the choice materially changes the implementation.
Runtime shape
chroma run, a Docker or service command, HttpClient or ChromaClient, or Python EphemeralClient.Persistence
Embedding model
@chroma-core/default-embed in TypeScript or the standard local default in Python.@chroma-core/openai.Indexed data shape
Existing local server
Fresh local development
chroma run or the repo's existing Docker or service command.localhost:8000 unless the repo already uses another address.Python tests or disposable local workflows
EphemeralClient when persistence is unnecessary.Persistent local development
Search integration work
getOrCreateCollection() in TypeScript or get_or_create_collection() in Python.Ask first:
Proceed with sensible defaults:
getOrCreateCollection() (TypeScript) / get_or_create_collection() (Python)localhost:8000 unless the repo already configures another address or is using Python EphemeralClientChromaClient, HttpClient, or Client)Schema() and Search().Start a local Chroma server when the repo needs one:
chroma run
Default address: localhost:8000.
TypeScript local client:
import { 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,
});
Python local client:
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,
)
Fetch Chroma's llms.txt only when you need API or product details that are not already in the repo or this skill: https://docs.trychroma.com/llms.txt