Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/docs.trychroma.com/components/header/x-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const XLink: React.FC = () => {
>
<UIButton className="flex items-center gap-2 p-[0.35rem] text-xs">
<XLogo className="h-[14px] w-[14px] invert dark:invert-0" />
<p>21.3k</p>
<p>22.1k</p>
</UIButton>
</Link>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ import { ChromaClient } from "chromadb";
const client = new ChromaClient();
```

If you run your Chroma server using a different configuration, or [deploy](../../guides/deploy/client-server-mode) your Chroma server, you can specify the `host`, `port`, and whether the client should connect over `ssl`:

```typescript
import { ChromaClient } from "chromadb";

const client = new ChromaClient({
host: "YOUR-HOST",
port: "YOUR-PORT",
ssl: true
});
```

{% /Tab %}

{% /Tabs %}
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ collection = client.create_collection(
)
```

Instead of having Chroma embed documents, you can also provide embeddings directly when [adding data](./add-data) to a collection. In this case, your collection will not have an embedding function set, and you will be responsible for providing embeddings directly when adding data and querying.

```python
collection = client.create_collection(
name="my_collection",
embedding_function=None
)
```

### typescript

Install the `@chroma-core/openai` package to get access to the `OpenAIEmbeddingFunction`:
Expand Down Expand Up @@ -110,6 +119,35 @@ const collection = await client.createCollection({

Instead of having Chroma embed documents, you can also provide embeddings directly when [adding data](./add-data) to a collection. In this case, your collection will not have an embedding function set, and you will be responsible for providing embeddings directly when adding data and querying.

```typescript
const collection = await client.createCollection({
name: "my_collection",
embeddingFunction: null
})
```

### python

```python
collection = client.create_collection(
name="my_collection",
embedding_function=None
)
```

### typescript

```typescript
let collection = await client.createCollection({
name: "my_collection",
embeddingFunction: emb_fn,
metadata: {
description: "my first Chroma collection",
created: (new Date()).toString()
}
});
```

### Collection Metadata

When creating collections, you can pass the optional `metadata` argument to add a mapping of metadata key-value pairs to your collections. This can be useful for adding general about the collection like creation time, description of the data stored in the collection, and more.
Expand All @@ -120,12 +158,12 @@ When creating collections, you can pass the optional `metadata` argument to add
from datetime import datetime

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Documentation]

Fix grammar: "adding general about the collection" should be "adding general information about the collection"

collection = client.create_collection(
name="my_collection",
name="my_collection",
embedding_function=emb_fn,
metadata={
"description": "my first Chroma collection",
"created": str(datetime.now())
}
}
)
```

Expand Down Expand Up @@ -180,7 +218,7 @@ collections_subset = client.list_collections(limit=20, offset=50) # get 20 colle
Current versions of Chroma store the embedding function you used to create a collection on the server, so the client can resolve it for you on subsequent "get" operations. If you are running an older version of the Chroma client or server (<1.1.13), you will need to provide the same embedding function you used to create a collection when using `get_collection`:

```python
collection = client.get_collection(
collection = client.get_collection(
name='my-collection',
embedding_function=ef
)
Expand Down Expand Up @@ -228,7 +266,7 @@ const collectionsSubset = await client.listCollections({ limit: 20, offset: 50 }
Current versions of Chroma store the embedding function you used to create a collection on the server, so the client can resolve it for you on subsequent "get" operations. If you are running an older version of the Chroma JS/TS client (<3.04) or server (<1.1.13), you will need to provide the same embedding function you used to create a collection when using `getCollection` and `getCollections`:

```typescript
const collection = await client.getCollection({
const collection = await client.getCollection({
name: 'my-collection',
embeddingFunction: ef
})
Expand All @@ -248,7 +286,7 @@ After a collection is created, you can modify its name, metadata and elements of
```python
collection.modify(
name="new-name",
metadata={"description": "new description"}
metadata={"description": "new description"}
)
```

Expand All @@ -270,13 +308,13 @@ Deleting collections is destructive and not reversible
### python

```python
collection.delete(name="my-collection")
client.delete_collection(name="my-collection")
```

### typescript

```typescript
await collection.delete({ name: "my-collection" });
await client.deleteCollection({ name: "my-collection" });
```

## Convenience Methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ You can use [Chroma Cloud](https://www.trychroma.com/signup), which is a managed

Regardless of deployment mode, Chroma is composed of five core components. Each plays a distinct role in the system and operates over the shared [Chroma data model](../overview/data-model).

![architecture](/architecture.png)

### The Gateway

The entrypoint for all client traffic.
Expand Down Expand Up @@ -73,17 +71,13 @@ These components operate differently depending on the deployment mode, particula

### Read Path

![read_path](/read_path.png)

1. Request arrives at the gateway, where it is authenticated, checked against quota limits, rate limited and transformed into a logical plan.
2. This logical plan is routed to the relevant query executor. In distributed Chroma, a rendezvous hash on the collection id is used to route the query to the correct nodes and provide cache coherence.
3. The query executor transforms the logical plan into a physical plan for execution, reads from its storage layer, and performs the query. The query executor pulls data from the log to ensure a consistent read.
4. The request is returned to the gateway and subsequently to the client.

### Write Path

![write_path](/write_path.png)

1. Request arrives at the gateway, where it is authenticated, checked against quota limits, rate limited and then transformed into a log of operations.
2. The log of operations is forwarded to the write-ahead-log for persistence.
3. After being persisted by the write-ahead-log, the gateway acknowledges the write.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

New to Chroma? Check out the [getting started guide](./getting-started)

![Chroma Computer](/computer.png)

Chroma gives you everything you need for retrieval:

- Store embeddings and their metadata
Expand Down Expand Up @@ -65,6 +63,7 @@ Continue with the full [getting started guide](./getting-started).
| Javascript | [`chromadb`](https://www.npmjs.com/package/chromadb) (by Chroma) |
| Ruby | [from @mariochavez](https://github.com/mariochavez/chroma) |
| Java | [from @t_azarov](https://github.com/amikos-tech/chromadb-java-client) |
| Java | [from @locxngo](https://github.com/locxngo/chroma-client) (Java 17+, ChromaAPI V2) |
| Go | [from @t_azarov](https://github.com/amikos-tech/chroma-go) |
| C#/.NET | [from @cincuranet, @ssone95, @microsoft](https://github.com/ssone95/ChromaDB.Client) |
| Rust | [from @Anush008](https://crates.io/crates/chromadb) |
Expand Down
Loading