chromadb 2.4.6 → 3.0.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -198,4 +198,4 @@
198
198
  distributed under the License is distributed on an "AS IS" BASIS,
199
199
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
200
  See the License for the specific language governing permissions and
201
- limitations under the License.
201
+ limitations under the License.
package/README.md CHANGED
@@ -1,98 +1,43 @@
1
- # ChromaDB JavaScript Client
1
+ ## chromadb
2
2
 
3
3
  Chroma is the open-source embedding database. Chroma makes it easy to build LLM apps by making knowledge, facts, and skills pluggable for LLMs.
4
4
 
5
- **This package includes all embedding libraries as bundled dependencies**, providing a simple installation experience without worrying about dependency management. For a thin client, install `chromadb-client`
5
+ This package gives you a JS/TS interface to talk to a backend Chroma DB over REST.
6
6
 
7
- ## Features
7
+ [Learn more about Chroma](https://github.com/chroma-core/chroma)
8
8
 
9
- - Complete TypeScript support
10
- - All embedding libraries included as bundled dependencies
11
- - Works in both Node.js and browser environments
12
- - Simple installation with no peer dependency requirements
13
-
14
- ## Installation
15
-
16
- ```bash
17
- # npm
18
- npm install chromadb
19
-
20
- # pnpm
21
- pnpm add chromadb
9
+ - [💬 Community Discord](https://discord.gg/MMeYNTmh3x)
10
+ - [📖 Documentation](https://docs.trychroma.com/)
11
+ - [💡 Colab Example](https://colab.research.google.com/drive/1QEzFyqnoFxq7LUGyP1vzR4iLt9PpCDXv?usp=sharing)
12
+ - [🏠 Homepage](https://www.trychroma.com/)
22
13
 
23
- # yarn
24
- yarn add chromadb
25
- ```
14
+ ## Getting started
26
15
 
27
- ## Getting Started
16
+ Chroma needs to be running in order for this client to talk to it. Please see the [🧪 Usage Guide](https://docs.trychroma.com/guides) to learn how to quickly stand this up.
28
17
 
29
- Chroma needs to be running in order for this client to talk to it. Please see the [Usage Guide](https://docs.trychroma.com/guides) to learn how to quickly stand this up.
18
+ ## Small example
30
19
 
31
20
  ```js
32
21
  import { ChromaClient } from "chromadb";
33
-
34
- // Initialize the client
35
22
  const chroma = new ChromaClient({ path: "http://localhost:8000" });
36
-
37
- // Create a collection
38
- const collection = await chroma.createCollection({ name: "my-collection" });
39
-
40
- // Add documents to the collection
41
- await collection.add({
42
- ids: ["id1", "id2"],
43
- embeddings: [
44
- [1.1, 2.3, 3.2],
45
- [4.5, 6.9, 4.4],
46
- ],
47
- metadatas: [{ source: "doc1" }, { source: "doc2" }],
48
- documents: ["Document 1 content", "Document 2 content"],
49
- });
50
-
51
- // Query the collection
52
- const results = await collection.query({
53
- queryEmbeddings: [1.1, 2.3, 3.2],
54
- nResults: 2,
23
+ const collection = await chroma.createCollection({ name: "test-from-js" });
24
+ for (let i = 0; i < 20; i++) {
25
+ await collection.add({
26
+ ids: ["test-id-" + i.toString()],
27
+ embeddings: [[1, 2, 3, 4, 5]],
28
+ documents: ["test"],
29
+ });
30
+ }
31
+ const queryData = await collection.query({
32
+ queryEmbeddings: [[1, 2, 3, 4, 5]],
33
+ queryTexts: ["test"],
55
34
  });
56
35
  ```
57
36
 
58
- ## Using Embedding Functions
59
-
60
- This package includes all embedding libraries as bundled dependencies, so you can use them directly:
61
-
62
- ```js
63
- import { ChromaClient, OpenAIEmbeddingFunction } from "chromadb";
37
+ ## Local development
64
38
 
65
- const embedder = new OpenAIEmbeddingFunction({
66
- openai_api_key: "your-api-key",
67
- model_name: "text-embedding-ada-002",
68
- });
69
-
70
- const chroma = new ChromaClient({ path: "http://localhost:8000" });
71
- const collection = await chroma.createCollection({
72
- name: "my-collection",
73
- embeddingFunction: embedder,
74
- });
75
-
76
- // Now you can add documents without providing embeddings
77
- await collection.add({
78
- ids: ["id1"],
79
- documents: ["Document content"],
80
- });
81
-
82
- // And query with text
83
- const results = await collection.query({
84
- queryTexts: ["similar document"],
85
- nResults: 2,
86
- });
87
- ```
88
-
89
- ## Additional Resources
90
-
91
- - [📖 Documentation](https://docs.trychroma.com/)
92
- - [💬 Community Discord](https://discord.gg/MMeYNTmh3x)
93
- - [🏠 Homepage](https://www.trychroma.com/)
94
- - [GitHub Repository](https://github.com/chroma-core/chroma)
39
+ [View the Development Readme](./DEVELOP.md)
95
40
 
96
41
  ## License
97
42
 
98
- Apache 2.0
43
+ Apache 2.0