learngraph 0.7.0 → 0.9.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.
- package/dist/cjs/components/SkillGraph.js +224 -23
- package/dist/cjs/components/SkillGraph.js.map +1 -1
- package/dist/cjs/components/hooks.js +10 -0
- package/dist/cjs/components/hooks.js.map +1 -1
- package/dist/cjs/embeddings/base.js +104 -0
- package/dist/cjs/embeddings/base.js.map +1 -0
- package/dist/cjs/embeddings/index.js +91 -0
- package/dist/cjs/embeddings/index.js.map +1 -0
- package/dist/cjs/embeddings/local.js +224 -0
- package/dist/cjs/embeddings/local.js.map +1 -0
- package/dist/cjs/embeddings/openai.js +169 -0
- package/dist/cjs/embeddings/openai.js.map +1 -0
- package/dist/cjs/index.js +25 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/llm/graphrag-orchestrator.js +1004 -0
- package/dist/cjs/llm/graphrag-orchestrator.js.map +1 -0
- package/dist/cjs/llm/index.js +11 -1
- package/dist/cjs/llm/index.js.map +1 -1
- package/dist/cjs/llm/prompts.js +169 -1
- package/dist/cjs/llm/prompts.js.map +1 -1
- package/dist/cjs/storage/index.js +15 -1
- package/dist/cjs/storage/index.js.map +1 -1
- package/dist/cjs/storage/levelgraph.js +6 -3
- package/dist/cjs/storage/levelgraph.js.map +1 -1
- package/dist/cjs/storage/neo4j-graphrag.js +596 -0
- package/dist/cjs/storage/neo4j-graphrag.js.map +1 -0
- package/dist/cjs/types/graphrag.js +11 -0
- package/dist/cjs/types/graphrag.js.map +1 -0
- package/dist/cjs/types/index.js +7 -1
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/types/resource.js +151 -0
- package/dist/cjs/types/resource.js.map +1 -0
- package/dist/esm/components/SkillGraph.js +226 -25
- package/dist/esm/components/SkillGraph.js.map +1 -1
- package/dist/esm/components/hooks.js +10 -0
- package/dist/esm/components/hooks.js.map +1 -1
- package/dist/esm/embeddings/base.js +99 -0
- package/dist/esm/embeddings/base.js.map +1 -0
- package/dist/esm/embeddings/index.js +79 -0
- package/dist/esm/embeddings/index.js.map +1 -0
- package/dist/esm/embeddings/local.js +219 -0
- package/dist/esm/embeddings/local.js.map +1 -0
- package/dist/esm/embeddings/openai.js +164 -0
- package/dist/esm/embeddings/openai.js.map +1 -0
- package/dist/esm/index.js +16 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/llm/graphrag-orchestrator.js +999 -0
- package/dist/esm/llm/graphrag-orchestrator.js.map +1 -0
- package/dist/esm/llm/index.js +5 -1
- package/dist/esm/llm/index.js.map +1 -1
- package/dist/esm/llm/prompts.js +166 -0
- package/dist/esm/llm/prompts.js.map +1 -1
- package/dist/esm/storage/index.js +8 -0
- package/dist/esm/storage/index.js.map +1 -1
- package/dist/esm/storage/levelgraph.js +6 -3
- package/dist/esm/storage/levelgraph.js.map +1 -1
- package/dist/esm/storage/neo4j-graphrag.js +591 -0
- package/dist/esm/storage/neo4j-graphrag.js.map +1 -0
- package/dist/esm/types/graphrag.js +10 -0
- package/dist/esm/types/graphrag.js.map +1 -0
- package/dist/esm/types/index.js +1 -0
- package/dist/esm/types/index.js.map +1 -1
- package/dist/esm/types/resource.js +144 -0
- package/dist/esm/types/resource.js.map +1 -0
- package/dist/types/components/SkillGraph.d.ts.map +1 -1
- package/dist/types/components/hooks.d.ts.map +1 -1
- package/dist/types/embeddings/base.d.ts +51 -0
- package/dist/types/embeddings/base.d.ts.map +1 -0
- package/dist/types/embeddings/index.d.ts +48 -0
- package/dist/types/embeddings/index.d.ts.map +1 -0
- package/dist/types/embeddings/local.d.ts +82 -0
- package/dist/types/embeddings/local.d.ts.map +1 -0
- package/dist/types/embeddings/openai.d.ts +48 -0
- package/dist/types/embeddings/openai.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/llm/graphrag-orchestrator.d.ts +280 -0
- package/dist/types/llm/graphrag-orchestrator.d.ts.map +1 -0
- package/dist/types/llm/index.d.ts +3 -1
- package/dist/types/llm/index.d.ts.map +1 -1
- package/dist/types/llm/prompts.d.ts +134 -0
- package/dist/types/llm/prompts.d.ts.map +1 -1
- package/dist/types/mcp/tools.d.ts +6 -6
- package/dist/types/storage/index.d.ts +2 -0
- package/dist/types/storage/index.d.ts.map +1 -1
- package/dist/types/storage/levelgraph.d.ts.map +1 -1
- package/dist/types/storage/neo4j-graphrag.d.ts +106 -0
- package/dist/types/storage/neo4j-graphrag.d.ts.map +1 -0
- package/dist/types/types/graphrag.d.ts +335 -0
- package/dist/types/types/graphrag.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +3 -0
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/types/resource.d.ts +202 -0
- package/dist/types/types/resource.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GraphRAG Types
|
|
3
|
+
*
|
|
4
|
+
* Types for Graph-based Retrieval-Augmented Generation.
|
|
5
|
+
* Combines vector embeddings with graph traversal for semantic search.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
import type { SkillNode, SkillId } from './skill.js';
|
|
10
|
+
import type { PrerequisiteEdge } from './edge.js';
|
|
11
|
+
import type { GraphStorage } from './storage.js';
|
|
12
|
+
/**
|
|
13
|
+
* Supported embedding providers
|
|
14
|
+
*/
|
|
15
|
+
export type EmbeddingProvider = 'openai' | 'voyage' | 'cohere' | 'local';
|
|
16
|
+
/**
|
|
17
|
+
* Base configuration for embedding adapters
|
|
18
|
+
*/
|
|
19
|
+
export interface EmbeddingConfigBase {
|
|
20
|
+
provider: EmbeddingProvider;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* OpenAI embedding configuration
|
|
24
|
+
*/
|
|
25
|
+
export interface OpenAIEmbeddingConfig extends EmbeddingConfigBase {
|
|
26
|
+
provider: 'openai';
|
|
27
|
+
apiKey: string;
|
|
28
|
+
/** Model to use (default: 'text-embedding-3-small') */
|
|
29
|
+
model?: 'text-embedding-3-small' | 'text-embedding-3-large' | 'text-embedding-ada-002';
|
|
30
|
+
/** Dimensions for embedding (for text-embedding-3-* models) */
|
|
31
|
+
dimensions?: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Voyage AI embedding configuration
|
|
35
|
+
*/
|
|
36
|
+
export interface VoyageEmbeddingConfig extends EmbeddingConfigBase {
|
|
37
|
+
provider: 'voyage';
|
|
38
|
+
apiKey: string;
|
|
39
|
+
/** Model to use (default: 'voyage-2') */
|
|
40
|
+
model?: 'voyage-2' | 'voyage-large-2' | 'voyage-code-2';
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Cohere embedding configuration
|
|
44
|
+
*/
|
|
45
|
+
export interface CohereEmbeddingConfig extends EmbeddingConfigBase {
|
|
46
|
+
provider: 'cohere';
|
|
47
|
+
apiKey: string;
|
|
48
|
+
/** Model to use (default: 'embed-english-v3.0') */
|
|
49
|
+
model?: 'embed-english-v3.0' | 'embed-multilingual-v3.0' | 'embed-english-light-v3.0';
|
|
50
|
+
/** Input type for embeddings */
|
|
51
|
+
inputType?: 'search_document' | 'search_query' | 'classification' | 'clustering';
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Local embedding configuration (using transformers.js or similar)
|
|
55
|
+
*/
|
|
56
|
+
export interface LocalEmbeddingConfig extends EmbeddingConfigBase {
|
|
57
|
+
provider: 'local';
|
|
58
|
+
/** Model name for local embedding */
|
|
59
|
+
model?: string;
|
|
60
|
+
/** Path to local model files */
|
|
61
|
+
modelPath?: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Union of all embedding configurations
|
|
65
|
+
*/
|
|
66
|
+
export type EmbeddingConfig = OpenAIEmbeddingConfig | VoyageEmbeddingConfig | CohereEmbeddingConfig | LocalEmbeddingConfig;
|
|
67
|
+
/**
|
|
68
|
+
* Embedding vector result
|
|
69
|
+
*/
|
|
70
|
+
export interface EmbeddingResult {
|
|
71
|
+
/** The embedding vector */
|
|
72
|
+
vector: number[];
|
|
73
|
+
/** Dimensions of the vector */
|
|
74
|
+
dimensions: number;
|
|
75
|
+
/** Model used for embedding */
|
|
76
|
+
model: string;
|
|
77
|
+
/** Optional usage statistics */
|
|
78
|
+
usage?: {
|
|
79
|
+
promptTokens: number;
|
|
80
|
+
totalTokens: number;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Batch embedding result
|
|
85
|
+
*/
|
|
86
|
+
export interface BatchEmbeddingResult {
|
|
87
|
+
/** Array of embedding vectors */
|
|
88
|
+
embeddings: EmbeddingResult[];
|
|
89
|
+
/** Total tokens used */
|
|
90
|
+
totalTokens?: number;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Interface for embedding generation adapters
|
|
94
|
+
*/
|
|
95
|
+
export interface EmbeddingAdapter {
|
|
96
|
+
/** Provider name */
|
|
97
|
+
readonly provider: EmbeddingProvider;
|
|
98
|
+
/** Model identifier */
|
|
99
|
+
readonly model: string;
|
|
100
|
+
/** Vector dimensions */
|
|
101
|
+
readonly dimensions: number;
|
|
102
|
+
/**
|
|
103
|
+
* Generate embedding for a single text
|
|
104
|
+
*/
|
|
105
|
+
embed(text: string): Promise<EmbeddingResult>;
|
|
106
|
+
/**
|
|
107
|
+
* Generate embeddings for multiple texts
|
|
108
|
+
*/
|
|
109
|
+
embedBatch(texts: string[]): Promise<BatchEmbeddingResult>;
|
|
110
|
+
/**
|
|
111
|
+
* Check if the adapter is properly configured
|
|
112
|
+
*/
|
|
113
|
+
isConfigured(): boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Get current configuration (without sensitive data)
|
|
116
|
+
*/
|
|
117
|
+
getConfig(): Omit<EmbeddingConfig, 'apiKey'>;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Skill with its embedding vector
|
|
121
|
+
*/
|
|
122
|
+
export interface SkillWithEmbedding extends SkillNode {
|
|
123
|
+
/** The embedding vector */
|
|
124
|
+
embedding?: number[];
|
|
125
|
+
/** Text that was embedded (name + description) */
|
|
126
|
+
embeddedText?: string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Vector similarity metrics
|
|
130
|
+
*/
|
|
131
|
+
export type SimilarityMetric = 'cosine' | 'euclidean' | 'dotProduct';
|
|
132
|
+
/**
|
|
133
|
+
* Vector search result
|
|
134
|
+
*/
|
|
135
|
+
export interface VectorSearchResult {
|
|
136
|
+
/** The matching skill */
|
|
137
|
+
skill: SkillNode;
|
|
138
|
+
/** Similarity score (0-1 for cosine, varies for others) */
|
|
139
|
+
score: number;
|
|
140
|
+
/** The similarity metric used */
|
|
141
|
+
metric: SimilarityMetric;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Vector search options
|
|
145
|
+
*/
|
|
146
|
+
export interface VectorSearchOptions {
|
|
147
|
+
/** Maximum number of results (default: 10) */
|
|
148
|
+
limit?: number;
|
|
149
|
+
/** Minimum similarity score threshold (default: 0.5) */
|
|
150
|
+
minScore?: number;
|
|
151
|
+
/** Similarity metric to use (default: 'cosine') */
|
|
152
|
+
metric?: SimilarityMetric;
|
|
153
|
+
/** Filter by tags */
|
|
154
|
+
tags?: string[];
|
|
155
|
+
/** Filter by domain */
|
|
156
|
+
domain?: string;
|
|
157
|
+
/** Filter by Bloom level */
|
|
158
|
+
bloomLevel?: string;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* GraphRAG search result - combines vector similarity with graph context
|
|
162
|
+
*/
|
|
163
|
+
export interface GraphRAGSearchResult extends VectorSearchResult {
|
|
164
|
+
/** Direct prerequisites (graph context) */
|
|
165
|
+
prerequisites: SkillNode[];
|
|
166
|
+
/** Direct dependents (graph context) */
|
|
167
|
+
dependents: SkillNode[];
|
|
168
|
+
/** Related skills from graph traversal */
|
|
169
|
+
relatedSkills: SkillNode[];
|
|
170
|
+
/** Graph-based relevance boost (0-1) */
|
|
171
|
+
graphRelevance: number;
|
|
172
|
+
/** Combined score (vector + graph) */
|
|
173
|
+
combinedScore: number;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* GraphRAG search options
|
|
177
|
+
*/
|
|
178
|
+
export interface GraphRAGSearchOptions extends VectorSearchOptions {
|
|
179
|
+
/** Depth for graph traversal (default: 2) */
|
|
180
|
+
graphDepth?: number;
|
|
181
|
+
/** Weight for vector similarity in combined score (0-1, default: 0.7) */
|
|
182
|
+
vectorWeight?: number;
|
|
183
|
+
/** Include prerequisites in results */
|
|
184
|
+
includePrerequisites?: boolean;
|
|
185
|
+
/** Include dependents in results */
|
|
186
|
+
includeDependents?: boolean;
|
|
187
|
+
/** Include related skills from graph traversal */
|
|
188
|
+
includeRelated?: boolean;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Context window for RAG - skills + relationships
|
|
192
|
+
*/
|
|
193
|
+
export interface GraphRAGContext {
|
|
194
|
+
/** Primary matching skills */
|
|
195
|
+
primaryMatches: VectorSearchResult[];
|
|
196
|
+
/** Prerequisite skills for context */
|
|
197
|
+
prerequisites: SkillNode[];
|
|
198
|
+
/** Dependent skills for context */
|
|
199
|
+
dependents: SkillNode[];
|
|
200
|
+
/** Related skills via graph traversal */
|
|
201
|
+
related: SkillNode[];
|
|
202
|
+
/** Edges connecting context skills */
|
|
203
|
+
edges: PrerequisiteEdge[];
|
|
204
|
+
/** Formatted context string for LLM */
|
|
205
|
+
formattedContext: string;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Request for RAG-enhanced learning path generation
|
|
209
|
+
*/
|
|
210
|
+
export interface LearningPathRAGRequest {
|
|
211
|
+
/** Natural language goal description */
|
|
212
|
+
goal: string;
|
|
213
|
+
/** Current skill mastery states (skillId -> mastery 0-1) */
|
|
214
|
+
currentMastery?: Map<SkillId, number>;
|
|
215
|
+
/** Maximum path length */
|
|
216
|
+
maxSteps?: number;
|
|
217
|
+
/** Preferred learning style hints */
|
|
218
|
+
preferences?: {
|
|
219
|
+
/** Prefer practical (procedural) or theoretical (conceptual) skills */
|
|
220
|
+
style?: 'practical' | 'theoretical' | 'balanced';
|
|
221
|
+
/** Difficulty preference */
|
|
222
|
+
difficulty?: 'gradual' | 'challenging';
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* RAG-enhanced learning path result
|
|
227
|
+
*/
|
|
228
|
+
export interface LearningPathRAGResult {
|
|
229
|
+
/** Ordered list of skills to learn */
|
|
230
|
+
path: SkillNode[];
|
|
231
|
+
/** Edges connecting path skills */
|
|
232
|
+
edges: PrerequisiteEdge[];
|
|
233
|
+
/** Estimated total time (minutes) */
|
|
234
|
+
estimatedMinutes: number;
|
|
235
|
+
/** Explanation of why this path was chosen */
|
|
236
|
+
reasoning: string;
|
|
237
|
+
/** Alternative paths (if any) */
|
|
238
|
+
alternatives?: Array<{
|
|
239
|
+
path: SkillNode[];
|
|
240
|
+
reasoning: string;
|
|
241
|
+
}>;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Extended storage interface with GraphRAG capabilities
|
|
245
|
+
*/
|
|
246
|
+
export interface GraphRAGStorage extends GraphStorage {
|
|
247
|
+
/**
|
|
248
|
+
* Set the embedding adapter for vector operations
|
|
249
|
+
*/
|
|
250
|
+
setEmbeddingAdapter(adapter: EmbeddingAdapter): void;
|
|
251
|
+
/**
|
|
252
|
+
* Get the current embedding adapter
|
|
253
|
+
*/
|
|
254
|
+
getEmbeddingAdapter(): EmbeddingAdapter | null;
|
|
255
|
+
/**
|
|
256
|
+
* Generate and store embedding for a skill
|
|
257
|
+
*/
|
|
258
|
+
embedSkill(skillId: SkillId): Promise<void>;
|
|
259
|
+
/**
|
|
260
|
+
* Generate and store embeddings for all skills
|
|
261
|
+
*/
|
|
262
|
+
embedAllSkills(options?: {
|
|
263
|
+
batchSize?: number;
|
|
264
|
+
onProgress?: (completed: number, total: number) => void;
|
|
265
|
+
}): Promise<{
|
|
266
|
+
embedded: number;
|
|
267
|
+
failed: number;
|
|
268
|
+
}>;
|
|
269
|
+
/**
|
|
270
|
+
* Check if a skill has an embedding
|
|
271
|
+
*/
|
|
272
|
+
hasEmbedding(skillId: SkillId): Promise<boolean>;
|
|
273
|
+
/**
|
|
274
|
+
* Get skill with its embedding
|
|
275
|
+
*/
|
|
276
|
+
getSkillWithEmbedding(skillId: SkillId): Promise<SkillWithEmbedding | null>;
|
|
277
|
+
/**
|
|
278
|
+
* Search skills by semantic similarity
|
|
279
|
+
*/
|
|
280
|
+
searchByVector(query: string, options?: VectorSearchOptions): Promise<VectorSearchResult[]>;
|
|
281
|
+
/**
|
|
282
|
+
* Search skills using vector query (pre-computed embedding)
|
|
283
|
+
*/
|
|
284
|
+
searchByEmbedding(embedding: number[], options?: VectorSearchOptions): Promise<VectorSearchResult[]>;
|
|
285
|
+
/**
|
|
286
|
+
* Find similar skills to a given skill
|
|
287
|
+
*/
|
|
288
|
+
findSimilarSkills(skillId: SkillId, options?: VectorSearchOptions): Promise<VectorSearchResult[]>;
|
|
289
|
+
/**
|
|
290
|
+
* Search with combined vector + graph context
|
|
291
|
+
*/
|
|
292
|
+
searchWithGraphContext(query: string, options?: GraphRAGSearchOptions): Promise<GraphRAGSearchResult[]>;
|
|
293
|
+
/**
|
|
294
|
+
* Build RAG context for a query
|
|
295
|
+
*/
|
|
296
|
+
buildRAGContext(query: string, options?: GraphRAGSearchOptions): Promise<GraphRAGContext>;
|
|
297
|
+
/**
|
|
298
|
+
* Generate learning path using RAG
|
|
299
|
+
*/
|
|
300
|
+
generateLearningPathRAG(request: LearningPathRAGRequest): Promise<LearningPathRAGResult>;
|
|
301
|
+
/**
|
|
302
|
+
* Create vector index (if not exists)
|
|
303
|
+
*/
|
|
304
|
+
createVectorIndex(options?: {
|
|
305
|
+
dimensions?: number;
|
|
306
|
+
metric?: SimilarityMetric;
|
|
307
|
+
}): Promise<void>;
|
|
308
|
+
/**
|
|
309
|
+
* Drop vector index
|
|
310
|
+
*/
|
|
311
|
+
dropVectorIndex(): Promise<void>;
|
|
312
|
+
/**
|
|
313
|
+
* Check if vector index exists
|
|
314
|
+
*/
|
|
315
|
+
hasVectorIndex(): Promise<boolean>;
|
|
316
|
+
/**
|
|
317
|
+
* Get vector index statistics
|
|
318
|
+
*/
|
|
319
|
+
getVectorIndexStats(): Promise<{
|
|
320
|
+
exists: boolean;
|
|
321
|
+
dimensions?: number;
|
|
322
|
+
metric?: SimilarityMetric;
|
|
323
|
+
indexedCount: number;
|
|
324
|
+
totalSkills: number;
|
|
325
|
+
}>;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Factory function type for creating embedding adapters
|
|
329
|
+
*/
|
|
330
|
+
export type EmbeddingAdapterFactory = (config: EmbeddingConfig) => EmbeddingAdapter;
|
|
331
|
+
/**
|
|
332
|
+
* Factory function type for creating GraphRAG storage
|
|
333
|
+
*/
|
|
334
|
+
export type GraphRAGStorageFactory = (baseStorage: GraphStorage, embeddingAdapter: EmbeddingAdapter) => GraphRAGStorage;
|
|
335
|
+
//# sourceMappingURL=graphrag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphrag.d.ts","sourceRoot":"","sources":["../../../src/types/graphrag.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAMjD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,iBAAiB,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ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e,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjC;;OAEG;IACH,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAEnC;;OAEG;IACH,mBAAmB,IAAI,OAAO,CAAC;QAC7B,MAAM,EAAE,OAAO,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,gBAAgB,CAAC;QAC1B,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC,CAAC;CACJ;AAMD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,MAAM,EAAE,eAAe,KAAK,gBAAgB,CAAC;AAEpF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,CACnC,WAAW,EAAE,YAAY,EACzB,gBAAgB,EAAE,gBAAgB,KAC/B,eAAe,CAAC"}
|
|
@@ -19,4 +19,7 @@ export type { ParseFormat, DocumentMetadata, LearningObjective, Topic, Module, P
|
|
|
19
19
|
export type { LLMProvider, LLMConfig, OpenAIConfig, AnthropicConfig, OllamaConfig, MessageRole, ChatMessage, CompletionRequest, CompletionResponse, SkillExtractionRequest, ExtractedSkillLLM, SkillExtractionResponse, PrerequisiteInferenceRequest, InferredPrerequisite, PrerequisiteInferenceResponse, BloomAnalysisRequest, BloomAnalysisResponse, DecompositionRequest, DecompositionResponse, LLMAdapter, LLMOrchestrator, } from './llm.js';
|
|
20
20
|
export type { QuestionId, QuestionType, AnswerOption, MatchingPair, Question, QuestionInput, AssessmentId, AssessmentType, SelectionStrategy, TerminationCriteria, Assessment, AssessmentInput, ResponseId, LearnerResponse, AssessmentSession, IRTModel, IRTParameters, IRTAbilityEstimate, IRTConfig, BKTParameters, BKTState, BKTConfig, EvidenceSource, LearningEvidence, EvidenceSummary, ItemSelection, AdaptiveState, AdaptiveConfig, AssessmentResult, DifficultyAdjustment, AssessmentValidation, } from './assessment.js';
|
|
21
21
|
export { createQuestionId, createAssessmentId, createResponseId, BKT_DEFAULTS, } from './assessment.js';
|
|
22
|
+
export type { ResourceId, ResourceType, Resource, ResourceInput, TeachesEdge, ResourceReference, DeepResourceAnalysis, ExtractionMode, ExtractionModeConfig, } from './resource.js';
|
|
23
|
+
export { createResourceId, EXTRACTION_MODES, detectResourceType, getResourceTypeIcon, getResourceTypeColor, } from './resource.js';
|
|
24
|
+
export type { EmbeddingProvider, EmbeddingConfigBase, OpenAIEmbeddingConfig, VoyageEmbeddingConfig, CohereEmbeddingConfig, LocalEmbeddingConfig, EmbeddingConfig, EmbeddingResult, BatchEmbeddingResult, EmbeddingAdapter, SkillWithEmbedding, SimilarityMetric, VectorSearchResult, VectorSearchOptions, GraphRAGSearchResult, GraphRAGSearchOptions, GraphRAGContext, LearningPathRAGRequest, LearningPathRAGResult, GraphRAGStorage, EmbeddingAdapterFactory, GraphRAGStorageFactory, } from './graphrag.js';
|
|
22
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAKpB,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,EACL,aAAa,EACb,cAAc,EACd,yBAAyB,EACzB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,YAAY,CAAC;AAKpB,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAC3F,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,eAAe,GAChB,MAAM,WAAW,CAAC;AA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,EACR,aAAa,EAEb,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,EACV,eAAe,EAEf,UAAU,EACV,eAAe,EACf,iBAAiB,EAEjB,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,SAAS,EAET,aAAa,EACb,QAAQ,EACR,SAAS,EAET,cAAc,EACd,gBAAgB,EAChB,eAAe,EAEf,aAAa,EACb,aAAa,EACb,cAAc,EAEd,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,GACb,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAKpB,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,EACL,aAAa,EACb,cAAc,EACd,yBAAyB,EACzB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,YAAY,CAAC;AAKpB,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAC3F,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,eAAe,GAChB,MAAM,WAAW,CAAC;AAKnB,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1E,YAAY,EACV,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,SAAS,EAET,aAAa,EACb,QAAQ,EACR,SAAS,EAET,cAAc,EACd,gBAAgB,EAChB,eAAe,EAEf,aAAa,EACb,aAAa,EACb,cAAc,EAEd,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,GACb,MAAM,iBAAiB,CAAC;AAKzB,YAAY,EACV,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACd,oBAAoB,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AAKvB,YAAY,EAEV,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAEhB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EAEnB,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EAEf,sBAAsB,EACtB,qBAAqB,EAErB,eAAe,EAEf,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import type { SkillId } from './skill.js';
|
|
2
|
+
/**
|
|
3
|
+
* Unique identifier for resources
|
|
4
|
+
*/
|
|
5
|
+
export type ResourceId = string & {
|
|
6
|
+
readonly __brand: unique symbol;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Create a typed ResourceId from a string
|
|
10
|
+
*/
|
|
11
|
+
export declare function createResourceId(id: string): ResourceId;
|
|
12
|
+
/**
|
|
13
|
+
* Types of learning resources
|
|
14
|
+
*/
|
|
15
|
+
export type ResourceType = 'book' | 'chapter' | 'article' | 'video' | 'youtube' | 'pdf' | 'document' | 'website' | 'slides' | 'exercise' | 'quiz' | 'lab' | 'other';
|
|
16
|
+
/**
|
|
17
|
+
* Represents a learning resource that teaches skills
|
|
18
|
+
*
|
|
19
|
+
* A Resource is any learning material (textbook chapter, video, article, etc.)
|
|
20
|
+
* that can be used to teach one or more skills in the knowledge graph.
|
|
21
|
+
*/
|
|
22
|
+
export interface Resource {
|
|
23
|
+
/** Unique identifier for the resource */
|
|
24
|
+
id: ResourceId;
|
|
25
|
+
/** Display name of the resource */
|
|
26
|
+
name: string;
|
|
27
|
+
/** Description of what this resource covers */
|
|
28
|
+
description: string;
|
|
29
|
+
/** Type of resource */
|
|
30
|
+
type: ResourceType;
|
|
31
|
+
/**
|
|
32
|
+
* URL or reference to the resource
|
|
33
|
+
* Can be a URL, file path, or textual reference like "Chapter 4 of Introduction to Algorithms"
|
|
34
|
+
*/
|
|
35
|
+
reference: string;
|
|
36
|
+
/**
|
|
37
|
+
* IDs of skills this resource teaches or covers
|
|
38
|
+
* This creates TEACHES relationships in the graph
|
|
39
|
+
*/
|
|
40
|
+
skillIds: SkillId[];
|
|
41
|
+
/**
|
|
42
|
+
* How well this resource covers each skill (0-1 scale)
|
|
43
|
+
* Maps skill ID to coverage score
|
|
44
|
+
* - 1.0: Comprehensive deep coverage
|
|
45
|
+
* - 0.7-0.9: Good coverage with examples
|
|
46
|
+
* - 0.4-0.6: Moderate coverage, introduces concepts
|
|
47
|
+
* - 0.1-0.3: Brief mention or tangential
|
|
48
|
+
*/
|
|
49
|
+
coverageScores?: Record<string, number>;
|
|
50
|
+
/**
|
|
51
|
+
* Estimated time to consume this resource in minutes
|
|
52
|
+
*/
|
|
53
|
+
estimatedMinutes?: number;
|
|
54
|
+
/**
|
|
55
|
+
* Optional content extracted from the resource (for deep analysis)
|
|
56
|
+
* This is populated when doing Option 3 deep resource analysis
|
|
57
|
+
*/
|
|
58
|
+
extractedContent?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Source of the resource reference
|
|
61
|
+
* - 'syllabus': Extracted from syllabus text (Option 2)
|
|
62
|
+
* - 'uploaded': User uploaded the actual resource (Option 3)
|
|
63
|
+
* - 'linked': User provided a URL that was fetched
|
|
64
|
+
*/
|
|
65
|
+
source: 'syllabus' | 'uploaded' | 'linked';
|
|
66
|
+
/**
|
|
67
|
+
* Original text from syllabus mentioning this resource
|
|
68
|
+
* Only populated for source='syllabus'
|
|
69
|
+
*/
|
|
70
|
+
originalMention?: string;
|
|
71
|
+
/** Arbitrary metadata for extensibility */
|
|
72
|
+
metadata: Record<string, unknown>;
|
|
73
|
+
/** ISO 8601 timestamp of creation */
|
|
74
|
+
createdAt: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Input for creating a new resource (without generated fields)
|
|
78
|
+
*/
|
|
79
|
+
export type ResourceInput = Omit<Resource, 'id' | 'createdAt'> & {
|
|
80
|
+
id?: ResourceId;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* A TEACHES relationship between a resource and a skill
|
|
84
|
+
*/
|
|
85
|
+
export interface TeachesEdge {
|
|
86
|
+
/** Resource that teaches the skill */
|
|
87
|
+
resourceId: ResourceId;
|
|
88
|
+
/** Skill being taught */
|
|
89
|
+
skillId: SkillId;
|
|
90
|
+
/**
|
|
91
|
+
* Coverage score (0-1)
|
|
92
|
+
* How comprehensively the resource covers this skill
|
|
93
|
+
*/
|
|
94
|
+
coverage: number;
|
|
95
|
+
/**
|
|
96
|
+
* Specific topics from this resource that relate to the skill
|
|
97
|
+
*/
|
|
98
|
+
topics?: string[];
|
|
99
|
+
/**
|
|
100
|
+
* Page numbers, timestamps, or sections where this skill is covered
|
|
101
|
+
*/
|
|
102
|
+
references?: string[];
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Resource extraction result from syllabus parsing (Option 2)
|
|
106
|
+
*/
|
|
107
|
+
export interface ResourceReference {
|
|
108
|
+
/** Name or title of the resource */
|
|
109
|
+
name: string;
|
|
110
|
+
/** Type of resource */
|
|
111
|
+
type: ResourceType;
|
|
112
|
+
/** The reference string (e.g., "Chapter 4", "Khan Academy video on X") */
|
|
113
|
+
reference: string;
|
|
114
|
+
/** Original text from syllabus mentioning this resource */
|
|
115
|
+
originalMention: string;
|
|
116
|
+
/** Which skill IDs this resource is associated with */
|
|
117
|
+
relatedSkillIds: string[];
|
|
118
|
+
/** Estimated time in minutes if discernible */
|
|
119
|
+
estimatedMinutes?: number;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Deep resource analysis result (Option 3)
|
|
123
|
+
* When actual resource content is analyzed
|
|
124
|
+
*/
|
|
125
|
+
export interface DeepResourceAnalysis {
|
|
126
|
+
/** The resource being analyzed */
|
|
127
|
+
resource: Resource;
|
|
128
|
+
/**
|
|
129
|
+
* Skills extracted or identified from analyzing the actual content
|
|
130
|
+
*/
|
|
131
|
+
identifiedSkills: Array<{
|
|
132
|
+
/** Skill ID if matching existing skill, or new ID if new skill */
|
|
133
|
+
skillId: string;
|
|
134
|
+
/** Whether this is an existing skill or newly identified */
|
|
135
|
+
isExisting: boolean;
|
|
136
|
+
/** How confidently this skill is covered */
|
|
137
|
+
confidence: number;
|
|
138
|
+
/** Specific coverage details */
|
|
139
|
+
coverageDetails: string;
|
|
140
|
+
}>;
|
|
141
|
+
/**
|
|
142
|
+
* Key topics extracted from the resource
|
|
143
|
+
*/
|
|
144
|
+
keyTopics: string[];
|
|
145
|
+
/**
|
|
146
|
+
* Prerequisites the resource assumes the reader has
|
|
147
|
+
*/
|
|
148
|
+
assumedPrerequisites: string[];
|
|
149
|
+
/**
|
|
150
|
+
* Learning objectives explicitly stated in the resource
|
|
151
|
+
*/
|
|
152
|
+
learningObjectives: string[];
|
|
153
|
+
/**
|
|
154
|
+
* Difficulty assessment of the resource content
|
|
155
|
+
*/
|
|
156
|
+
difficultyLevel: 'beginner' | 'intermediate' | 'advanced';
|
|
157
|
+
/**
|
|
158
|
+
* Quality assessment of the resource
|
|
159
|
+
*/
|
|
160
|
+
qualityScore?: number;
|
|
161
|
+
/**
|
|
162
|
+
* Any warnings or notes from the analysis
|
|
163
|
+
*/
|
|
164
|
+
warnings?: string[];
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Extraction mode for the three-tier approach
|
|
168
|
+
*/
|
|
169
|
+
export type ExtractionMode =
|
|
170
|
+
/** Option 1: Extract skills only from syllabus text */
|
|
171
|
+
'skills-only'
|
|
172
|
+
/** Option 2: Extract skills + resource references mentioned in syllabus */
|
|
173
|
+
| 'with-references'
|
|
174
|
+
/** Option 3: Deep analysis - upload resources and analyze their content */
|
|
175
|
+
| 'deep-analysis';
|
|
176
|
+
/**
|
|
177
|
+
* Configuration for each extraction mode
|
|
178
|
+
*/
|
|
179
|
+
export interface ExtractionModeConfig {
|
|
180
|
+
id: ExtractionMode;
|
|
181
|
+
name: string;
|
|
182
|
+
description: string;
|
|
183
|
+
icon: string;
|
|
184
|
+
features: string[];
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Default extraction mode configurations
|
|
188
|
+
*/
|
|
189
|
+
export declare const EXTRACTION_MODES: ExtractionModeConfig[];
|
|
190
|
+
/**
|
|
191
|
+
* Detect resource type from URL or file extension
|
|
192
|
+
*/
|
|
193
|
+
export declare function detectResourceType(reference: string): ResourceType;
|
|
194
|
+
/**
|
|
195
|
+
* Get an icon for a resource type
|
|
196
|
+
*/
|
|
197
|
+
export declare function getResourceTypeIcon(type: ResourceType): string;
|
|
198
|
+
/**
|
|
199
|
+
* Get a color for a resource type
|
|
200
|
+
*/
|
|
201
|
+
export declare function getResourceTypeColor(type: ResourceType): string;
|
|
202
|
+
//# sourceMappingURL=resource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../../src/types/resource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CA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;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,MAAM,cAAc;AACxB,uDAAuD;AACrD,aAAa;AACf,2EAA2E;GACzE,iBAAiB;AACnB,2EAA2E;GACzE,eAAe,CAAC;AAEpB;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,cAAc,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,oBAAoB,EAqClD,CAAC;AAEF;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY,CA8DlE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAiB9D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAiB/D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "learngraph",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "The world's first AI-powered learning path generator. Transform syllabi into personalized mastery paths with Zone of Proximal Development (ZPD), Bloom's Taxonomy, spaced repetition, and Bayesian Knowledge Tracing built in. Every student's path to mastery.",
|
|
5
5
|
"author": "Dr. Ernesto Lee <dr.ernesto.lee@gmail.com>",
|
|
6
6
|
"license": "Apache-2.0",
|