θΏ™ζ˜―indexlocζδΎ›ηš„ζœεŠ‘οΌŒδΈθ¦θΎ“ε…₯任何密码
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ AnythingLLM divides your documents into objects called `workspaces`. A Workspace
- [PGVector](https://github.com/pgvector/pgvector)
- [Astra DB](https://www.datastax.com/products/datastax-astra)
- [Pinecone](https://pinecone.io)
- [Chroma](https://trychroma.com)
- [Chroma & ChromaCloud](https://trychroma.com)
- [Weaviate](https://weaviate.io)
- [Qdrant](https://qdrant.tech)
- [Milvus](https://milvus.io)
Expand Down
6 changes: 6 additions & 0 deletions docker/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ GID='1000'
# CHROMA_API_HEADER="X-Api-Key"
# CHROMA_API_KEY="sk-123abc"

# Enable all below if you are using vector database: Chroma Cloud.
# VECTOR_DB="chromacloud"
# CHROMACLOUD_API_KEY="ck-your-api-key"
# CHROMACLOUD_TENANT=
# CHROMACLOUD_DATABASE=

# Enable all below if you are using vector database: Pinecone.
# VECTOR_DB="pinecone"
# PINECONE_API_KEY=
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
export default function ChromaCloudOptions({ settings }) {
return (
<div className="w-full flex flex-col gap-y-7">
<div className="w-full flex items-center gap-[36px] mt-1.5">
<div className="flex flex-col w-60">
<label className="text-white text-sm font-semibold block mb-3">
API Key
</label>
<input
type="password"
name="ChromaCloudApiKey"
className="border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5"
placeholder="ck-your-api-key-here"
defaultValue={settings?.ChromaCloudApiKey ? "*".repeat(20) : ""}
required={true}
autoComplete="off"
spellCheck={false}
/>
</div>

<div className="flex flex-col w-60">
<label className="text-white text-sm font-semibold block mb-3">
Tenant ID
</label>
<input
name="ChromaCloudTenant"
autoComplete="off"
type="text"
defaultValue={settings?.ChromaCloudTenant}
className="border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5"
placeholder="your-tenant-id-here"
required={true}
/>
</div>

<div className="flex flex-col w-60">
<label className="text-white text-sm font-semibold block mb-3">
Database Name
</label>
<input
name="ChromaCloudDatabase"
autoComplete="off"
type="text"
defaultValue={settings?.ChromaCloudDatabase}
className="border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5"
placeholder="your-database-name"
required={true}
/>
</div>
</div>
</div>
);
}
9 changes: 9 additions & 0 deletions frontend/src/pages/GeneralSettings/VectorDatabase/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import PGVectorLogo from "@/media/vectordbs/pgvector.png";

import LanceDBOptions from "@/components/VectorDBSelection/LanceDBOptions";
import ChromaDBOptions from "@/components/VectorDBSelection/ChromaDBOptions";
import ChromaCloudOptions from "@/components/VectorDBSelection/ChromaCloudOptions";
import PineconeDBOptions from "@/components/VectorDBSelection/PineconeDBOptions";
import WeaviateDBOptions from "@/components/VectorDBSelection/WeaviateDBOptions";
import QDrantDBOptions from "@/components/VectorDBSelection/QDrantDBOptions";
Expand Down Expand Up @@ -133,6 +134,14 @@ export default function GeneralVectorDatabase() {
description:
"Open source vector database you can host yourself or on the cloud.",
},
{
name: "Chroma Cloud",
value: "chromacloud",
logo: ChromaLogo,
options: <ChromaCloudOptions settings={settings} />,
description:
"Fully managed Chroma cloud service with enterprise features and support.",
},
{
name: "Pinecone",
value: "pinecone",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,14 @@ export const VECTOR_DB_PRIVACY = {
],
logo: ChromaLogo,
},
chromacloud: {
name: "Chroma Cloud",
description: [
"Your vectors and document text are stored on Chroma's cloud service",
"Access to your data is managed by Chroma",
],
logo: ChromaLogo,
},
pinecone: {
name: "Pinecone",
description: [
Expand Down
6 changes: 6 additions & 0 deletions server/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ SIG_SALT='salt' # Please generate random string at least 32 chars long.
# CHROMA_API_HEADER="X-Api-Key"
# CHROMA_API_KEY="sk-123abc"

# Enable all below if you are using vector database: Chroma Cloud.
# VECTOR_DB="chromacloud"
# CHROMACLOUD_API_KEY="ck-your-api-key"
# CHROMACLOUD_TENANT=
# CHROMACLOUD_DATABASE=

# Enable all below if you are using vector database: Pinecone.
# VECTOR_DB="pinecone"
# PINECONE_API_KEY=
Expand Down
5 changes: 5 additions & 0 deletions server/models/systemSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,11 @@ const SystemSettings = {
ChromaApiHeader: process.env.CHROMA_API_HEADER,
ChromaApiKey: !!process.env.CHROMA_API_KEY,

// ChromaCloud DB Keys
ChromaCloudApiKey: !!process.env.CHROMACLOUD_API_KEY,
ChromaCloudTenant: process.env.CHROMACLOUD_TENANT,
ChromaCloudDatabase: process.env.CHROMACLOUD_DATABASE,

// Weaviate DB Keys
WeaviateEndpoint: process.env.WEAVIATE_ENDPOINT,
WeaviateApiKey: process.env.WEAVIATE_API_KEY,
Expand Down
5 changes: 4 additions & 1 deletion server/utils/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@

/**
* Gets the systems current vector database provider.
* @param {('pinecone' | 'chroma' | 'lancedb' | 'weaviate' | 'qdrant' | 'milvus' | 'zilliz' | 'astra') | null} getExactly - If provided, this will return an explit provider.
* @param {('pinecone' | 'chroma' | 'chromacloud' | 'lancedb' | 'weaviate' | 'qdrant' | 'milvus' | 'zilliz' | 'astra') | null} getExactly - If provided, this will return an explit provider.
* @returns { BaseVectorDatabaseProvider}
*/
function getVectorDbClass(getExactly = null) {
Expand All @@ -89,6 +89,9 @@ function getVectorDbClass(getExactly = null) {
case "chroma":
const { Chroma } = require("../vectorDbProviders/chroma");
return Chroma;
case "chromacloud":
const { ChromaCloud } = require("../vectorDbProviders/chromacloud");
return ChromaCloud;
case "lancedb":
const { LanceDb } = require("../vectorDbProviders/lance");
return LanceDb;
Expand Down
15 changes: 15 additions & 0 deletions server/utils/helpers/updateENV.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,20 @@ const KEY_MAPPING = {
checks: [],
},

// ChromaCloud Options
ChromaCloudApiKey: {
envKey: "CHROMACLOUD_API_KEY",
checks: [isNotEmpty],
},
ChromaCloudTenant: {
envKey: "CHROMACLOUD_TENANT",
checks: [isNotEmpty],
},
ChromaCloudDatabase: {
envKey: "CHROMACLOUD_DATABASE",
checks: [isNotEmpty],
},

// Weaviate Options
WeaviateEndpoint: {
envKey: "WEAVIATE_ENDPOINT",
Expand Down Expand Up @@ -845,6 +859,7 @@ function supportedEmbeddingModel(input = "") {
function supportedVectorDB(input = "") {
const supported = [
"chroma",
"chromacloud",
"pinecone",
"lancedb",
"weaviate",
Expand Down
29 changes: 29 additions & 0 deletions server/utils/vectorDbProviders/chromacloud/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const { CloudClient } = require("chromadb");
const { Chroma } = require("../chroma");

// ChromaCloud works exactly the same as Chroma so we can just extend the
// Chroma class and override the connect method to use CloudClient

const ChromaCloud = {
...Chroma,
name: "ChromaCloud",
connect: async function () {
if (process.env.VECTOR_DB !== "chromacloud")
throw new Error("ChromaCloud::Invalid ENV settings");

const client = new CloudClient({
apiKey: process.env.CHROMACLOUD_API_KEY,
tenant: process.env.CHROMACLOUD_TENANT,
database: process.env.CHROMACLOUD_DATABASE,
});

const isAlive = await client.heartbeat();
if (!isAlive)
throw new Error(
"ChromaCloud::Invalid Heartbeat received - is the instance online?"
);
return { client };
},
};

module.exports.ChromaCloud = ChromaCloud;