Template rejig (#48)

* document-rag / graph-rag refactor of templates

* Tweaking the docs and categories

* Clarify triple store vs RAG

* Tweak knowledge graph linkage

* Doc embedding for Qdrant

* Fix document RAG on Qdrant

* Fix templates

* Bump version

* Updated templates
This commit is contained in:
cybermaggedon 2024-09-03 00:09:15 +01:00 committed by GitHub
parent 121f7bb776
commit 208c219962
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
47 changed files with 1407 additions and 454 deletions

View file

@ -0,0 +1,38 @@
local base = import "base/base.jsonnet";
local images = import "values/images.jsonnet";
local url = import "values/url.jsonnet";
local prompts = import "prompt-template.jsonnet";
{
services +: {
"document-rag": base + {
image: images.trustgraph,
command: [
"document-rag",
"-p",
url.pulsar,
"--prompt-request-queue",
"non-persistent://tg/request/prompt-rag",
"--prompt-response-queue",
"non-persistent://tg/response/prompt-rag-response",
],
deploy: {
resources: {
limits: {
cpus: '0.5',
memory: '128M'
},
reservations: {
cpus: '0.1',
memory: '128M'
}
}
},
},
}
} + prompts

View file

@ -0,0 +1,40 @@
local base = import "base/base.jsonnet";
local images = import "values/images.jsonnet";
local url = import "values/url.jsonnet";
local prompts = import "prompt-template.jsonnet";
{
"embeddings-model":: "all-MiniLM-L6-v2",
services +: {
embeddings: base + {
image: images.trustgraph,
command: [
"embeddings-hf",
"-p",
url.pulsar,
"-m",
$["embeddings-model"],
],
deploy: {
resources: {
limits: {
cpus: '1.0',
memory: '256M'
},
reservations: {
cpus: '0.5',
memory: '256M'
}
}
},
},
}
} + prompts

View file

@ -0,0 +1,41 @@
local base = import "base/base.jsonnet";
local images = import "values/images.jsonnet";
local url = import "values/url.jsonnet";
local prompts = import "prompt-template.jsonnet";
{
"embeddings-model":: "mxbai-embed-large",
"ollama-url":: "${OLLAMA_HOST}",
services +: {
embeddings: base + {
image: images.trustgraph,
command: [
"embeddings-ollama",
"-p",
url.pulsar,
"-m",
$["embeddings-model"],
"-r",
$["ollama-url"],
],
deploy: {
resources: {
limits: {
cpus: '0.5',
memory: '128M'
},
reservations: {
cpus: '0.1',
memory: '128M'
}
}
},
},
}
} + prompts

View file

@ -0,0 +1,92 @@
local base = import "base/base.jsonnet";
local images = import "values/images.jsonnet";
local url = import "values/url.jsonnet";
local prompts = import "prompt-template.jsonnet";
{
"graph-rag-entity-limit":: 50,
"graph-rag-triple-limit":: 30,
"graph-rag-max-subgraph-size":: 3000,
services +: {
"kg-extract-definitions": base + {
image: images.trustgraph,
command: [
"kg-extract-definitions",
"-p",
url.pulsar,
],
deploy: {
resources: {
limits: {
cpus: '0.5',
memory: '128M'
},
reservations: {
cpus: '0.1',
memory: '128M'
}
}
},
},
"kg-extract-relationships": base + {
image: images.trustgraph,
command: [
"kg-extract-relationships",
"-p",
url.pulsar,
],
deploy: {
resources: {
limits: {
cpus: '0.5',
memory: '128M'
},
reservations: {
cpus: '0.1',
memory: '128M'
}
}
},
},
"graph-rag": base + {
image: images.trustgraph,
command: [
"graph-rag",
"-p",
url.pulsar,
"--prompt-request-queue",
"non-persistent://tg/request/prompt-rag",
"--prompt-response-queue",
"non-persistent://tg/response/prompt-rag-response",
"--entity-limit",
std.toString($["graph-rag-entity-limit"]),
"--triple-limit",
std.toString($["graph-rag-triple-limit"]),
"--max-subgraph-size",
std.toString($["graph-rag-max-subgraph-size"]),
],
deploy: {
resources: {
limits: {
cpus: '0.5',
memory: '128M'
},
reservations: {
cpus: '0.1',
memory: '128M'
}
}
},
},
}
} + prompts

View file

@ -53,10 +53,7 @@ milvus + {
},
},
/*
// Document embeddings writer & query service. Not currently enabled.
// Document embeddings writer & query service.
"store-doc-embeddings": base + {
image: images.trustgraph,
command: [
@ -103,8 +100,6 @@ milvus + {
},
},
*/
}
}

View file

@ -3,8 +3,11 @@ local images = import "values/images.jsonnet";
local url = import "values/url.jsonnet";
local prompts = import "prompts/slm.jsonnet";
{
"ollama-model":: "gemma2:9b",
"ollama-url":: "${OLLAMA_HOST}",
services +: {
"ollama-model":: "gemma2:9b",
"text-completion": base + {
image: images.trustgraph,
@ -15,7 +18,7 @@ local prompts = import "prompts/slm.jsonnet";
"-m",
$["ollama-model"],
"-r",
"${OLLAMA_HOST}",
$["ollama-url"],
],
deploy: {
resources: {
@ -40,7 +43,7 @@ local prompts = import "prompts/slm.jsonnet";
"-m",
$["ollama-model"],
"-r",
"${OLLAMA_HOST}",
$["ollama-url"],
"-i",
"non-persistent://tg/request/text-completion-rag",
"-o",

View file

@ -53,9 +53,7 @@ qdrant + {
},
},
/*
// Document embeddings writer & query service. Not currently enabled.
// Document embeddings writer & query service.
"store-doc-embeddings": base + {
image: images.trustgraph,
@ -103,8 +101,6 @@ qdrant + {
},
},
*/
}
}

View file

@ -7,10 +7,6 @@ local prompts = import "prompt-template.jsonnet";
"chunk-size":: 250,
"chunk-overlap":: 15,
"embeddings-model":: "all-MiniLM-L6-v2",
"graph-rag-entity-limit":: 50,
"graph-rag-triple-limit":: 30,
"graph-rag-max-subgraph-size":: 3000,
services +: {
@ -81,102 +77,6 @@ local prompts = import "prompt-template.jsonnet";
},
},
embeddings: base + {
image: images.trustgraph,
command: [
"embeddings-hf",
"-p",
url.pulsar,
"-m",
$["embeddings-model"],
],
deploy: {
resources: {
limits: {
cpus: '1.0',
memory: '256M'
},
reservations: {
cpus: '0.5',
memory: '256M'
}
}
},
},
"kg-extract-definitions": base + {
image: images.trustgraph,
command: [
"kg-extract-definitions",
"-p",
url.pulsar,
],
deploy: {
resources: {
limits: {
cpus: '0.5',
memory: '128M'
},
reservations: {
cpus: '0.1',
memory: '128M'
}
}
},
},
"kg-extract-relationships": base + {
image: images.trustgraph,
command: [
"kg-extract-relationships",
"-p",
url.pulsar,
],
deploy: {
resources: {
limits: {
cpus: '0.5',
memory: '128M'
},
reservations: {
cpus: '0.1',
memory: '128M'
}
}
},
},
"graph-rag": base + {
image: images.trustgraph,
command: [
"graph-rag",
"-p",
url.pulsar,
"--prompt-request-queue",
"non-persistent://tg/request/prompt-rag",
"--prompt-response-queue",
"non-persistent://tg/response/prompt-rag-response",
"--entity-limit",
std.toString($["graph-rag-entity-limit"]),
"--triple-limit",
std.toString($["graph-rag-triple-limit"]),
"--max-subgraph-size",
std.toString($["graph-rag-max-subgraph-size"]),
],
deploy: {
resources: {
limits: {
cpus: '0.5',
memory: '128M'
},
reservations: {
cpus: '0.1',
memory: '128M'
}
}
},
},
}
} + prompts