mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-26 00:46:22 +02:00
Feature/pinecone integration (#170)
* Added Pinecone for GE write & query * Add templates * Doc embedding support
This commit is contained in:
parent
ae1264f5c4
commit
319f9ac04a
17 changed files with 842 additions and 0 deletions
153
templates/components/pinecone.jsonnet
Normal file
153
templates/components/pinecone.jsonnet
Normal file
|
|
@ -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,
|
||||
])
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue