添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Announcing

Launching multi-modal

Learn More

chroma

the AI-native open-source embedding database

Sign up for Chroma Cloud
Close

Chroma Cloud

Technical Preview

Everything you love about Chroma, now available serverlessly in the cloud.

1 line code change
Scales up and down to zero
Usage-based (free for now!)

Reserve your place on the waitlist

> chroma login

# push your local chroma db to the cloud

> chroma push --path /persist_path

# create a new DB

> chroma db create db_name

# Update Client Init

# python

# client = chromadb.HttpClient()

client = chromadb.CloudClient(...)

// javascript

// const client = new ChromaClient();

const client = new CloudClient(...);

that’s it!

Embeddings made easy

Chroma has all the tools you need to use embeddings

install and run chroma

pip install chromadb
chroma run # run the server

the core API is 4 commands

Python

# python can also run in-memory with no server running: chromadb.PersistentClient()
import chromadb
client = chromadb.HttpClient()
collection = client.create_collection("sample_collection")
# Add docs to the collection. Can also update and delete. Row-based API coming soon!
collection.add(
    documents=["This is document1", "This is document2"], # we embed for you, or bring your own
    metadatas=[{"source": "notion"}, {"source": "google-docs"}], # filter on arbitrary metadata!
    ids=["doc1", "doc2"], # must be unique for each doc 
results = collection.query(
    query_texts=["This is a query document"],
    n_results=2,
    # where={"metadata_field": "is_equal_to_this"}, # optional filter
    # where_document={"$contains":"search_string"}  # optional filter
)  

Javascript

// install the JS client and the (optional) default embedding function
npm install --save chromadb chromadb-default-embed
// set "type": "module" in your package.json
import { ChromaClient } from 'chromadb'
async function chromaExample() {
  const client = new ChromaClient();
  const collection = await client.createCollection({name: "sample_collection"});
  await collection.add({
    documents: ["This is a document", "This is another document"], // we embed for you, or bring your own
    metadatas: [{ source: "my_source" }, { source: "my_source" }], // filter on arbitrary metadata!
    ids: ["id1", "id2"] // must be unique for each doc 
  const results = await collection.query({
    queryTexts: ["This is a query document"],
    nResults: 2,