@theromans/convex-dobty 0.1.2 → 0.1.4
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/dist/client/index.d.ts +28 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +21 -0
- package/dist/client/index.js.map +1 -1
- package/dist/component/_generated/api.d.ts +6 -0
- package/dist/component/_generated/api.d.ts.map +1 -1
- package/dist/component/_generated/api.js.map +1 -1
- package/dist/component/knowledge.d.ts +61 -0
- package/dist/component/knowledge.d.ts.map +1 -0
- package/dist/component/knowledge.js +96 -0
- package/dist/component/knowledge.js.map +1 -0
- package/dist/component/knowledgeSearch.d.ts +23 -0
- package/dist/component/knowledgeSearch.d.ts.map +1 -0
- package/dist/component/knowledgeSearch.js +81 -0
- package/dist/component/knowledgeSearch.js.map +1 -0
- package/dist/component/metrics.d.ts.map +1 -1
- package/dist/component/metrics.js +113 -28
- package/dist/component/metrics.js.map +1 -1
- package/dist/component/schema.d.ts +27 -0
- package/dist/component/schema.d.ts.map +1 -1
- package/dist/component/schema.js +17 -0
- package/dist/component/schema.js.map +1 -1
- package/package.json +1 -1
- package/src/client/index.ts +48 -0
- package/src/component/_generated/api.ts +6 -0
- package/src/component/knowledge.ts +112 -0
- package/src/component/knowledgeSearch.ts +115 -0
- package/src/component/metrics.ts +117 -28
- package/src/component/schema.ts +18 -0
package/dist/client/index.d.ts
CHANGED
|
@@ -10,10 +10,11 @@
|
|
|
10
10
|
* const dobt = new DobtAddon(components.dobtAddon);
|
|
11
11
|
* ```
|
|
12
12
|
*/
|
|
13
|
-
import type { GenericQueryCtx, GenericMutationCtx } from "convex/server";
|
|
13
|
+
import type { GenericQueryCtx, GenericMutationCtx, GenericActionCtx } from "convex/server";
|
|
14
14
|
type ComponentApi = any;
|
|
15
15
|
type QueryCtx = GenericQueryCtx<any>;
|
|
16
16
|
type MutationCtx = GenericMutationCtx<any>;
|
|
17
|
+
type ActionCtx = GenericActionCtx<any>;
|
|
17
18
|
export declare class DobtAddon {
|
|
18
19
|
component: ComponentApi;
|
|
19
20
|
constructor(component: ComponentApi);
|
|
@@ -282,6 +283,32 @@ export declare class DobtAddon {
|
|
|
282
283
|
workspaceId: string;
|
|
283
284
|
analysisId?: string;
|
|
284
285
|
}): Promise<any>;
|
|
286
|
+
/** Upsert knowledge chunks by topic + chunkKey */
|
|
287
|
+
seedKnowledgeChunks(ctx: MutationCtx, args: {
|
|
288
|
+
chunks: Array<{
|
|
289
|
+
topic: string;
|
|
290
|
+
chunkKey: string;
|
|
291
|
+
title: string;
|
|
292
|
+
content: string;
|
|
293
|
+
}>;
|
|
294
|
+
}): Promise<any>;
|
|
295
|
+
/** Vector search knowledge chunks */
|
|
296
|
+
searchKnowledge(ctx: ActionCtx, args: {
|
|
297
|
+
topic: string;
|
|
298
|
+
query: string;
|
|
299
|
+
limit?: number;
|
|
300
|
+
apiToken: string;
|
|
301
|
+
}): Promise<any>;
|
|
302
|
+
/** Re-embed stale knowledge chunks */
|
|
303
|
+
refreshEmbeddings(ctx: ActionCtx, args: {
|
|
304
|
+
apiToken: string;
|
|
305
|
+
}): Promise<any>;
|
|
306
|
+
/** List knowledge chunks by topic */
|
|
307
|
+
listKnowledgeChunks(ctx: QueryCtx, args: {
|
|
308
|
+
topic: string;
|
|
309
|
+
}): Promise<any>;
|
|
310
|
+
/** Return distinct topic strings from knowledge base */
|
|
311
|
+
listKnowledgeTopics(ctx: QueryCtx): Promise<any>;
|
|
285
312
|
}
|
|
286
313
|
export {};
|
|
287
314
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;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AE,KAAK,EAAE,MAAM,CAAA;KAAE;IAKzB,wDAAwD;IAClD,mBAAmB,CAAC,GAAG,EAAE,QAAQ;CAGxC"}
|
package/dist/client/index.js
CHANGED
|
@@ -211,5 +211,26 @@ export class DobtAddon {
|
|
|
211
211
|
async getPotentialAnalysisDashboard(ctx, args) {
|
|
212
212
|
return await ctx.runQuery(this.component.potentialAnalysis.getPotentialAnalysisDashboard, args);
|
|
213
213
|
}
|
|
214
|
+
// ── Knowledge Base ──
|
|
215
|
+
/** Upsert knowledge chunks by topic + chunkKey */
|
|
216
|
+
async seedKnowledgeChunks(ctx, args) {
|
|
217
|
+
return await ctx.runMutation(this.component.knowledge.seedKnowledgeChunks, args);
|
|
218
|
+
}
|
|
219
|
+
/** Vector search knowledge chunks */
|
|
220
|
+
async searchKnowledge(ctx, args) {
|
|
221
|
+
return await ctx.runAction(this.component.knowledgeSearch.searchKnowledge, args);
|
|
222
|
+
}
|
|
223
|
+
/** Re-embed stale knowledge chunks */
|
|
224
|
+
async refreshEmbeddings(ctx, args) {
|
|
225
|
+
return await ctx.runAction(this.component.knowledgeSearch.refreshEmbeddings, args);
|
|
226
|
+
}
|
|
227
|
+
/** List knowledge chunks by topic */
|
|
228
|
+
async listKnowledgeChunks(ctx, args) {
|
|
229
|
+
return await ctx.runQuery(this.component.knowledge.listChunks, args);
|
|
230
|
+
}
|
|
231
|
+
/** Return distinct topic strings from knowledge base */
|
|
232
|
+
async listKnowledgeTopics(ctx) {
|
|
233
|
+
return await ctx.runQuery(this.component.knowledge.listTopics, {});
|
|
234
|
+
}
|
|
214
235
|
}
|
|
215
236
|
//# sourceMappingURL=index.js.map
|
package/dist/client/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings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,GAAa;QACrC,OAAO,MAAM,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IACrE,CAAC;CACF"}
|
|
@@ -9,11 +9,17 @@
|
|
|
9
9
|
import type * as assessment from "../assessment.js";
|
|
10
10
|
import type * as scoring from "../scoring.js";
|
|
11
11
|
import type * as metrics from "../metrics.js";
|
|
12
|
+
import type * as potentialAnalysis from "../potentialAnalysis.js";
|
|
13
|
+
import type * as knowledge from "../knowledge.js";
|
|
14
|
+
import type * as knowledgeSearch from "../knowledgeSearch.js";
|
|
12
15
|
import type { ApiFromModules, FilterApi, FunctionReference } from "convex/server";
|
|
13
16
|
declare const fullApi: ApiFromModules<{
|
|
14
17
|
assessment: typeof assessment;
|
|
15
18
|
scoring: typeof scoring;
|
|
16
19
|
metrics: typeof metrics;
|
|
20
|
+
potentialAnalysis: typeof potentialAnalysis;
|
|
21
|
+
knowledge: typeof knowledge;
|
|
22
|
+
knowledgeSearch: typeof knowledgeSearch;
|
|
17
23
|
}>;
|
|
18
24
|
export type API = FilterApi<typeof fullApi, FunctionReference<any, "public">>;
|
|
19
25
|
export declare const api: API;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/api.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,UAAU,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,KAAK,OAAO,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,KAAK,OAAO,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/api.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,UAAU,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,KAAK,OAAO,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,KAAK,OAAO,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,KAAK,iBAAiB,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,KAAK,SAAS,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,KAAK,eAAe,MAAM,uBAAuB,CAAC;AAE9D,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,iBAAiB,EAClB,MAAM,eAAe,CAAC;AAGvB,QAAA,MAAM,OAAO,EAAE,cAAc,CAAC;IAC5B,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;IAC5C,SAAS,EAAE,OAAO,SAAS,CAAC;IAC5B,eAAe,EAAE,OAAO,eAAe,CAAC;CACzC,CAAiB,CAAC;AAEnB,MAAM,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,OAAO,EAAE,iBAAiB,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC9E,eAAO,MAAM,GAAG,EAAE,GAAmB,CAAC;AACtC,eAAO,MAAM,QAAQ,EAAE,SAAS,CAC9B,OAAO,OAAO,EACd,iBAAiB,CAAC,GAAG,EAAE,UAAU,CAAC,CACnB,CAAC;AAElB,eAAO,MAAM,UAAU,EAAqC,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/component/_generated/api.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/component/_generated/api.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;AAcH,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE1D,MAAM,OAAO,GAOR,MAAa,CAAC;AAGnB,MAAM,CAAC,MAAM,GAAG,GAAQ,MAAa,CAAC;AACtC,MAAM,CAAC,MAAM,QAAQ,GAGjB,MAAa,CAAC;AAElB,MAAM,CAAC,MAAM,UAAU,GAAG,iBAAiB,EAAmB,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/** Upsert knowledge chunks by topic + chunkKey. Only updates if content changed. */
|
|
2
|
+
export declare const seedKnowledgeChunks: import("convex/server").RegisteredMutation<"public", {
|
|
3
|
+
chunks: {
|
|
4
|
+
topic: string;
|
|
5
|
+
chunkKey: string;
|
|
6
|
+
title: string;
|
|
7
|
+
content: string;
|
|
8
|
+
}[];
|
|
9
|
+
}, Promise<{
|
|
10
|
+
inserted: number;
|
|
11
|
+
updated: number;
|
|
12
|
+
skipped: number;
|
|
13
|
+
}>>;
|
|
14
|
+
/** List chunks by topic. */
|
|
15
|
+
export declare const listChunks: import("convex/server").RegisteredQuery<"public", {
|
|
16
|
+
topic: string;
|
|
17
|
+
}, Promise<{
|
|
18
|
+
_id: import("convex/values").GenericId<"knowledgeChunks">;
|
|
19
|
+
_creationTime: number;
|
|
20
|
+
embedding?: number[] | undefined;
|
|
21
|
+
embeddedAt?: number | undefined;
|
|
22
|
+
topic: string;
|
|
23
|
+
updatedAt: number;
|
|
24
|
+
chunkKey: string;
|
|
25
|
+
title: string;
|
|
26
|
+
content: string;
|
|
27
|
+
}[]>>;
|
|
28
|
+
/** Return distinct topic strings. */
|
|
29
|
+
export declare const listTopics: import("convex/server").RegisteredQuery<"public", {}, Promise<string[]>>;
|
|
30
|
+
/** Patch embedding + embeddedAt for a single chunk. */
|
|
31
|
+
export declare const updateEmbedding: import("convex/server").RegisteredMutation<"internal", {
|
|
32
|
+
embedding: number[];
|
|
33
|
+
chunkId: import("convex/values").GenericId<"knowledgeChunks">;
|
|
34
|
+
}, Promise<void>>;
|
|
35
|
+
/** List all chunks across all topics. */
|
|
36
|
+
export declare const listAllChunks: import("convex/server").RegisteredQuery<"internal", {}, Promise<{
|
|
37
|
+
_id: import("convex/values").GenericId<"knowledgeChunks">;
|
|
38
|
+
_creationTime: number;
|
|
39
|
+
embedding?: number[] | undefined;
|
|
40
|
+
embeddedAt?: number | undefined;
|
|
41
|
+
topic: string;
|
|
42
|
+
updatedAt: number;
|
|
43
|
+
chunkKey: string;
|
|
44
|
+
title: string;
|
|
45
|
+
content: string;
|
|
46
|
+
}[]>>;
|
|
47
|
+
/** Get a single chunk by ID. */
|
|
48
|
+
export declare const getChunk: import("convex/server").RegisteredQuery<"internal", {
|
|
49
|
+
chunkId: import("convex/values").GenericId<"knowledgeChunks">;
|
|
50
|
+
}, Promise<{
|
|
51
|
+
_id: import("convex/values").GenericId<"knowledgeChunks">;
|
|
52
|
+
_creationTime: number;
|
|
53
|
+
embedding?: number[] | undefined;
|
|
54
|
+
embeddedAt?: number | undefined;
|
|
55
|
+
topic: string;
|
|
56
|
+
updatedAt: number;
|
|
57
|
+
chunkKey: string;
|
|
58
|
+
title: string;
|
|
59
|
+
content: string;
|
|
60
|
+
} | null>>;
|
|
61
|
+
//# sourceMappingURL=knowledge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge.d.ts","sourceRoot":"","sources":["../../src/component/knowledge.ts"],"names":[],"mappings":"AAQA,oFAAoF;AACpF,eAAO,MAAM,mBAAmB;;;;;;;;;;;GAiD9B,CAAC;AAEH,4BAA4B;AAC5B,eAAO,MAAM,UAAU;;;;;;;;;;;;KAQrB,CAAC;AAEH,qCAAqC;AACrC,eAAO,MAAM,UAAU,0EAOrB,CAAC;AAIH,uDAAuD;AACvD,eAAO,MAAM,eAAe;;;iBAW1B,CAAC;AAEH,yCAAyC;AACzC,eAAO,MAAM,aAAa;;;;;;;;;;KAKxB,CAAC;AAEH,gCAAgC;AAChC,eAAO,MAAM,QAAQ;;;;;;;;;;;;UAKnB,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { mutation, query, internalMutation, internalQuery, } from "./_generated/server.js";
|
|
2
|
+
import { v } from "convex/values";
|
|
3
|
+
/** Upsert knowledge chunks by topic + chunkKey. Only updates if content changed. */
|
|
4
|
+
export const seedKnowledgeChunks = mutation({
|
|
5
|
+
args: {
|
|
6
|
+
chunks: v.array(v.object({
|
|
7
|
+
topic: v.string(),
|
|
8
|
+
chunkKey: v.string(),
|
|
9
|
+
title: v.string(),
|
|
10
|
+
content: v.string(),
|
|
11
|
+
})),
|
|
12
|
+
},
|
|
13
|
+
handler: async (ctx, { chunks }) => {
|
|
14
|
+
let inserted = 0;
|
|
15
|
+
let updated = 0;
|
|
16
|
+
let skipped = 0;
|
|
17
|
+
for (const chunk of chunks) {
|
|
18
|
+
const existing = await ctx.db
|
|
19
|
+
.query("knowledgeChunks")
|
|
20
|
+
.withIndex("by_topic_chunkKey", (q) => q.eq("topic", chunk.topic).eq("chunkKey", chunk.chunkKey))
|
|
21
|
+
.unique();
|
|
22
|
+
if (existing) {
|
|
23
|
+
if (existing.content !== chunk.content || existing.title !== chunk.title) {
|
|
24
|
+
await ctx.db.patch(existing._id, {
|
|
25
|
+
title: chunk.title,
|
|
26
|
+
content: chunk.content,
|
|
27
|
+
updatedAt: Date.now(),
|
|
28
|
+
});
|
|
29
|
+
updated++;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
skipped++;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
await ctx.db.insert("knowledgeChunks", {
|
|
37
|
+
topic: chunk.topic,
|
|
38
|
+
chunkKey: chunk.chunkKey,
|
|
39
|
+
title: chunk.title,
|
|
40
|
+
content: chunk.content,
|
|
41
|
+
updatedAt: Date.now(),
|
|
42
|
+
});
|
|
43
|
+
inserted++;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return { inserted, updated, skipped };
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
/** List chunks by topic. */
|
|
50
|
+
export const listChunks = query({
|
|
51
|
+
args: { topic: v.string() },
|
|
52
|
+
handler: async (ctx, { topic }) => {
|
|
53
|
+
return await ctx.db
|
|
54
|
+
.query("knowledgeChunks")
|
|
55
|
+
.withIndex("by_topic", (q) => q.eq("topic", topic))
|
|
56
|
+
.collect();
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
/** Return distinct topic strings. */
|
|
60
|
+
export const listTopics = query({
|
|
61
|
+
args: {},
|
|
62
|
+
handler: async (ctx) => {
|
|
63
|
+
const all = await ctx.db.query("knowledgeChunks").collect();
|
|
64
|
+
const topics = new Set(all.map((c) => c.topic));
|
|
65
|
+
return [...topics];
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
// ── Internal functions (called by knowledgeSearch.ts) ──
|
|
69
|
+
/** Patch embedding + embeddedAt for a single chunk. */
|
|
70
|
+
export const updateEmbedding = internalMutation({
|
|
71
|
+
args: {
|
|
72
|
+
chunkId: v.id("knowledgeChunks"),
|
|
73
|
+
embedding: v.array(v.float64()),
|
|
74
|
+
},
|
|
75
|
+
handler: async (ctx, { chunkId, embedding }) => {
|
|
76
|
+
await ctx.db.patch(chunkId, {
|
|
77
|
+
embedding,
|
|
78
|
+
embeddedAt: Date.now(),
|
|
79
|
+
});
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
/** List all chunks across all topics. */
|
|
83
|
+
export const listAllChunks = internalQuery({
|
|
84
|
+
args: {},
|
|
85
|
+
handler: async (ctx) => {
|
|
86
|
+
return await ctx.db.query("knowledgeChunks").collect();
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
/** Get a single chunk by ID. */
|
|
90
|
+
export const getChunk = internalQuery({
|
|
91
|
+
args: { chunkId: v.id("knowledgeChunks") },
|
|
92
|
+
handler: async (ctx, { chunkId }) => {
|
|
93
|
+
return await ctx.db.get(chunkId);
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
//# sourceMappingURL=knowledge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge.js","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AC1C,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAClC,OAAO,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
interface KnowledgeResult {
|
|
2
|
+
title: string;
|
|
3
|
+
content: string;
|
|
4
|
+
score: number;
|
|
5
|
+
}
|
|
6
|
+
/** Search knowledge chunks by embedding similarity. */
|
|
7
|
+
export declare const searchKnowledge: import("convex/server").RegisteredAction<"public", {
|
|
8
|
+
limit?: number | undefined;
|
|
9
|
+
query: string;
|
|
10
|
+
topic: string;
|
|
11
|
+
apiToken: string;
|
|
12
|
+
}, Promise<KnowledgeResult[]>>;
|
|
13
|
+
/** Re-embed stale chunks (embedding missing or content changed since last embed). */
|
|
14
|
+
export declare const refreshEmbeddings: import("convex/server").RegisteredAction<"public", {
|
|
15
|
+
apiToken: string;
|
|
16
|
+
}, Promise<{
|
|
17
|
+
total: number;
|
|
18
|
+
stale: number;
|
|
19
|
+
embedded: number;
|
|
20
|
+
errors: number;
|
|
21
|
+
}>>;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=knowledgeSearch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledgeSearch.d.ts","sourceRoot":"","sources":["../../src/component/knowledgeSearch.ts"],"names":[],"mappings":"AAqCA,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,uDAAuD;AACvD,eAAO,MAAM,eAAe;;;;;8BA6B1B,CAAC;AAEH,qFAAqF;AACrF,eAAO,MAAM,iBAAiB;;;WAIyB,MAAM;WAAS,MAAM;cAAY,MAAM;YAAU,MAAM;GAkC5G,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use node";
|
|
2
|
+
import { action } from "./_generated/server.js";
|
|
3
|
+
import { internal } from "./_generated/api.js";
|
|
4
|
+
import { v } from "convex/values";
|
|
5
|
+
const EMBEDDING_ENDPOINT = "https://openai.inference.de-txl.ionos.com/v1/embeddings";
|
|
6
|
+
const EMBEDDING_MODEL = "BAAI/bge-m3";
|
|
7
|
+
const EMBEDDING_DIMENSIONS = 1024;
|
|
8
|
+
async function getEmbedding(text, apiToken) {
|
|
9
|
+
const response = await fetch(EMBEDDING_ENDPOINT, {
|
|
10
|
+
method: "POST",
|
|
11
|
+
headers: {
|
|
12
|
+
Authorization: `Bearer ${apiToken}`,
|
|
13
|
+
"Content-Type": "application/json",
|
|
14
|
+
},
|
|
15
|
+
body: JSON.stringify({
|
|
16
|
+
input: text,
|
|
17
|
+
model: EMBEDDING_MODEL,
|
|
18
|
+
dimensions: EMBEDDING_DIMENSIONS,
|
|
19
|
+
}),
|
|
20
|
+
});
|
|
21
|
+
if (!response.ok) {
|
|
22
|
+
const body = await response.text();
|
|
23
|
+
throw new Error(`Embedding API error ${response.status}: ${body}`);
|
|
24
|
+
}
|
|
25
|
+
const json = await response.json();
|
|
26
|
+
return json.data[0].embedding;
|
|
27
|
+
}
|
|
28
|
+
/** Search knowledge chunks by embedding similarity. */
|
|
29
|
+
export const searchKnowledge = action({
|
|
30
|
+
args: {
|
|
31
|
+
topic: v.string(),
|
|
32
|
+
query: v.string(),
|
|
33
|
+
limit: v.optional(v.number()),
|
|
34
|
+
apiToken: v.string(),
|
|
35
|
+
},
|
|
36
|
+
handler: async (ctx, { topic, query, limit = 3, apiToken }) => {
|
|
37
|
+
const embedding = await getEmbedding(query, apiToken);
|
|
38
|
+
const results = await ctx.vectorSearch("knowledgeChunks", "by_embedding", {
|
|
39
|
+
vector: embedding,
|
|
40
|
+
limit,
|
|
41
|
+
filter: (q) => q.eq("topic", topic),
|
|
42
|
+
});
|
|
43
|
+
if (results.length === 0)
|
|
44
|
+
return [];
|
|
45
|
+
const docs = await Promise.all(results.map(async (r) => {
|
|
46
|
+
const doc = await ctx.runQuery(internal.knowledge.getChunk, {
|
|
47
|
+
chunkId: r._id,
|
|
48
|
+
});
|
|
49
|
+
return doc ? { title: doc.title, content: doc.content, score: r._score } : null;
|
|
50
|
+
}));
|
|
51
|
+
return docs.filter((d) => d !== null);
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
/** Re-embed stale chunks (embedding missing or content changed since last embed). */
|
|
55
|
+
export const refreshEmbeddings = action({
|
|
56
|
+
args: {
|
|
57
|
+
apiToken: v.string(),
|
|
58
|
+
},
|
|
59
|
+
handler: async (ctx, { apiToken }) => {
|
|
60
|
+
const allChunks = await ctx.runQuery(internal.knowledge.listAllChunks, {});
|
|
61
|
+
const stale = allChunks.filter((c) => !c.embedding || !c.embeddedAt || c.embeddedAt < c.updatedAt);
|
|
62
|
+
let embedded = 0;
|
|
63
|
+
let errors = 0;
|
|
64
|
+
for (const chunk of stale) {
|
|
65
|
+
try {
|
|
66
|
+
const embedding = await getEmbedding(`${chunk.title}\n\n${chunk.content}`, apiToken);
|
|
67
|
+
await ctx.runMutation(internal.knowledge.updateEmbedding, {
|
|
68
|
+
chunkId: chunk._id,
|
|
69
|
+
embedding,
|
|
70
|
+
});
|
|
71
|
+
embedded++;
|
|
72
|
+
}
|
|
73
|
+
catch (e) {
|
|
74
|
+
console.error(`Failed to embed chunk ${chunk.chunkKey}: ${e.message}`);
|
|
75
|
+
errors++;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return { total: allChunks.length, stale: stale.length, embedded, errors };
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
//# sourceMappingURL=knowledgeSearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledgeSearch.js","sourceRoot":"","sources":["../../src/component/knowledgeSearch.ts"],"names":[],"mappings":"AAAA,UAAU,CAAC;AAEX,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,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BAyC0B,MAAM;gBAAU,MAAM;;;kBAS5B,MAAM;wBAAkB,MAAM;uBAAiB,MAAM;;;;;;;;;GA6BxG,CAAC;AAEH,oEAAoE;AACpE,eAAO,MAAM,YAAY;;;;;;;;;;;;;;KAmBvB,CAAC"}
|
|
@@ -119,41 +119,126 @@ export const getSystemPrompt = query({
|
|
|
119
119
|
handler: async (ctx, args) => {
|
|
120
120
|
const wt = args.workspaceType;
|
|
121
121
|
if (wt === "Project") {
|
|
122
|
-
return
|
|
123
|
-
You are assisting with a 5DoBT Potential Analysis. Guide the user through the 7-step process:
|
|
124
|
-
1. Project Charter — define goal, business case, scope
|
|
125
|
-
2. Definition of Done — target states with effect types
|
|
126
|
-
3. Influence Areas — identify relevant sub-areas from 5 DoBT dimensions
|
|
127
|
-
4. Points of Changes — concrete changes creating business value
|
|
128
|
-
5. Fields of Action — action measures with SP/NSP classification
|
|
129
|
-
6. Potential Status — validate, estimate, calculate potentials
|
|
130
|
-
7. Calculation Summary — financial evaluation with 3-year projection
|
|
131
|
-
|
|
132
|
-
Use the assessment tools to track progress and record findings.`;
|
|
122
|
+
return PA_SYSTEM_PROMPT;
|
|
133
123
|
}
|
|
134
124
|
// Excellence Rating mode (KM, EK, DM, Overview)
|
|
135
125
|
const domainLabel = wt === "Overview"
|
|
136
126
|
? "all domains (Kostenmanagement, Einkauf, Digitales Management)"
|
|
137
127
|
: wt === "KM" ? "Kostenmanagement" : wt === "EK" ? "Einkauf" : "Digitales Management";
|
|
138
|
-
return
|
|
139
|
-
You are conducting a DOBT+ Excellence Rating assessment for ${domainLabel}.
|
|
140
|
-
|
|
141
|
-
The assessment evaluates organizational maturity across methods, systems, guidelines, and expert dimensions on a 4-level scale:
|
|
142
|
-
- **Informativ (1)**: Basic awareness, ad-hoc processes
|
|
143
|
-
- **Steuernd (2)**: Controlled, repeatable processes with defined ownership
|
|
144
|
-
- **Integrativ (3)**: Integrated cross-functional processes, standardized practices
|
|
145
|
-
- **World Class (4)**: Optimized, continuously improving, industry-leading
|
|
146
|
-
|
|
147
|
-
### Your role:
|
|
148
|
-
- Use **getAssessmentStatus** to check current progress when asked
|
|
149
|
-
- Use **getNextQuestions** to identify priority questions to ask
|
|
150
|
-
- When the user provides information about methods, systems, or guidelines in use, use **submitAssessmentAnswer** to record it with an appropriate confidence score
|
|
151
|
-
- Use **getMetrics** to present dimension scores and maturity levels
|
|
152
|
-
- For method/system/guideline questions, gather the 5 sub-aspects: bekannt (known), in Anwendung (in use), definiert/dokumentiert (defined), verankert (anchored), Schulungen (training)
|
|
153
|
-
- Be proactive about gathering data during natural conversation but not overly pushy
|
|
154
|
-
- When presenting results, explain what each maturity level means in practical terms`;
|
|
128
|
+
return ER_SYSTEM_PROMPT.replace("{{DOMAIN_LABEL}}", domainLabel);
|
|
155
129
|
},
|
|
156
130
|
});
|
|
131
|
+
// ── System Prompt Constants ──
|
|
132
|
+
const ER_SYSTEM_PROMPT = `## DOBT+ Excellence Rating Assessment
|
|
133
|
+
|
|
134
|
+
You are a DOBT+ Excellence Rating consultant conducting a structured maturity assessment for {{DOMAIN_LABEL}}.
|
|
135
|
+
|
|
136
|
+
### Framework Overview
|
|
137
|
+
The Excellence Rating evaluates organizational maturity across 3 domains and 21 dimensions:
|
|
138
|
+
|
|
139
|
+
**Kostenmanagement (KM)** — 7 dimensions:
|
|
140
|
+
Reichweite, Richtlinien und Vorgaben, Informationsfluss, Systeme, Datenbasis, Methoden und Prozesse, Verwendung
|
|
141
|
+
|
|
142
|
+
**Einkauf (EK)** — 6 dimensions:
|
|
143
|
+
Reichweite, Richtlinien und Vorgaben, Informationsfluss, Systeme, Datenbasis, Methoden und Prozesse
|
|
144
|
+
|
|
145
|
+
**Digitales Management (DM)** — 8 dimensions:
|
|
146
|
+
Reichweite, Reaktionsverhalten, Kommunikation, Systeme, Datenqualität, Transparenz, Logik und Funktionalität, Komplexität
|
|
147
|
+
|
|
148
|
+
### 4-Level Maturity Scale
|
|
149
|
+
Each dimension is scored 1–4:
|
|
150
|
+
- **Informativ (1)**: Basic awareness, ad-hoc processes, no formal documentation. The organization knows these topics exist but handles them reactively.
|
|
151
|
+
- **Steuernd (2)**: Controlled and repeatable processes with defined ownership. Key activities are documented and assigned, but not yet cross-functional.
|
|
152
|
+
- **Integrativ (3)**: Integrated cross-functional processes with standardized practices. Systems and methods are connected across departments, enabling consistent reporting and decision-making.
|
|
153
|
+
- **World Class (4)**: Optimized and continuously improving, industry-leading. Best practices are embedded in culture, with automated monitoring, proactive optimization, and measurable business impact.
|
|
154
|
+
|
|
155
|
+
### Domain Focus Progressions
|
|
156
|
+
- **KM**: Cost transparency → cost steering → cost optimization → strategic cost leadership
|
|
157
|
+
- **EK**: Operational buying → managed procurement → strategic sourcing → value-chain integration
|
|
158
|
+
- **DM**: Data collection → structured reporting → integrated analytics → predictive/prescriptive management
|
|
159
|
+
|
|
160
|
+
### Assessment Workflow
|
|
161
|
+
1. **Check current state**: Use **getAssessmentStatus** to see which questions have been answered, current scores, and overall progress.
|
|
162
|
+
2. **Identify priorities**: Use **getNextQuestions** to find the highest-priority unanswered questions, focusing on dimensions with the biggest gaps or the most remaining questions.
|
|
163
|
+
3. **Ask high-impact questions**: Focus on one question at a time. Frame questions naturally and conversationally. When asking about methods, systems, or guidelines, probe the 5 sub-aspects:
|
|
164
|
+
- **bekannt** (known): Is the organization aware this method/system/guideline exists?
|
|
165
|
+
- **in Anwendung** (in use): Is it actively being used?
|
|
166
|
+
- **definiert/dokumentiert** (defined): Is it formally documented?
|
|
167
|
+
- **verankert** (anchored): Is it embedded in the organization's processes and culture?
|
|
168
|
+
- **Schulungen** (training): Are people trained on it?
|
|
169
|
+
4. **Extract and record**: When the user provides information, use **submitAssessmentAnswer** to record it with an appropriate confidence score.
|
|
170
|
+
5. **Monitor progress**: Periodically check progress with **getAssessmentStatus** and **getMetrics** to present dimension scores and maturity levels.
|
|
171
|
+
6. **Explain results**: When presenting results, explain what each maturity level means in practical terms for the user's organization.
|
|
172
|
+
|
|
173
|
+
### Confidence Scoring Guidelines
|
|
174
|
+
When recording answers with submitAssessmentAnswer, assign confidence based on evidence quality:
|
|
175
|
+
- **1.0**: User explicitly states a fact with specific details (e.g., "We use SAP with module XY")
|
|
176
|
+
- **0.8–0.9**: Clear, direct statement but less specific (e.g., "Yes, we have a system for that")
|
|
177
|
+
- **0.5–0.7**: Moderate inference from context — user implies something indirectly
|
|
178
|
+
- **0.3–0.4**: Low confidence — vague statement, uncertain phrasing, or conflicting information
|
|
179
|
+
- **< 0.3**: Do not submit — insufficient evidence. Ask a follow-up question instead.
|
|
180
|
+
|
|
181
|
+
Answers with confidence < 0.7 are automatically flagged for consultant review. When you submit a lower-confidence answer, mention this to the user ("I've noted that, though I'll flag it for the consultant to verify").
|
|
182
|
+
|
|
183
|
+
### Conversation Guidelines
|
|
184
|
+
- Ask **one question at a time** — don't overwhelm the user with multiple questions
|
|
185
|
+
- After covering a dimension well, briefly summarize the assessed level and what it means
|
|
186
|
+
- **Celebrate milestones**: When a domain reaches a significant completion point (e.g., 50%, 75%, done), acknowledge it
|
|
187
|
+
- Be proactive about gathering data during natural conversation, but not overly pushy
|
|
188
|
+
- If the user goes off-topic, gently steer back to the assessment
|
|
189
|
+
- When the user seems uncertain, offer examples of what each maturity level looks like for the current dimension`;
|
|
190
|
+
const PA_SYSTEM_PROMPT = `## DOBT+ 5DoBT Potential Analysis
|
|
191
|
+
|
|
192
|
+
You are a 5DoBT Potential Analysis consultant guiding the user through a structured potential analysis project.
|
|
193
|
+
|
|
194
|
+
### Framework Overview
|
|
195
|
+
The 5DoBT (5 Dimensions of Business Transformation) framework evaluates business transformation potential across 5 dimensions:
|
|
196
|
+
|
|
197
|
+
**Sales** — Revenue growth, market development, customer acquisition, pricing strategies
|
|
198
|
+
Sub-areas: Market positioning, Customer segmentation, Channel optimization, Pricing models, Sales processes
|
|
199
|
+
|
|
200
|
+
**Efficiency** — Operational effectiveness, process optimization, resource utilization
|
|
201
|
+
Sub-areas: Process standardization, Automation potential, Resource allocation, Capacity management, Workflow optimization
|
|
202
|
+
|
|
203
|
+
**Direct Cost** — Cost reduction, supplier management, material cost optimization
|
|
204
|
+
Sub-areas: Procurement optimization, Supplier consolidation, Make-or-buy decisions, Specification optimization, Volume bundling
|
|
205
|
+
|
|
206
|
+
**Innovation** — New products/services, business model innovation, digital transformation
|
|
207
|
+
Sub-areas: R&D pipeline, Technology adoption, Digital capabilities, Partnership models, Innovation culture
|
|
208
|
+
|
|
209
|
+
**Risk** — Risk mitigation, compliance, business continuity, market risk management
|
|
210
|
+
Sub-areas: Supply chain resilience, Regulatory compliance, Financial risk, Operational risk, Strategic risk
|
|
211
|
+
|
|
212
|
+
### 7-Step Process
|
|
213
|
+
Guide the user through these steps sequentially:
|
|
214
|
+
|
|
215
|
+
1. **Project Charter** — Define the project goal, business case, scope, and expected timeline. Establish stakeholders and success criteria.
|
|
216
|
+
2. **Definition of Done** — Define target states for each relevant dimension. Classify expected effects as quantitative (measurable savings/revenue) or qualitative (process improvement, risk reduction).
|
|
217
|
+
3. **Influence Areas** — Identify which of the 5 DoBT dimensions and their sub-areas are relevant to this project. Map organizational impact areas.
|
|
218
|
+
4. **Points of Changes** — Identify concrete changes that create business value. Each change should be specific, measurable, and linked to a dimension.
|
|
219
|
+
5. **Fields of Action** — Define action measures and classify each as:
|
|
220
|
+
- **SP (Savings Potential)**: Direct, measurable cost savings or revenue increases
|
|
221
|
+
- **NSP (Non-Savings Potential)**: Qualitative improvements, risk reductions, process optimizations that have indirect financial impact
|
|
222
|
+
6. **Potential Status** — Validate and estimate the financial potential of each action. Assign status (identified → validated → approved → realized) and calculate expected monetary impact.
|
|
223
|
+
7. **Calculation Summary** — Financial evaluation with per-dimension totals, SP/NSP split, and 3-year projection. Generate the final summary matrix.
|
|
224
|
+
|
|
225
|
+
### SP vs NSP Classification
|
|
226
|
+
- **SP (Savings Potential)**: Can be directly measured in EUR — cost reductions, price improvements, volume savings, revenue increases. These appear on the P&L.
|
|
227
|
+
- **NSP (Non-Savings Potential)**: Indirect value — process efficiency gains, risk mitigation, quality improvements, strategic positioning. Estimated monetary equivalent but not directly P&L-visible.
|
|
228
|
+
|
|
229
|
+
### Assessment Workflow
|
|
230
|
+
1. Determine which step the analysis is currently on using **getAssessmentStatus**
|
|
231
|
+
2. Guide the user through the current step's requirements
|
|
232
|
+
3. Use **submitAssessmentAnswer** to record findings, decisions, and data points as they are discussed
|
|
233
|
+
4. When the current step is complete, summarize findings and progress to the next step
|
|
234
|
+
5. Use **getMetrics** to present dimension-level summaries and overall progress
|
|
235
|
+
|
|
236
|
+
### Conversation Guidelines
|
|
237
|
+
- Focus on one step at a time — complete the current step before moving to the next
|
|
238
|
+
- For each Point of Change or Field of Action, help the user quantify the potential impact
|
|
239
|
+
- When classifying SP vs NSP, explain the distinction and help the user decide
|
|
240
|
+
- Present calculation summaries in clear tabular format when available
|
|
241
|
+
- Celebrate progress through the 7-step journey`;
|
|
157
242
|
// ── Snapshot Functions ──
|
|
158
243
|
/** Persist an immutable snapshot */
|
|
159
244
|
export const createSnapshot = internalMutation({
|