From 59164392beee3c50a662ed62f4f9fc52e8252bda Mon Sep 17 00:00:00 2001 From: cybermaggedon Date: Mon, 25 Nov 2024 08:14:15 +0000 Subject: [PATCH] Feature/pinecone support (#62) * Added pinecone option to vector stores * Pinecone UI elements * Addd 0.16.5 templates --- public/pinecone.svg | 1 + src/simple-editor/model-params/GraphStore.tsx | 1 + src/simple-editor/model-params/VectorDB.tsx | 57 +++++-- templates/components.jsonnet | 2 + templates/components/pinecone.jsonnet | 153 ++++++++++++++++++ 5 files changed, 202 insertions(+), 12 deletions(-) create mode 100644 public/pinecone.svg create mode 100644 templates/components/pinecone.jsonnet diff --git a/public/pinecone.svg b/public/pinecone.svg new file mode 100644 index 0000000..891b03f --- /dev/null +++ b/public/pinecone.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/simple-editor/model-params/GraphStore.tsx b/src/simple-editor/model-params/GraphStore.tsx index 2f64b55..2cdda5e 100644 --- a/src/simple-editor/model-params/GraphStore.tsx +++ b/src/simple-editor/model-params/GraphStore.tsx @@ -96,6 +96,7 @@ const GraphStore: React.FC = ({ value, onChange }) => { + diff --git a/src/simple-editor/model-params/VectorDB.tsx b/src/simple-editor/model-params/VectorDB.tsx index 8cfe4c9..957ca98 100644 --- a/src/simple-editor/model-params/VectorDB.tsx +++ b/src/simple-editor/model-params/VectorDB.tsx @@ -15,13 +15,14 @@ const VectorDB: React.FC = ({ value, onChange }) => { - Vector DB + Vector DB + + ); diff --git a/templates/components.jsonnet b/templates/components.jsonnet index ec7f862..26368de 100644 --- a/templates/components.jsonnet +++ b/templates/components.jsonnet @@ -25,6 +25,7 @@ "trustgraph-base": import "components/trustgraph.jsonnet", "vector-store-milvus": import "components/milvus.jsonnet", "vector-store-qdrant": import "components/qdrant.jsonnet", + "vector-store-pinecone": import "components/pinecone.jsonnet", "vertexai": import "components/vertexai.jsonnet", "null": {}, @@ -34,6 +35,7 @@ "cassandra": import "components/cassandra.jsonnet", "neo4j": import "components/neo4j.jsonnet", "qdrant": import "components/qdrant.jsonnet", + "pinecone": import "components/pinecone.jsonnet", "milvus": import "components/milvus.jsonnet", "trustgraph": import "components/trustgraph.jsonnet", diff --git a/templates/components/pinecone.jsonnet b/templates/components/pinecone.jsonnet new file mode 100644 index 0000000..3422952 --- /dev/null +++ b/templates/components/pinecone.jsonnet @@ -0,0 +1,153 @@ +local base = import "base/base.jsonnet"; +local images = import "values/images.jsonnet"; +local url = import "values/url.jsonnet"; +local cassandra_hosts = "cassandra"; + +{ + + "pinecone-cloud":: "aws", + "pinecone-region":: "us-east-1", + + "store-graph-embeddings" +: { + + create:: function(engine) + + local envSecrets = engine.envSecrets("pinecone-api-key") + .with_env_var("PINECONE_API_KEY", "pinecone-api-key"); + + local container = + engine.container("store-graph-embeddings") + .with_image(images.trustgraph) + .with_command([ + "ge-write-pinecone", + "-p", + url.pulsar, + ]) + .with_env_var_secrets(envSecrets) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "store-graph-embeddings", [ container ] + ); + + local service = + engine.internalService(containerSet) + .with_port(8080, 8080, "metrics"); + + engine.resources([ + envSecrets, + containerSet, + service, + ]) + + }, + + "query-graph-embeddings" +: { + + create:: function(engine) + + local envSecrets = engine.envSecrets("pinecone-api-key") + .with_env_var("PINECONE_API_KEY", "pinecone-api-key"); + + local container = + engine.container("query-graph-embeddings") + .with_image(images.trustgraph) + .with_command([ + "ge-query-pinecone", + "-p", + url.pulsar, + ]) + .with_env_var_secrets(envSecrets) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "query-graph-embeddings", [ container ] + ); + + local service = + engine.internalService(containerSet) + .with_port(8080, 8080, "metrics"); + + engine.resources([ + envSecrets, + containerSet, + service, + ]) + + }, + + "store-doc-embeddings" +: { + + create:: function(engine) + + local envSecrets = engine.envSecrets("pinecone-api-key") + .with_env_var("PINECONE_API_KEY", "pinecone-api-key"); + + local container = + engine.container("store-doc-embeddings") + .with_image(images.trustgraph) + .with_command([ + "de-write-pinecone", + "-p", + url.pulsar, + ]) + .with_env_var_secrets(envSecrets) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "store-doc-embeddings", [ container ] + ); + + local service = + engine.internalService(containerSet) + .with_port(8080, 8080, "metrics"); + + engine.resources([ + envSecrets, + containerSet, + service, + ]) + + }, + + "query-doc-embeddings" +: { + + create:: function(engine) + + local envSecrets = engine.envSecrets("pinecone-api-key") + .with_env_var("PINECONE_API_KEY", "pinecone-api-key"); + + local container = + engine.container("query-doc-embeddings") + .with_image(images.trustgraph) + .with_command([ + "de-query-pinecone", + "-p", + url.pulsar, + ]) + .with_env_var_secrets(envSecrets) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "query-doc-embeddings", [ container ] + ); + + local service = + engine.internalService(containerSet) + .with_port(8080, 8080, "metrics"); + + engine.resources([ + envSecrets, + containerSet, + service, + ]) + + + } + +} +