Skip to content

Commit

Permalink
Make LanceDB the vector database default provider in backend to preve…
Browse files Browse the repository at this point in the history
…nt issues where somehow this key is not set by the user resulting in a Pinecone error even though they never said they wanted Pinecone to be their vector db
  • Loading branch information
timothycarambat committed May 13, 2024
1 parent 790fd58 commit a87978d
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default function PrivacyAndDataHandling() {
function ThirdParty({ settings }) {
const llmChoice = settings?.LLMProvider || "openai";
const embeddingEngine = settings?.EmbeddingEngine || "openai";
const vectorDb = settings?.VectorDB || "pinecone";
const vectorDb = settings?.VectorDB || "lancedb";

return (
<div className="py-8 w-full flex items-start justify-center flex-col gap-y-6 border-b-2 border-white/10">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ export default function DataHandling({ setHeader, setForwardBtn, setBackBtn }) {
async function fetchKeys() {
const _settings = await System.keys();
setLLMChoice(_settings?.LLMProvider || "openai");
setVectorDb(_settings?.VectorDB || "pinecone");
setVectorDb(_settings?.VectorDB || "lancedb");
setEmbeddingEngine(_settings?.EmbeddingEngine || "openai");

setLoading(false);
Expand Down
6 changes: 3 additions & 3 deletions server/endpoints/api/workspace/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function apiWorkspaceEndpoints(app) {
multiUserMode: multiUserMode(response),
LLMSelection: process.env.LLM_PROVIDER || "openai",
Embedder: process.env.EMBEDDING_ENGINE || "inherit",
VectorDbSelection: process.env.VECTOR_DB || "pinecone",
VectorDbSelection: process.env.VECTOR_DB || "lancedb",
});
await EventLogs.logEvent("api_workspace_created", {
workspaceName: workspace?.name || "Unknown Workspace",
Expand Down Expand Up @@ -525,7 +525,7 @@ function apiWorkspaceEndpoints(app) {
await Telemetry.sendTelemetry("sent_chat", {
LLMSelection: process.env.LLM_PROVIDER || "openai",
Embedder: process.env.EMBEDDING_ENGINE || "inherit",
VectorDbSelection: process.env.VECTOR_DB || "pinecone",
VectorDbSelection: process.env.VECTOR_DB || "lancedb",
});
await EventLogs.logEvent("api_sent_chat", {
workspaceName: workspace?.name,
Expand Down Expand Up @@ -647,7 +647,7 @@ function apiWorkspaceEndpoints(app) {
await Telemetry.sendTelemetry("sent_chat", {
LLMSelection: process.env.LLM_PROVIDER || "openai",
Embedder: process.env.EMBEDDING_ENGINE || "inherit",
VectorDbSelection: process.env.VECTOR_DB || "pinecone",
VectorDbSelection: process.env.VECTOR_DB || "lancedb",
});
await EventLogs.logEvent("api_sent_chat", {
workspaceName: workspace?.name,
Expand Down
4 changes: 2 additions & 2 deletions server/endpoints/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function chatEndpoints(app) {
multiUserMode: multiUserMode(response),
LLMSelection: process.env.LLM_PROVIDER || "openai",
Embedder: process.env.EMBEDDING_ENGINE || "inherit",
VectorDbSelection: process.env.VECTOR_DB || "pinecone",
VectorDbSelection: process.env.VECTOR_DB || "lancedb",
});

await EventLogs.logEvent(
Expand Down Expand Up @@ -200,7 +200,7 @@ function chatEndpoints(app) {
multiUserMode: multiUserMode(response),
LLMSelection: process.env.LLM_PROVIDER || "openai",
Embedder: process.env.EMBEDDING_ENGINE || "inherit",
VectorDbSelection: process.env.VECTOR_DB || "pinecone",
VectorDbSelection: process.env.VECTOR_DB || "lancedb",
});

await EventLogs.logEvent(
Expand Down
2 changes: 1 addition & 1 deletion server/endpoints/embed/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function embeddedEndpoints(app) {
multiUserMode: multiUserMode(response),
LLMSelection: process.env.LLM_PROVIDER || "openai",
Embedder: process.env.EMBEDDING_ENGINE || "inherit",
VectorDbSelection: process.env.VECTOR_DB || "pinecone",
VectorDbSelection: process.env.VECTOR_DB || "lancedb",
});
response.end();
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion server/endpoints/workspaceThreads.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function workspaceThreadEndpoints(app) {
multiUserMode: multiUserMode(response),
LLMSelection: process.env.LLM_PROVIDER || "openai",
Embedder: process.env.EMBEDDING_ENGINE || "inherit",
VectorDbSelection: process.env.VECTOR_DB || "pinecone",
VectorDbSelection: process.env.VECTOR_DB || "lancedb",
},
user?.id
);
Expand Down
2 changes: 1 addition & 1 deletion server/endpoints/workspaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function workspaceEndpoints(app) {
multiUserMode: multiUserMode(response),
LLMSelection: process.env.LLM_PROVIDER || "openai",
Embedder: process.env.EMBEDDING_ENGINE || "inherit",
VectorDbSelection: process.env.VECTOR_DB || "pinecone",
VectorDbSelection: process.env.VECTOR_DB || "lancedb",
},
user?.id
);
Expand Down
4 changes: 2 additions & 2 deletions server/models/documents.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const Document = {
await Telemetry.sendTelemetry("documents_embedded_in_workspace", {
LLMSelection: process.env.LLM_PROVIDER || "openai",
Embedder: process.env.EMBEDDING_ENGINE || "inherit",
VectorDbSelection: process.env.VECTOR_DB || "pinecone",
VectorDbSelection: process.env.VECTOR_DB || "lancedb",
});
await EventLogs.logEvent(
"workspace_documents_added",
Expand Down Expand Up @@ -157,7 +157,7 @@ const Document = {
await Telemetry.sendTelemetry("documents_removed_in_workspace", {
LLMSelection: process.env.LLM_PROVIDER || "openai",
Embedder: process.env.EMBEDDING_ENGINE || "inherit",
VectorDbSelection: process.env.VECTOR_DB || "pinecone",
VectorDbSelection: process.env.VECTOR_DB || "lancedb",
});
await EventLogs.logEvent(
"workspace_documents_removed",
Expand Down
2 changes: 1 addition & 1 deletion server/utils/helpers/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function getVectorDbClass() {
const vectorSelection = process.env.VECTOR_DB || "pinecone";
const vectorSelection = process.env.VECTOR_DB || "lancedb";
switch (vectorSelection) {
case "pinecone":
const { Pinecone } = require("../vectorDbProviders/pinecone");
Expand Down

0 comments on commit a87978d

Please sign in to comment.