learngraph 0.2.0 → 0.3.0

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.
Files changed (58) hide show
  1. package/README.md +82 -1
  2. package/dist/cjs/llm/adapters/anthropic.js +124 -0
  3. package/dist/cjs/llm/adapters/anthropic.js.map +1 -0
  4. package/dist/cjs/llm/adapters/base.js +100 -0
  5. package/dist/cjs/llm/adapters/base.js.map +1 -0
  6. package/dist/cjs/llm/adapters/index.js +22 -0
  7. package/dist/cjs/llm/adapters/index.js.map +1 -0
  8. package/dist/cjs/llm/adapters/ollama.js +149 -0
  9. package/dist/cjs/llm/adapters/ollama.js.map +1 -0
  10. package/dist/cjs/llm/adapters/openai.js +126 -0
  11. package/dist/cjs/llm/adapters/openai.js.map +1 -0
  12. package/dist/cjs/llm/index.js +34 -5
  13. package/dist/cjs/llm/index.js.map +1 -1
  14. package/dist/cjs/llm/orchestrator.js +219 -0
  15. package/dist/cjs/llm/orchestrator.js.map +1 -0
  16. package/dist/cjs/llm/prompts.js +367 -0
  17. package/dist/cjs/llm/prompts.js.map +1 -0
  18. package/dist/cjs/types/llm.js +8 -0
  19. package/dist/cjs/types/llm.js.map +1 -0
  20. package/dist/esm/llm/adapters/anthropic.js +119 -0
  21. package/dist/esm/llm/adapters/anthropic.js.map +1 -0
  22. package/dist/esm/llm/adapters/base.js +95 -0
  23. package/dist/esm/llm/adapters/base.js.map +1 -0
  24. package/dist/esm/llm/adapters/index.js +10 -0
  25. package/dist/esm/llm/adapters/index.js.map +1 -0
  26. package/dist/esm/llm/adapters/ollama.js +144 -0
  27. package/dist/esm/llm/adapters/ollama.js.map +1 -0
  28. package/dist/esm/llm/adapters/openai.js +121 -0
  29. package/dist/esm/llm/adapters/openai.js.map +1 -0
  30. package/dist/esm/llm/index.js +12 -6
  31. package/dist/esm/llm/index.js.map +1 -1
  32. package/dist/esm/llm/orchestrator.js +214 -0
  33. package/dist/esm/llm/orchestrator.js.map +1 -0
  34. package/dist/esm/llm/prompts.js +360 -0
  35. package/dist/esm/llm/prompts.js.map +1 -0
  36. package/dist/esm/types/llm.js +7 -0
  37. package/dist/esm/types/llm.js.map +1 -0
  38. package/dist/types/llm/adapters/anthropic.d.ts +21 -0
  39. package/dist/types/llm/adapters/anthropic.d.ts.map +1 -0
  40. package/dist/types/llm/adapters/base.d.ts +46 -0
  41. package/dist/types/llm/adapters/base.d.ts.map +1 -0
  42. package/dist/types/llm/adapters/index.d.ts +11 -0
  43. package/dist/types/llm/adapters/index.d.ts.map +1 -0
  44. package/dist/types/llm/adapters/ollama.d.ts +30 -0
  45. package/dist/types/llm/adapters/ollama.d.ts.map +1 -0
  46. package/dist/types/llm/adapters/openai.d.ts +22 -0
  47. package/dist/types/llm/adapters/openai.d.ts.map +1 -0
  48. package/dist/types/llm/index.d.ts +5 -0
  49. package/dist/types/llm/index.d.ts.map +1 -1
  50. package/dist/types/llm/orchestrator.d.ts +35 -0
  51. package/dist/types/llm/orchestrator.d.ts.map +1 -0
  52. package/dist/types/llm/prompts.d.ts +269 -0
  53. package/dist/types/llm/prompts.d.ts.map +1 -0
  54. package/dist/types/types/index.d.ts +1 -0
  55. package/dist/types/types/index.d.ts.map +1 -1
  56. package/dist/types/types/llm.d.ts +298 -0
  57. package/dist/types/types/llm.d.ts.map +1 -0
  58. package/package.json +1 -1
@@ -4,9 +4,38 @@
4
4
  *
5
5
  * @packageDocumentation
6
6
  */
7
- // LLM integration will be implemented in Phase 4
8
- // export { LLMOrchestrator } from './orchestrator.js';
9
- // export { OpenAIAdapter } from './adapters/openai.js';
10
- // export { AnthropicAdapter } from './adapters/anthropic.js';
11
- // export { OllamaAdapter } from './adapters/ollama.js';
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.buildDecompositionPrompt = exports.buildBloomPrompt = exports.buildPrerequisitePrompt = exports.buildExtractionPrompt = exports.DECOMPOSITION_SCHEMA = exports.BLOOM_ANALYSIS_SCHEMA = exports.PREREQUISITE_SCHEMA = exports.EXTRACTION_SCHEMA = exports.SYSTEM_PROMPTS = exports.createOrchestrator = exports.LLMOrchestrator = exports.createOllamaAdapter = exports.OllamaAdapter = exports.createAnthropicAdapter = exports.AnthropicAdapter = exports.createOpenAIAdapter = exports.OpenAIAdapter = exports.DEFAULT_CONFIG = exports.LLMError = exports.BaseLLMAdapter = void 0;
9
+ // ─────────────────────────────────────────────────────────────────────────────
10
+ // Adapters
11
+ // ─────────────────────────────────────────────────────────────────────────────
12
+ var index_js_1 = require("./adapters/index.js");
13
+ Object.defineProperty(exports, "BaseLLMAdapter", { enumerable: true, get: function () { return index_js_1.BaseLLMAdapter; } });
14
+ Object.defineProperty(exports, "LLMError", { enumerable: true, get: function () { return index_js_1.LLMError; } });
15
+ Object.defineProperty(exports, "DEFAULT_CONFIG", { enumerable: true, get: function () { return index_js_1.DEFAULT_CONFIG; } });
16
+ Object.defineProperty(exports, "OpenAIAdapter", { enumerable: true, get: function () { return index_js_1.OpenAIAdapter; } });
17
+ Object.defineProperty(exports, "createOpenAIAdapter", { enumerable: true, get: function () { return index_js_1.createOpenAIAdapter; } });
18
+ Object.defineProperty(exports, "AnthropicAdapter", { enumerable: true, get: function () { return index_js_1.AnthropicAdapter; } });
19
+ Object.defineProperty(exports, "createAnthropicAdapter", { enumerable: true, get: function () { return index_js_1.createAnthropicAdapter; } });
20
+ Object.defineProperty(exports, "OllamaAdapter", { enumerable: true, get: function () { return index_js_1.OllamaAdapter; } });
21
+ Object.defineProperty(exports, "createOllamaAdapter", { enumerable: true, get: function () { return index_js_1.createOllamaAdapter; } });
22
+ // ─────────────────────────────────────────────────────────────────────────────
23
+ // Orchestrator
24
+ // ─────────────────────────────────────────────────────────────────────────────
25
+ var orchestrator_js_1 = require("./orchestrator.js");
26
+ Object.defineProperty(exports, "LLMOrchestrator", { enumerable: true, get: function () { return orchestrator_js_1.LLMOrchestrator; } });
27
+ Object.defineProperty(exports, "createOrchestrator", { enumerable: true, get: function () { return orchestrator_js_1.createOrchestrator; } });
28
+ // ─────────────────────────────────────────────────────────────────────────────
29
+ // Prompts
30
+ // ─────────────────────────────────────────────────────────────────────────────
31
+ var prompts_js_1 = require("./prompts.js");
32
+ Object.defineProperty(exports, "SYSTEM_PROMPTS", { enumerable: true, get: function () { return prompts_js_1.SYSTEM_PROMPTS; } });
33
+ Object.defineProperty(exports, "EXTRACTION_SCHEMA", { enumerable: true, get: function () { return prompts_js_1.EXTRACTION_SCHEMA; } });
34
+ Object.defineProperty(exports, "PREREQUISITE_SCHEMA", { enumerable: true, get: function () { return prompts_js_1.PREREQUISITE_SCHEMA; } });
35
+ Object.defineProperty(exports, "BLOOM_ANALYSIS_SCHEMA", { enumerable: true, get: function () { return prompts_js_1.BLOOM_ANALYSIS_SCHEMA; } });
36
+ Object.defineProperty(exports, "DECOMPOSITION_SCHEMA", { enumerable: true, get: function () { return prompts_js_1.DECOMPOSITION_SCHEMA; } });
37
+ Object.defineProperty(exports, "buildExtractionPrompt", { enumerable: true, get: function () { return prompts_js_1.buildExtractionPrompt; } });
38
+ Object.defineProperty(exports, "buildPrerequisitePrompt", { enumerable: true, get: function () { return prompts_js_1.buildPrerequisitePrompt; } });
39
+ Object.defineProperty(exports, "buildBloomPrompt", { enumerable: true, get: function () { return prompts_js_1.buildBloomPrompt; } });
40
+ Object.defineProperty(exports, "buildDecompositionPrompt", { enumerable: true, get: function () { return prompts_js_1.buildDecompositionPrompt; } });
12
41
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/llm/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,iDAAiD;AACjD,uDAAuD;AACvD,wDAAwD;AACxD,8DAA8D;AAC9D,wDAAwD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/llm/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AA6BH,gFAAgF;AAChF,WAAW;AACX,gFAAgF;AAChF,gDAU6B;AAT3B,0GAAA,cAAc,OAAA;AACd,oGAAA,QAAQ,OAAA;AACR,0GAAA,cAAc,OAAA;AACd,yGAAA,aAAa,OAAA;AACb,+GAAA,mBAAmB,OAAA;AACnB,4GAAA,gBAAgB,OAAA;AAChB,kHAAA,sBAAsB,OAAA;AACtB,yGAAA,aAAa,OAAA;AACb,+GAAA,mBAAmB,OAAA;AAIrB,gFAAgF;AAChF,eAAe;AACf,gFAAgF;AAChF,qDAAwE;AAA/D,kHAAA,eAAe,OAAA;AAAE,qHAAA,kBAAkB,OAAA;AAE5C,gFAAgF;AAChF,UAAU;AACV,gFAAgF;AAChF,2CAUsB;AATpB,4GAAA,cAAc,OAAA;AACd,+GAAA,iBAAiB,OAAA;AACjB,iHAAA,mBAAmB,OAAA;AACnB,mHAAA,qBAAqB,OAAA;AACrB,kHAAA,oBAAoB,OAAA;AACpB,mHAAA,qBAAqB,OAAA;AACrB,qHAAA,uBAAuB,OAAA;AACvB,8GAAA,gBAAgB,OAAA;AAChB,sHAAA,wBAAwB,OAAA"}
@@ -0,0 +1,219 @@
1
+ "use strict";
2
+ /**
3
+ * LLM orchestrator for educational tasks
4
+ *
5
+ * @packageDocumentation
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.LLMOrchestrator = void 0;
9
+ exports.createOrchestrator = createOrchestrator;
10
+ const skill_js_1 = require("../types/skill.js");
11
+ const prompts_js_1 = require("./prompts.js");
12
+ /** Default estimated minutes for skill mastery */
13
+ const DEFAULT_ESTIMATED_MINUTES = 30;
14
+ /**
15
+ * Difficulty mapping for Bloom's levels
16
+ */
17
+ const BLOOM_DIFFICULTY = {
18
+ remember: 0.2,
19
+ understand: 0.35,
20
+ apply: 0.5,
21
+ analyze: 0.65,
22
+ evaluate: 0.8,
23
+ create: 0.9,
24
+ };
25
+ /**
26
+ * High-level orchestrator for LLM-based educational tasks
27
+ */
28
+ class LLMOrchestrator {
29
+ adapter;
30
+ constructor(adapter) {
31
+ this.adapter = adapter;
32
+ }
33
+ getAdapter() {
34
+ return this.adapter;
35
+ }
36
+ /**
37
+ * Extract skills from curriculum content
38
+ */
39
+ async extractSkills(request) {
40
+ const startTime = Date.now();
41
+ // Build options object conditionally to avoid undefined values
42
+ const extractionOptions = {};
43
+ if (request.domain)
44
+ extractionOptions.domain = request.domain;
45
+ if (request.gradeLevel)
46
+ extractionOptions.gradeLevel = request.gradeLevel;
47
+ if (request.context)
48
+ extractionOptions.context = request.context;
49
+ const messages = [
50
+ { role: 'system', content: prompts_js_1.SYSTEM_PROMPTS.skillExtraction },
51
+ {
52
+ role: 'user',
53
+ content: (0, prompts_js_1.buildExtractionPrompt)(request.content, extractionOptions),
54
+ },
55
+ ];
56
+ const response = await this.adapter.complete({
57
+ messages,
58
+ responseFormat: 'json',
59
+ jsonSchema: prompts_js_1.EXTRACTION_SCHEMA,
60
+ });
61
+ const parsed = response.json;
62
+ // Apply filters and defaults
63
+ let skills = parsed.skills.map((skill) => ({
64
+ ...skill,
65
+ isThresholdConcept: skill.isThresholdConcept ?? false,
66
+ confidence: skill.confidence ?? 0.8,
67
+ }));
68
+ // Filter by minimum confidence
69
+ if (request.minConfidence) {
70
+ skills = skills.filter((s) => s.confidence >= request.minConfidence);
71
+ }
72
+ // Calculate overall confidence
73
+ const confidence = skills.length > 0 ? skills.reduce((acc, s) => acc + s.confidence, 0) / skills.length : 0;
74
+ return {
75
+ skills,
76
+ confidence,
77
+ usage: response.usage,
78
+ warnings: parsed.warnings ?? [],
79
+ durationMs: Date.now() - startTime,
80
+ };
81
+ }
82
+ /**
83
+ * Infer prerequisites between skills
84
+ */
85
+ async inferPrerequisites(request) {
86
+ const startTime = Date.now();
87
+ // Build options object conditionally to avoid undefined values
88
+ const prerequisiteOptions = {};
89
+ if (request.domain)
90
+ prerequisiteOptions.domain = request.domain;
91
+ if (request.inferTransitive !== undefined)
92
+ prerequisiteOptions.inferTransitive = request.inferTransitive;
93
+ const messages = [
94
+ { role: 'system', content: prompts_js_1.SYSTEM_PROMPTS.prerequisiteInference },
95
+ {
96
+ role: 'user',
97
+ content: (0, prompts_js_1.buildPrerequisitePrompt)(request.skills, prerequisiteOptions),
98
+ },
99
+ ];
100
+ const response = await this.adapter.complete({
101
+ messages,
102
+ responseFormat: 'json',
103
+ jsonSchema: prompts_js_1.PREREQUISITE_SCHEMA,
104
+ });
105
+ const parsed = response.json;
106
+ // Filter by minimum confidence
107
+ let prerequisites = parsed.prerequisites;
108
+ if (request.minConfidence) {
109
+ prerequisites = prerequisites.filter((p) => p.confidence >= request.minConfidence);
110
+ }
111
+ return {
112
+ prerequisites,
113
+ usage: response.usage,
114
+ durationMs: Date.now() - startTime,
115
+ };
116
+ }
117
+ /**
118
+ * Analyze Bloom's level of text
119
+ */
120
+ async analyzeBloomLevel(request) {
121
+ const messages = [
122
+ { role: 'system', content: prompts_js_1.SYSTEM_PROMPTS.bloomAnalysis },
123
+ { role: 'user', content: (0, prompts_js_1.buildBloomPrompt)(request.text, request.context) },
124
+ ];
125
+ const response = await this.adapter.complete({
126
+ messages,
127
+ responseFormat: 'json',
128
+ jsonSchema: prompts_js_1.BLOOM_ANALYSIS_SCHEMA,
129
+ });
130
+ const parsed = response.json;
131
+ return {
132
+ level: parsed.level,
133
+ confidence: parsed.confidence,
134
+ indicators: parsed.indicators,
135
+ reasoning: parsed.reasoning,
136
+ usage: response.usage,
137
+ };
138
+ }
139
+ /**
140
+ * Full curriculum decomposition into skill graph
141
+ */
142
+ async decompose(request) {
143
+ const startTime = Date.now();
144
+ // Build options object conditionally to avoid undefined values
145
+ const decompositionOptions = {};
146
+ if (request.title)
147
+ decompositionOptions.title = request.title;
148
+ if (request.domain)
149
+ decompositionOptions.domain = request.domain;
150
+ if (request.gradeLevel)
151
+ decompositionOptions.gradeLevel = request.gradeLevel;
152
+ if (request.context)
153
+ decompositionOptions.context = request.context;
154
+ if (request.maxDepth !== undefined)
155
+ decompositionOptions.maxDepth = request.maxDepth;
156
+ const messages = [
157
+ { role: 'system', content: prompts_js_1.SYSTEM_PROMPTS.curriculumDecomposition },
158
+ {
159
+ role: 'user',
160
+ content: (0, prompts_js_1.buildDecompositionPrompt)(request.content, decompositionOptions),
161
+ },
162
+ ];
163
+ const response = await this.adapter.complete({
164
+ messages,
165
+ responseFormat: 'json',
166
+ jsonSchema: prompts_js_1.DECOMPOSITION_SCHEMA,
167
+ maxTokens: 8192, // Decomposition can be verbose
168
+ });
169
+ const parsed = response.json;
170
+ // Convert extracted skills to SkillNodeInput format
171
+ const skillInputs = parsed.skills.map((skill) => ({
172
+ name: skill.name,
173
+ description: skill.description,
174
+ bloomLevel: skill.bloomLevel,
175
+ difficulty: skill.difficulty ?? BLOOM_DIFFICULTY[skill.bloomLevel] ?? 0.5,
176
+ isThresholdConcept: skill.isThresholdConcept ?? false,
177
+ masteryThreshold: skill.isThresholdConcept
178
+ ? skill_js_1.THRESHOLD_CONCEPT_MASTERY
179
+ : skill_js_1.SKILL_DEFAULTS.masteryThreshold,
180
+ estimatedMinutes: skill.estimatedMinutes ?? DEFAULT_ESTIMATED_MINUTES,
181
+ tags: skill.keywords ?? [],
182
+ metadata: {
183
+ llmExtracted: true,
184
+ llmId: skill.id,
185
+ confidence: skill.confidence ?? 0.8,
186
+ },
187
+ }));
188
+ // Convert prerequisites with confidence
189
+ const prerequisites = parsed.prerequisites.map((p) => ({
190
+ sourceId: p.sourceId,
191
+ targetId: p.targetId,
192
+ strength: p.strength,
193
+ type: p.type,
194
+ confidence: 0.8, // Default confidence for decomposition
195
+ reasoning: p.reasoning ?? 'Inferred from curriculum structure',
196
+ }));
197
+ return {
198
+ title: parsed.title || request.title || 'Untitled Curriculum',
199
+ skills: parsed.skills.map((s) => ({
200
+ ...s,
201
+ isThresholdConcept: s.isThresholdConcept ?? false,
202
+ confidence: s.confidence ?? 0.8,
203
+ })),
204
+ prerequisites,
205
+ skillInputs,
206
+ usage: response.usage,
207
+ durationMs: Date.now() - startTime,
208
+ warnings: parsed.warnings ?? [],
209
+ };
210
+ }
211
+ }
212
+ exports.LLMOrchestrator = LLMOrchestrator;
213
+ /**
214
+ * Create an orchestrator with a specific adapter
215
+ */
216
+ function createOrchestrator(adapter) {
217
+ return new LLMOrchestrator(adapter);
218
+ }
219
+ //# sourceMappingURL=orchestrator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestrator.js","sourceRoot":"","sources":["../../../src/llm/orchestrator.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAsRH,gDAEC;AArQD,gDAA8E;AAC9E,6CAUsB;AAEtB,kDAAkD;AAClD,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAErC;;GAEG;AACH,MAAM,gBAAgB,GAA+B;IACnD,QAAQ,EAAE,GAAG;IACb,UAAU,EAAE,IAAI;IAChB,KAAK,EAAE,GAAG;IACV,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,GAAG;CACZ,CAAC;AAEF;;GAEG;AACH,MAAa,eAAe;IACG;IAA7B,YAA6B,OAAmB;QAAnB,YAAO,GAAP,OAAO,CAAY;IAAG,CAAC;IAEpD,UAAU;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,aAAa,CAAC,OAA+B;QACjD,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE7B,+DAA+D;QAC/D,MAAM,iBAAiB,GAAgD,EAAE,CAAC;QAC1E,IAAI,OAAO,CAAC,MAAM;YAAE,iBAAiB,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC9D,IAAI,OAAO,CAAC,UAAU;YAAE,iBAAiB,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QAC1E,IAAI,OAAO,CAAC,OAAO;YAAE,iBAAiB,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAEjE,MAAM,QAAQ,GAAkB;YAC9B,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,2BAAc,CAAC,eAAe,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,CAAC;QAEJ,wCAAwC;QACxC,MAAM,aAAa,GAA2B,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC7E,QAAQ,EAAE,CAAC,CAAC,QAAQ;YACpB,QAAQ,EAAE,CAAC,CAAC,QAAQ;YACpB,QAAQ,EAAE,CAAC,CAAC,QAAQ;YACpB,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,UAAU,EAAE,GAAG,EAAE,uCAAuC;YACxD,SAAS,EAAE,CAAC,CAAC,SAAS,IAAI,oCAAoC;SAC/D,CAAC,CAAC,CAAC;QAEJ,OAAO;YACL,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,IAAI,qBAAqB;YAC7D,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBAChC,GAAG,CAAC;gBACJ,kBAAkB,EAAE,CAAC,CAAC,kBAAkB,IAAI,KAAK;gBACjD,UAAU,EAAE,CAAC,CAAC,UAAU,IAAI,GAAG;aAChC,CAAC,CAAC;YACH,aAAa;YACb,WAAW;YACX,KAAK,EAAE,QAAQ,CAAC,KAAK;YACrB,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;YAClC,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,EAAE;SAChC,CAAC;IACJ,CAAC;CACF;AA/ND,0CA+NC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAAC,OAAmB;IACpD,OAAO,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC"}
@@ -0,0 +1,367 @@
1
+ "use strict";
2
+ /**
3
+ * Prompts for LLM-based educational tasks
4
+ *
5
+ * @packageDocumentation
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.DECOMPOSITION_SCHEMA = exports.BLOOM_ANALYSIS_SCHEMA = exports.PREREQUISITE_SCHEMA = exports.EXTRACTION_SCHEMA = exports.SYSTEM_PROMPTS = void 0;
9
+ exports.buildExtractionPrompt = buildExtractionPrompt;
10
+ exports.buildPrerequisitePrompt = buildPrerequisitePrompt;
11
+ exports.buildBloomPrompt = buildBloomPrompt;
12
+ exports.buildDecompositionPrompt = buildDecompositionPrompt;
13
+ // ─────────────────────────────────────────────────────────────────────────────
14
+ // System Prompts
15
+ // ─────────────────────────────────────────────────────────────────────────────
16
+ exports.SYSTEM_PROMPTS = {
17
+ skillExtraction: `You are an expert educational curriculum analyst specializing in competency-based education and learning science.
18
+
19
+ Your task is to analyze curriculum content and extract discrete, measurable skills that learners should master.
20
+
21
+ For each skill you identify:
22
+ 1. Name: A concise, action-oriented name (e.g., "Calculate derivative of polynomial")
23
+ 2. Description: A clear explanation of what mastery of this skill looks like
24
+ 3. Bloom's Level: Classify using Bloom's Taxonomy (remember, understand, apply, analyze, evaluate, create)
25
+ 4. Difficulty: Estimate difficulty on a 0-1 scale based on cognitive complexity
26
+ 5. Threshold Concept: Identify if this is a transformative "gateway" skill that changes understanding
27
+ 6. Estimated Time: How long a typical learner needs to achieve mastery
28
+
29
+ Focus on:
30
+ - Observable, measurable outcomes
31
+ - Skills that can be assessed
32
+ - Appropriate granularity (not too broad, not too narrow)
33
+ - Clear prerequisite relationships
34
+
35
+ Bloom's Level Guidelines:
36
+ - remember (0.20): Recall facts, terms, basic concepts
37
+ - understand (0.35): Explain ideas, interpret, summarize
38
+ - apply (0.50): Use information in new situations, solve problems
39
+ - analyze (0.65): Draw connections, organize, compare, contrast
40
+ - evaluate (0.80): Justify decisions, make judgments, critique
41
+ - create (0.90): Produce new work, design, construct`,
42
+ prerequisiteInference: `You are an expert in learning science and curriculum design, specializing in prerequisite mapping and learning path optimization.
43
+
44
+ Your task is to analyze skills and infer prerequisite relationships between them.
45
+
46
+ For each prerequisite relationship:
47
+ 1. Identify which skill must be learned first (source/prerequisite)
48
+ 2. Identify which skill depends on it (target/dependent)
49
+ 3. Classify the relationship type:
50
+ - hard: Absolutely required - cannot learn target without source
51
+ - soft: Strongly beneficial but not strictly required
52
+ - recommended: Helpful for optimal learning path
53
+ 4. Estimate strength (0-1): How critical is this prerequisite?
54
+ 5. Provide clear reasoning for the relationship
55
+
56
+ Consider:
57
+ - Bloom's level progression (lower levels typically prerequisite to higher)
58
+ - Conceptual dependencies (foundational concepts before advanced)
59
+ - Skill hierarchies within domains
60
+ - Transfer of learning between related skills
61
+ - Avoid circular dependencies`,
62
+ bloomAnalysis: `You are an expert in Bloom's Taxonomy and educational assessment design.
63
+
64
+ Analyze the given text and determine its cognitive level according to Bloom's Taxonomy:
65
+
66
+ 1. remember - Recall facts and basic concepts
67
+ Verbs: define, identify, list, name, recall, recognize, state
68
+
69
+ 2. understand - Explain ideas or concepts
70
+ Verbs: describe, explain, interpret, summarize, classify, compare
71
+
72
+ 3. apply - Use information in new situations
73
+ Verbs: apply, calculate, solve, demonstrate, implement, use
74
+
75
+ 4. analyze - Draw connections among ideas
76
+ Verbs: analyze, compare, contrast, differentiate, examine, organize
77
+
78
+ 5. evaluate - Justify a decision or course of action
79
+ Verbs: evaluate, assess, critique, judge, justify, recommend
80
+
81
+ 6. create - Produce new or original work
82
+ Verbs: create, design, develop, construct, formulate, produce
83
+
84
+ Provide:
85
+ - The Bloom's level
86
+ - Confidence score (0-1)
87
+ - Key indicators (verbs/phrases) that led to this classification
88
+ - Brief reasoning`,
89
+ curriculumDecomposition: `You are an expert curriculum designer and learning scientist.
90
+
91
+ Your task is to decompose curriculum content into a structured skill graph suitable for adaptive learning systems.
92
+
93
+ Process:
94
+ 1. Identify the overall learning goals and outcomes
95
+ 2. Break down content into discrete, measurable skills
96
+ 3. Classify each skill by Bloom's level and difficulty
97
+ 4. Identify threshold concepts (transformative gateway skills)
98
+ 5. Map prerequisite relationships between skills
99
+ 6. Ensure appropriate granularity for personalized learning
100
+
101
+ Output a complete skill graph with:
102
+ - Skills: Name, description, Bloom's level, difficulty, estimated time
103
+ - Prerequisites: Source skill, target skill, type, strength, reasoning
104
+
105
+ Principles:
106
+ - Every skill should be assessable
107
+ - Skills should be at appropriate granularity (15-45 min to master)
108
+ - Clear progression from foundational to advanced
109
+ - Identify threshold concepts that unlock new understanding
110
+ - Consider both hard prerequisites (required) and soft (beneficial)`,
111
+ };
112
+ // ─────────────────────────────────────────────────────────────────────────────
113
+ // JSON Schemas for Structured Output
114
+ // ─────────────────────────────────────────────────────────────────────────────
115
+ exports.EXTRACTION_SCHEMA = {
116
+ type: 'object',
117
+ properties: {
118
+ skills: {
119
+ type: 'array',
120
+ items: {
121
+ type: 'object',
122
+ properties: {
123
+ name: { type: 'string', description: 'Concise, action-oriented skill name' },
124
+ description: { type: 'string', description: 'What mastery of this skill looks like' },
125
+ bloomLevel: {
126
+ type: 'string',
127
+ enum: ['remember', 'understand', 'apply', 'analyze', 'evaluate', 'create'],
128
+ description: "Bloom's Taxonomy level",
129
+ },
130
+ difficulty: {
131
+ type: 'number',
132
+ minimum: 0,
133
+ maximum: 1,
134
+ description: 'Difficulty on 0-1 scale',
135
+ },
136
+ confidence: {
137
+ type: 'number',
138
+ minimum: 0,
139
+ maximum: 1,
140
+ description: 'Confidence in this extraction',
141
+ },
142
+ isThresholdConcept: {
143
+ type: 'boolean',
144
+ description: 'Is this a transformative gateway skill?',
145
+ },
146
+ estimatedMinutes: {
147
+ type: 'number',
148
+ description: 'Estimated time to master in minutes',
149
+ },
150
+ keywords: {
151
+ type: 'array',
152
+ items: { type: 'string' },
153
+ description: 'Associated keywords/concepts',
154
+ },
155
+ reasoning: {
156
+ type: 'string',
157
+ description: 'Why this skill was extracted',
158
+ },
159
+ },
160
+ required: ['name', 'description', 'bloomLevel', 'difficulty', 'confidence'],
161
+ },
162
+ },
163
+ warnings: {
164
+ type: 'array',
165
+ items: { type: 'string' },
166
+ description: 'Any warnings or notes about the extraction',
167
+ },
168
+ },
169
+ required: ['skills'],
170
+ };
171
+ exports.PREREQUISITE_SCHEMA = {
172
+ type: 'object',
173
+ properties: {
174
+ prerequisites: {
175
+ type: 'array',
176
+ items: {
177
+ type: 'object',
178
+ properties: {
179
+ sourceId: { type: 'string', description: 'ID of the prerequisite skill' },
180
+ targetId: { type: 'string', description: 'ID of the dependent skill' },
181
+ strength: {
182
+ type: 'number',
183
+ minimum: 0,
184
+ maximum: 1,
185
+ description: 'How critical is this prerequisite (0-1)',
186
+ },
187
+ type: {
188
+ type: 'string',
189
+ enum: ['hard', 'soft', 'recommended'],
190
+ description: 'Type of prerequisite relationship',
191
+ },
192
+ confidence: {
193
+ type: 'number',
194
+ minimum: 0,
195
+ maximum: 1,
196
+ description: 'Confidence in this inference',
197
+ },
198
+ reasoning: {
199
+ type: 'string',
200
+ description: 'Why this prerequisite relationship exists',
201
+ },
202
+ },
203
+ required: ['sourceId', 'targetId', 'strength', 'type', 'confidence', 'reasoning'],
204
+ },
205
+ },
206
+ },
207
+ required: ['prerequisites'],
208
+ };
209
+ exports.BLOOM_ANALYSIS_SCHEMA = {
210
+ type: 'object',
211
+ properties: {
212
+ level: {
213
+ type: 'string',
214
+ enum: ['remember', 'understand', 'apply', 'analyze', 'evaluate', 'create'],
215
+ description: "Detected Bloom's level",
216
+ },
217
+ confidence: {
218
+ type: 'number',
219
+ minimum: 0,
220
+ maximum: 1,
221
+ description: 'Confidence in detection',
222
+ },
223
+ indicators: {
224
+ type: 'array',
225
+ items: { type: 'string' },
226
+ description: 'Key verbs/phrases indicating this level',
227
+ },
228
+ reasoning: {
229
+ type: 'string',
230
+ description: 'Explanation for the classification',
231
+ },
232
+ },
233
+ required: ['level', 'confidence', 'indicators', 'reasoning'],
234
+ };
235
+ exports.DECOMPOSITION_SCHEMA = {
236
+ type: 'object',
237
+ properties: {
238
+ title: { type: 'string', description: 'Course/curriculum title' },
239
+ skills: {
240
+ type: 'array',
241
+ items: {
242
+ type: 'object',
243
+ properties: {
244
+ id: { type: 'string', description: 'Unique skill identifier' },
245
+ name: { type: 'string' },
246
+ description: { type: 'string' },
247
+ bloomLevel: {
248
+ type: 'string',
249
+ enum: ['remember', 'understand', 'apply', 'analyze', 'evaluate', 'create'],
250
+ },
251
+ difficulty: { type: 'number', minimum: 0, maximum: 1 },
252
+ isThresholdConcept: { type: 'boolean' },
253
+ estimatedMinutes: { type: 'number' },
254
+ keywords: { type: 'array', items: { type: 'string' } },
255
+ },
256
+ required: ['id', 'name', 'description', 'bloomLevel', 'difficulty'],
257
+ },
258
+ },
259
+ prerequisites: {
260
+ type: 'array',
261
+ items: {
262
+ type: 'object',
263
+ properties: {
264
+ sourceId: { type: 'string' },
265
+ targetId: { type: 'string' },
266
+ strength: { type: 'number', minimum: 0, maximum: 1 },
267
+ type: { type: 'string', enum: ['hard', 'soft', 'recommended'] },
268
+ reasoning: { type: 'string' },
269
+ },
270
+ required: ['sourceId', 'targetId', 'strength', 'type'],
271
+ },
272
+ },
273
+ warnings: {
274
+ type: 'array',
275
+ items: { type: 'string' },
276
+ },
277
+ },
278
+ required: ['title', 'skills', 'prerequisites'],
279
+ };
280
+ // ─────────────────────────────────────────────────────────────────────────────
281
+ // Prompt Builders
282
+ // ─────────────────────────────────────────────────────────────────────────────
283
+ /**
284
+ * Build a skill extraction prompt
285
+ */
286
+ function buildExtractionPrompt(content, options) {
287
+ let prompt = `Analyze the following curriculum content and extract all discrete, measurable skills.\n\n`;
288
+ if (options?.domain) {
289
+ prompt += `Domain: ${options.domain}\n`;
290
+ }
291
+ if (options?.gradeLevel) {
292
+ prompt += `Target Audience: ${options.gradeLevel}\n`;
293
+ }
294
+ if (options?.context) {
295
+ prompt += `Additional Context: ${options.context}\n`;
296
+ }
297
+ prompt += `\n--- CURRICULUM CONTENT ---\n${content}\n--- END CONTENT ---\n\n`;
298
+ prompt += `Extract all skills from this content. For each skill, provide name, description, Bloom's level, difficulty (0-1), and identify if it's a threshold concept.`;
299
+ return prompt;
300
+ }
301
+ /**
302
+ * Build a prerequisite inference prompt
303
+ */
304
+ function buildPrerequisitePrompt(skills, options) {
305
+ let prompt = `Analyze the following skills and infer prerequisite relationships between them.\n\n`;
306
+ if (options?.domain) {
307
+ prompt += `Domain: ${options.domain}\n`;
308
+ }
309
+ prompt += `\n--- SKILLS ---\n`;
310
+ for (const skill of skills) {
311
+ prompt += `ID: ${skill.id}\n`;
312
+ prompt += `Name: ${skill.name}\n`;
313
+ prompt += `Description: ${skill.description}\n`;
314
+ prompt += `Bloom's Level: ${skill.bloomLevel}\n`;
315
+ prompt += `Difficulty: ${skill.difficulty}\n\n`;
316
+ }
317
+ prompt += `--- END SKILLS ---\n\n`;
318
+ prompt += `For each prerequisite relationship you identify:\n`;
319
+ prompt += `1. Specify sourceId (prerequisite) and targetId (dependent)\n`;
320
+ prompt += `2. Classify as hard, soft, or recommended\n`;
321
+ prompt += `3. Provide strength (0-1) and reasoning\n`;
322
+ if (options?.inferTransitive === false) {
323
+ prompt += `\nNote: Only infer direct prerequisites, not transitive ones.`;
324
+ }
325
+ return prompt;
326
+ }
327
+ /**
328
+ * Build a Bloom's analysis prompt
329
+ */
330
+ function buildBloomPrompt(text, context) {
331
+ let prompt = `Analyze the following text and determine its Bloom's Taxonomy level.\n\n`;
332
+ if (context) {
333
+ prompt += `Context: ${context}\n\n`;
334
+ }
335
+ prompt += `--- TEXT ---\n${text}\n--- END TEXT ---\n\n`;
336
+ prompt += `Classify this text according to Bloom's Taxonomy (remember, understand, apply, analyze, evaluate, create).`;
337
+ return prompt;
338
+ }
339
+ /**
340
+ * Build a curriculum decomposition prompt
341
+ */
342
+ function buildDecompositionPrompt(content, options) {
343
+ let prompt = `Decompose the following curriculum into a complete skill graph.\n\n`;
344
+ if (options?.title) {
345
+ prompt += `Course Title: ${options.title}\n`;
346
+ }
347
+ if (options?.domain) {
348
+ prompt += `Domain: ${options.domain}\n`;
349
+ }
350
+ if (options?.gradeLevel) {
351
+ prompt += `Target Audience: ${options.gradeLevel}\n`;
352
+ }
353
+ if (options?.context) {
354
+ prompt += `Additional Context: ${options.context}\n`;
355
+ }
356
+ if (options?.maxDepth) {
357
+ prompt += `Maximum Skill Hierarchy Depth: ${options.maxDepth}\n`;
358
+ }
359
+ prompt += `\n--- CURRICULUM CONTENT ---\n${content}\n--- END CONTENT ---\n\n`;
360
+ prompt += `Create a complete skill graph with:\n`;
361
+ prompt += `1. All discrete, measurable skills with unique IDs\n`;
362
+ prompt += `2. Bloom's level and difficulty for each skill\n`;
363
+ prompt += `3. Prerequisite relationships between skills\n`;
364
+ prompt += `4. Identify threshold concepts that unlock understanding\n`;
365
+ return prompt;
366
+ }
367
+ //# sourceMappingURL=prompts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/llm/prompts.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAgSH,sDAwBC;AAKD,0DAuCC;AAKD,4CAWC;AAKD,4DAoCC;AAzZD,gFAAgF;AAChF,iBAAiB;AACjB,gFAAgF;AAEnE,QAAA,cAAc,GAAG;IAC5B,eAAe,EAAE;;;;;;;;;;;;;;;;;;;;;;;;qDAwBkC;IAEnD,qBAAqB,EAAE;;;;;;;;;;;;;;;;;;;8BAmBK;IAE5B,aAAa,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;kBA0BC;IAEhB,uBAAuB,EAAE;;;;;;;;;;;;;;;;;;;;;oEAqByC;CACnE,CAAC;AAEF,gFAAgF;AAChF,qCAAqC;AACrC,gFAAgF;AAEnE,QAAA,iBAAiB,GAAG;IAC/B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,MAAM,EAAE;YACN,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qCAAqC,EAAE;oBAC5E,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uCAAuC,EAAE;oBACrF,UAAU,EAAE;wBACV,IAAI,EAAE,QAAQ;wBACd,IAAI,EA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