Skip to content

Commit

Permalink
Feature/pinecone support (#62)
Browse files Browse the repository at this point in the history
* Added pinecone option to vector stores
* Pinecone UI elements
* Addd 0.16.5 templates
  • Loading branch information
cybermaggedon authored Nov 25, 2024
1 parent a27a50d commit 5916439
Show file tree
Hide file tree
Showing 5 changed files with 202 additions and 12 deletions.
1 change: 1 addition & 0 deletions public/pinecone.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/simple-editor/model-params/GraphStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ const GraphStore: React.FC<GraphStoreProps> = ({ value, onChange }) => {
</MenuItem>

</Select>

</FormControl>

</>
Expand Down
57 changes: 45 additions & 12 deletions src/simple-editor/model-params/VectorDB.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ const VectorDB: React.FC<VectorDBProps> = ({ value, onChange }) => {

<FormControl fullWidth>

<InputLabel id="graph-store-label">Vector DB</InputLabel>
<InputLabel id="vector-db-label">Vector DB</InputLabel>


<Select
labelId="vector-db-label"
id="vector-db-select"
value={value}
label="Vector DB"
label="Vector store"
onChange={(e) => onChange(e.target.value)}
sx={{minHeight: 100}}
>
Expand All @@ -37,7 +38,9 @@ const VectorDB: React.FC<VectorDBProps> = ({ value, onChange }) => {
<Stack sx={{width: 100}} direction="column"
alignItems="center" justifyContent="center"
>
<img src="qdrant.png" width="80"/>

<img src="qdrant.png" width="90"/>

</Stack>

<Box sx={{
Expand All @@ -51,7 +54,7 @@ const VectorDB: React.FC<VectorDBProps> = ({ value, onChange }) => {
database with highest RPS, minimal
latency, fast indexing, high control
with accuracy, and so much more.

</Typography>
</Box>
</Stack>
Expand All @@ -65,10 +68,41 @@ const VectorDB: React.FC<VectorDBProps> = ({ value, onChange }) => {
flexItem
/>}>
<Stack sx={{width: 100}} direction="row"
alignItems="center" justifyContent="center"
alignItems="center" justifyContent="center"
>
<img src="milvus.svg" width="80"/>
</Stack>
<img src="milvus.svg" width="100"/>
</Stack>
<Box sx={{
width: '36rem'
}}>

<Typography variant="body2"
sx={{ whiteSpace: 'wrap' }}
>

Milvus is an open-source vector database
built for GenAI applications. Install with
pip, perform high-speed searches, and
scale to tens of billions of vectors with
minimal performance loss.

</Typography>
</Box>
</Stack>
</MenuItem>

<MenuItem value="pinecone">
<Stack
direction="row" spacing={2}
divider={
<Divider orientation="vertical"
flexItem
/>}>
<Stack sx={{width: 100}} direction="row"
alignItems="center" justifyContent="center"
>
<img src="pinecone.svg" width="80"/>
</Stack>
<Box sx={{
width: '36rem'
}}>
Expand All @@ -77,18 +111,17 @@ const VectorDB: React.FC<VectorDBProps> = ({ value, onChange }) => {
sx={{ whiteSpace: 'wrap' }}
>

Milvus is an open-source vector database
built for GenAI applications. Install with
pip, perform high-speed searches, and
scale to tens of billions of vectors with
minimal performance loss.
Pinecone offers a fully managed, serverless
vector database with an easy-to-use API.
Developer-friendly and fully scalable.

</Typography>
</Box>
</Stack>
</MenuItem>

</Select>

</FormControl>

);
Expand Down
2 changes: 2 additions & 0 deletions templates/components.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},

Expand All @@ -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",

Expand Down
153 changes: 153 additions & 0 deletions templates/components/pinecone.jsonnet
Original file line number Diff line number Diff line change
@@ -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,
])


}

}

0 comments on commit 5916439

Please sign in to comment.