@forwardimpact/svcvector 0.1.112 → 0.1.113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -2
- package/server.js +26 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forwardimpact/svcvector",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.113",
|
|
4
4
|
"description": "Vector similarity search service for Guide",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "D. Olsson <hi@senzilla.io>",
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"@forwardimpact/libharness": "^0.1.5"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
|
-
"proto/"
|
|
30
|
+
"proto/",
|
|
31
|
+
"server.js"
|
|
31
32
|
],
|
|
32
33
|
"publishConfig": {
|
|
33
34
|
"access": "public"
|
package/server.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Server, createClient } from "@forwardimpact/librpc";
|
|
2
|
+
import { createServiceConfig } from "@forwardimpact/libconfig";
|
|
3
|
+
import { VectorIndex } from "@forwardimpact/libvector/index/vector.js";
|
|
4
|
+
import { createStorage } from "@forwardimpact/libstorage";
|
|
5
|
+
import { createTracer } from "@forwardimpact/librpc";
|
|
6
|
+
import { createLogger } from "@forwardimpact/libtelemetry";
|
|
7
|
+
|
|
8
|
+
import { VectorService } from "./index.js";
|
|
9
|
+
|
|
10
|
+
const config = await createServiceConfig("vector");
|
|
11
|
+
|
|
12
|
+
// Initialize observability
|
|
13
|
+
const logger = createLogger("vector");
|
|
14
|
+
const tracer = await createTracer("vector");
|
|
15
|
+
|
|
16
|
+
// Initialize LLM client
|
|
17
|
+
const llmClient = await createClient("llm", logger, tracer);
|
|
18
|
+
|
|
19
|
+
// Initialize vector index
|
|
20
|
+
const vectorStorage = createStorage("vectors");
|
|
21
|
+
const vectorIndex = new VectorIndex(vectorStorage);
|
|
22
|
+
|
|
23
|
+
const service = new VectorService(config, vectorIndex, llmClient);
|
|
24
|
+
const server = new Server(service, config, logger, tracer);
|
|
25
|
+
|
|
26
|
+
await server.start();
|