keywordgraph-mcp-server 1.9.1 → 1.9.5
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/README.md +19 -11
- package/dist/config/brand.d.ts.map +1 -1
- package/dist/config/brand.js +1 -0
- package/dist/config/brand.js.map +1 -1
- package/dist/config/models.d.ts +7 -0
- package/dist/config/models.d.ts.map +1 -0
- package/dist/config/models.js +26 -0
- package/dist/config/models.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/instructions.js +4 -4
- package/dist/resources/about.d.ts.map +1 -1
- package/dist/resources/about.js +3 -2
- package/dist/resources/about.js.map +1 -1
- package/dist/schemas/index.d.ts +130 -71
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +131 -200
- package/dist/schemas/index.js.map +1 -1
- package/dist/tools/analyzeLlmResults.d.ts +1 -1
- package/dist/tools/analyzeLlmResults.d.ts.map +1 -1
- package/dist/tools/analyzeLlmResults.js +4 -1
- package/dist/tools/analyzeLlmResults.js.map +1 -1
- package/dist/tools/createKnowledgeGraph.d.ts +5 -2
- package/dist/tools/createKnowledgeGraph.d.ts.map +1 -1
- package/dist/tools/createKnowledgeGraph.js +23 -5
- package/dist/tools/createKnowledgeGraph.js.map +1 -1
- package/dist/tools/developConceptualBridges.d.ts +1 -1
- package/dist/tools/developConceptualBridges.d.ts.map +1 -1
- package/dist/tools/developConceptualBridges.js +3 -2
- package/dist/tools/developConceptualBridges.js.map +1 -1
- package/dist/tools/developLatentTopics.d.ts +1 -1
- package/dist/tools/developLatentTopics.d.ts.map +1 -1
- package/dist/tools/developLatentTopics.js +3 -2
- package/dist/tools/developLatentTopics.js.map +1 -1
- package/dist/tools/developTextTool.d.ts +1 -1
- package/dist/tools/developTextTool.d.ts.map +1 -1
- package/dist/tools/developTextTool.js +10 -6
- package/dist/tools/developTextTool.js.map +1 -1
- package/dist/tools/generateKnowledgeGraph.d.ts +5 -2
- package/dist/tools/generateKnowledgeGraph.d.ts.map +1 -1
- package/dist/tools/generateKnowledgeGraph.js +21 -7
- package/dist/tools/generateKnowledgeGraph.js.map +1 -1
- package/dist/tools/generateOntologyGraph.d.ts +3 -3
- package/dist/tools/generateOntologyGraph.d.ts.map +1 -1
- package/dist/tools/generateOntologyGraph.js +11 -20
- package/dist/tools/generateOntologyGraph.js.map +1 -1
- package/dist/tools/generateResearchIdeas.d.ts +2 -1
- package/dist/tools/generateResearchIdeas.d.ts.map +1 -1
- package/dist/tools/generateResearchIdeas.js +7 -5
- package/dist/tools/generateResearchIdeas.js.map +1 -1
- package/dist/tools/generateResearchQuestions.d.ts +2 -1
- package/dist/tools/generateResearchQuestions.d.ts.map +1 -1
- package/dist/tools/generateResearchQuestions.js +7 -5
- package/dist/tools/generateResearchQuestions.js.map +1 -1
- package/dist/tools/generateResponses.d.ts +1 -1
- package/dist/tools/generateResponses.d.ts.map +1 -1
- package/dist/tools/generateResponses.js +3 -2
- package/dist/tools/generateResponses.js.map +1 -1
- package/dist/tools/getGraphAroundTerm.d.ts +32 -0
- package/dist/tools/getGraphAroundTerm.d.ts.map +1 -0
- package/dist/tools/getGraphAroundTerm.js +69 -0
- package/dist/tools/getGraphAroundTerm.js.map +1 -0
- package/dist/tools/getNodeNeighborhood.d.ts.map +1 -1
- package/dist/tools/getNodeNeighborhood.js +4 -2
- package/dist/tools/getNodeNeighborhood.js.map +1 -1
- package/dist/tools/getTermGraph.d.ts +32 -0
- package/dist/tools/getTermGraph.d.ts.map +1 -0
- package/dist/tools/getTermGraph.js +69 -0
- package/dist/tools/getTermGraph.js.map +1 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +1 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/optimizeKnowledgeBase.d.ts +4 -2
- package/dist/tools/optimizeKnowledgeBase.d.ts.map +1 -1
- package/dist/tools/optimizeKnowledgeBase.js +18 -6
- package/dist/tools/optimizeKnowledgeBase.js.map +1 -1
- package/dist/tools/optimizeReasoning.d.ts +1 -1
- package/dist/tools/optimizeReasoning.d.ts.map +1 -1
- package/dist/tools/optimizeReasoning.js +2 -1
- package/dist/tools/optimizeReasoning.js.map +1 -1
- package/dist/tools/optimizeTextStructure.d.ts +1 -1
- package/dist/tools/optimizeTextStructure.d.ts.map +1 -1
- package/dist/tools/optimizeTextStructure.js +3 -2
- package/dist/tools/optimizeTextStructure.js.map +1 -1
- package/dist/tools/searchGraphs.d.ts.map +1 -1
- package/dist/tools/searchGraphs.js +2 -1
- package/dist/tools/searchGraphs.js.map +1 -1
- package/dist/types/index.d.ts +16 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/aiKnowledgeGraph.d.ts +45 -0
- package/dist/utils/aiKnowledgeGraph.d.ts.map +1 -0
- package/dist/utils/aiKnowledgeGraph.js +77 -0
- package/dist/utils/aiKnowledgeGraph.js.map +1 -0
- package/dist/utils/chunkByLines.d.ts +3 -0
- package/dist/utils/chunkByLines.d.ts.map +1 -0
- package/dist/utils/chunkByLines.js +19 -0
- package/dist/utils/chunkByLines.js.map +1 -0
- package/dist/utils/transformers.d.ts +7 -0
- package/dist/utils/transformers.d.ts.map +1 -1
- package/dist/utils/transformers.js +32 -0
- package/dist/utils/transformers.js.map +1 -1
- package/dist/utils/wikilinksMode.d.ts +9 -0
- package/dist/utils/wikilinksMode.d.ts.map +1 -1
- package/dist/utils/wikilinksMode.js +6 -4
- package/dist/utils/wikilinksMode.js.map +1 -1
- package/llms-full.infranodus.txt +17 -11
- package/llms-full.keywordgraph.txt +9 -6
- package/llms-full.txt +17 -11
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sour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wDAAwD;AACxD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;EAkCpC,CAAC;AAMH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwGjC,CAAC"}
|
package/dist/schemas/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { AI_MODELS, DEFAULT_AI_MODEL, DEFAULT_GRAPH_MODEL, } from "../config/models.js";
|
|
2
3
|
import { brand } from "../config/brand.js";
|
|
3
4
|
import { WikilinksModeEnum, categoriesAsNodesDescription, wikilinksModeDescription, } from "../utils/wikilinksMode.js";
|
|
4
5
|
/**
|
|
@@ -39,11 +40,34 @@ const timestampsField = z
|
|
|
39
40
|
.array(z.string())
|
|
40
41
|
.optional()
|
|
41
42
|
.describe("Per-statement date, one entry per statement (empty string = upload time, length must match `statements`). ISO 8601 only — '2026-08-02' or '2026-08-02T14:30:00Z'; other formats are refused because day-first and month-first dates are indistinguishable below the 13th. Stored to minute precision in the server timezone; drives time filters and dynamic graph views. Requires `statements`; omit when the statements are undated.");
|
|
43
|
+
const ENTITY_MODES = [
|
|
44
|
+
"none",
|
|
45
|
+
"detectEntities",
|
|
46
|
+
"extractEntitiesOnly",
|
|
47
|
+
"aiKnowledgeGraph",
|
|
48
|
+
];
|
|
49
|
+
const entityDetectionDescription = "How the graph's nodes are made. " +
|
|
50
|
+
"none: from the words of the text (default). " +
|
|
51
|
+
"detectEntities: an algorithm (TextRazor) finds names of people, places, organizations and the like and marks them as entities; the graph mixes them with ordinary words. " +
|
|
52
|
+
"extractEntitiesOnly: the same algorithm finds the names, and only they become nodes. For plain text without [[wikilinks]]; for text already written as [[entity]] statements use wikilinksMode: 'wikilinksOnly' instead.";
|
|
53
|
+
const entityModesDescription = "How the graph's nodes are made. " +
|
|
54
|
+
"none: from the words of the text (default; for text, gap and topical analysis). " +
|
|
55
|
+
"detectEntities: an algorithm (TextRazor) finds names of people, places, organizations and the like and marks them as entities; the graph mixes them with ordinary words. " +
|
|
56
|
+
"extractEntitiesOnly: the same algorithm finds the names, and only they become nodes. For plain text without [[wikilinks]]; statements you already wrote as [[entity]] statements go in with wikilinksMode: 'wikilinksOnly' instead. " +
|
|
57
|
+
"aiKnowledgeGraph: an AI model writes [[entity]] statements about the input, a topic or a text, and only those entities become nodes; no algorithm detection. Use for a knowledge graph of a topic or a text. Slower: one AI call per ~12,000 characters, which counts against the AI quota.";
|
|
58
|
+
const aiGraphModelField = z
|
|
59
|
+
.enum(AI_MODELS)
|
|
60
|
+
.optional()
|
|
61
|
+
.describe("Only with modifyAnalyzedText: 'aiKnowledgeGraph'. AI model that writes the entity statements. Default: claude-opus-5-5; the -mini and -lite variants are faster and cheaper.");
|
|
62
|
+
const aiGraphInstructionsField = z
|
|
63
|
+
.string()
|
|
64
|
+
.optional()
|
|
65
|
+
.describe("Only with modifyAnalyzedText: 'aiKnowledgeGraph'. The user's own instructions for the AI model, e.g. 'only people and organizations' or 'focus on 1950-1970'. They can change which entities and relations to include, the scope and the number of statements, but not the output format.");
|
|
42
66
|
export const GenerateGraphSchema = z.object({
|
|
43
67
|
text: z
|
|
44
68
|
.string()
|
|
45
69
|
.optional()
|
|
46
|
-
.describe("Text that you'd like to analyze. Use new lines to separate separate statements or paragrams in each text (but not the sentences). Use [[wikilinks]] to mark entities (if required for social / knowledge graphs, ontology, or entity detection). Provide one of: this, url, or statements."),
|
|
70
|
+
.describe("Text that you'd like to analyze. Use new lines to separate separate statements or paragrams in each text (but not the sentences). Use [[wikilinks]] to mark entities (if required for social / knowledge graphs, ontology, or entity detection). With modifyAnalyzedText: 'aiKnowledgeGraph' this can also be a short topic. Provide one of: this, url, or statements."),
|
|
47
71
|
url: z
|
|
48
72
|
.string()
|
|
49
73
|
.url()
|
|
@@ -78,9 +102,11 @@ export const GenerateGraphSchema = z.object({
|
|
|
78
102
|
.optional()
|
|
79
103
|
.describe("Maximum number of concepts (nodes) in the generated graph. Default 150 — the most relevant nodes are kept and the rest dropped. Increase (e.g. 500) for large texts when a more complete graph is explicitly needed; response size grows accordingly. Omit to use the default."),
|
|
80
104
|
modifyAnalyzedText: z
|
|
81
|
-
.enum(
|
|
105
|
+
.enum(ENTITY_MODES)
|
|
82
106
|
.default("none")
|
|
83
|
-
.describe(
|
|
107
|
+
.describe(entityModesDescription),
|
|
108
|
+
modelToUse: aiGraphModelField,
|
|
109
|
+
instructions: aiGraphInstructionsField,
|
|
84
110
|
wikilinksMode: WikilinksModeEnum.default("default").describe(wikilinksModeDescription),
|
|
85
111
|
});
|
|
86
112
|
export const CreateGraphSchema = z.object({
|
|
@@ -91,7 +117,7 @@ export const CreateGraphSchema = z.object({
|
|
|
91
117
|
text: z
|
|
92
118
|
.string()
|
|
93
119
|
.optional()
|
|
94
|
-
.describe("Text that you'd like to analyze. Use new lines to separate separate statements or paragrams in each text (but not the sentences). Provide one of: this, url, or statements."),
|
|
120
|
+
.describe("Text that you'd like to analyze. Use new lines to separate separate statements or paragrams in each text (but not the sentences). With modifyAnalyzedText: 'aiKnowledgeGraph' this can also be a short topic. Provide one of: this, url, or statements."),
|
|
95
121
|
url: z
|
|
96
122
|
.string()
|
|
97
123
|
.url()
|
|
@@ -126,9 +152,11 @@ export const CreateGraphSchema = z.object({
|
|
|
126
152
|
.optional()
|
|
127
153
|
.describe("Maximum number of concepts (nodes) in the generated graph. Default 150 — the most relevant nodes are kept and the rest dropped. Increase (e.g. 500) for large texts when a more complete graph is explicitly needed; response size grows accordingly. Omit to use the default."),
|
|
128
154
|
modifyAnalyzedText: z
|
|
129
|
-
.enum(
|
|
155
|
+
.enum(ENTITY_MODES)
|
|
130
156
|
.default("none")
|
|
131
|
-
.describe(
|
|
157
|
+
.describe(entityModesDescription),
|
|
158
|
+
modelToUse: aiGraphModelField,
|
|
159
|
+
instructions: aiGraphInstructionsField,
|
|
132
160
|
wikilinksMode: WikilinksModeEnum.default("default").describe(wikilinksModeDescription +
|
|
133
161
|
" For saved graphs this applies only when the graph is FIRST created; uploads to an existing graphName keep its original setting."),
|
|
134
162
|
});
|
|
@@ -236,7 +264,7 @@ export const AnalyzeTextSchemaBase = z.object({
|
|
|
236
264
|
modifyAnalyzedText: z
|
|
237
265
|
.enum(["none", "detectEntities", "extractEntitiesOnly"])
|
|
238
266
|
.default("none")
|
|
239
|
-
.describe(
|
|
267
|
+
.describe(entityDetectionDescription),
|
|
240
268
|
wikilinksMode: WikilinksModeEnum.default("default").describe(wikilinksModeDescription),
|
|
241
269
|
});
|
|
242
270
|
export const AnalyzeTextSchema = AnalyzeTextSchemaBase.refine((data) => (data.text !== undefined && data.text.trim().length > 0) ||
|
|
@@ -308,7 +336,7 @@ export const AnalyzeExistingGraphSchemaBase = z.object({
|
|
|
308
336
|
modifyAnalyzedText: z
|
|
309
337
|
.enum(["none", "detectEntities", "extractEntitiesOnly"])
|
|
310
338
|
.default("none")
|
|
311
|
-
.describe(
|
|
339
|
+
.describe(entityDetectionDescription),
|
|
312
340
|
});
|
|
313
341
|
export const AnalyzeExistingGraphSchema = AnalyzeExistingGraphSchemaBase;
|
|
314
342
|
export const SearchExistingGraphsSchema = z.object({
|
|
@@ -436,24 +464,9 @@ export const GenerateOntologyGraphSchema = z.object({
|
|
|
436
464
|
.optional()
|
|
437
465
|
.describe(`Name of the ${brand.name} graph to save the ontology to. Only used when saveGraph is true. If omitted, a name is auto-generated from the prompt. Note: saving to a name that already exists appends the new statements to that graph rather than replacing it.`),
|
|
438
466
|
modelToUse: z
|
|
439
|
-
.enum(
|
|
440
|
-
|
|
441
|
-
"claude-
|
|
442
|
-
"claude-fable-5",
|
|
443
|
-
"gemini-2.5-pro",
|
|
444
|
-
"gemini-2.5-flash",
|
|
445
|
-
"gemini-2.5-flash-lite",
|
|
446
|
-
"grok-4.1-fast-non-reasoning",
|
|
447
|
-
"grok-4.1-fast-reasoning",
|
|
448
|
-
"gpt-4o",
|
|
449
|
-
"gpt-4o-mini",
|
|
450
|
-
"gpt-5.4",
|
|
451
|
-
"gpt-5.4-mini",
|
|
452
|
-
"gpt-5.6-terra",
|
|
453
|
-
"gpt-5.6-sol",
|
|
454
|
-
])
|
|
455
|
-
.default("claude-opus-5")
|
|
456
|
-
.describe("AI model used to generate the ontology. More capable models (claude-opus-5, claude-fable-5, gpt-5.6-terra) produce richer, more accurate ontologies; the -mini and -lite variants are faster and cheaper. Default: claude-opus-5."),
|
|
467
|
+
.enum(AI_MODELS)
|
|
468
|
+
.default(DEFAULT_GRAPH_MODEL)
|
|
469
|
+
.describe("AI model used to generate the ontology. More capable models (claude-opus-5-5, claude-fable-5-1, gpt-6.1-terra) produce richer, more accurate ontologies; the -mini and -lite variants are faster and cheaper. Default: claude-opus-5-5."),
|
|
457
470
|
saveGraph: z
|
|
458
471
|
.boolean()
|
|
459
472
|
.default(true)
|
|
@@ -493,24 +506,9 @@ export const AnalyzeLlmResultsSchema = z.object({
|
|
|
493
506
|
.optional()
|
|
494
507
|
.describe(`Name of the ${brand.name} graph to save the LLM overview to. Only used when saveGraph is true. If omitted, a name is auto-generated from the prompt. Note: saving to a name that already exists appends the new statements to that graph rather than replacing it.`),
|
|
495
508
|
modelToUse: z
|
|
496
|
-
.enum(
|
|
497
|
-
|
|
498
|
-
"claude-
|
|
499
|
-
"claude-fable-5",
|
|
500
|
-
"gemini-2.5-pro",
|
|
501
|
-
"gemini-2.5-flash",
|
|
502
|
-
"gemini-2.5-flash-lite",
|
|
503
|
-
"grok-4.1-fast-non-reasoning",
|
|
504
|
-
"grok-4.1-fast-reasoning",
|
|
505
|
-
"gpt-4o",
|
|
506
|
-
"gpt-4o-mini",
|
|
507
|
-
"gpt-5.4",
|
|
508
|
-
"gpt-5.4-mini",
|
|
509
|
-
"gpt-5.6-terra",
|
|
510
|
-
"gpt-5.6-sol",
|
|
511
|
-
])
|
|
512
|
-
.default("claude-opus-5")
|
|
513
|
-
.describe("AI model whose view of the topic is being analyzed. Pick the model the user is curious about — different models surface different framings. Default: claude-opus-5."),
|
|
509
|
+
.enum(AI_MODELS)
|
|
510
|
+
.default(DEFAULT_GRAPH_MODEL)
|
|
511
|
+
.describe("AI model whose view of the topic is being analyzed. Pick the model the user is curious about — different models surface different framings. Default: claude-opus-5-5."),
|
|
514
512
|
modifyAnalyzedText: z
|
|
515
513
|
.enum(["none", "detectEntities", "extractEntitiesOnly"])
|
|
516
514
|
.default("none")
|
|
@@ -566,6 +564,21 @@ export const GenerateTopicalClustersSchema = GenerateTopicalClustersSchemaBase.r
|
|
|
566
564
|
(data.url !== undefined && data.url.length > 0) ||
|
|
567
565
|
(data.graphName !== undefined && data.graphName.trim().length > 0) ||
|
|
568
566
|
(data.statements !== undefined && data.statements.length > 0), { message: "Provide text, url, statements, or graphName for analysis." });
|
|
567
|
+
// Which clusters the AI works on (the API's `optimize` query parameter). The
|
|
568
|
+
// default follows the graph's insight clusters, chosen from its structure.
|
|
569
|
+
const OPTIMIZE_MODE_OPTIMIZE = "'optimize' (default): the graph's insight clusters, picked from its structure to move it toward a balanced, diversified shape — in a biased or focused graph the least influential clusters across a gap, in a diversified graph the widest gap, in a dispersed graph the most influential clusters across a gap";
|
|
570
|
+
const OPTIMIZE_MODE_DEVELOP = "'develop': all the main topical clusters, to develop what the content already covers";
|
|
571
|
+
const OPTIMIZE_MODE_LATENT = "'latent': the least represented clusters, to bring out topics that are present but under-developed";
|
|
572
|
+
const OPTIMIZE_MODE_GAP = "'gap': the widest structural gap, whatever the state of the graph";
|
|
573
|
+
const INSIGHT_CLUSTERS_RETURNED = "The response lists the insight clusters as insightClusters, one line per gap depth.";
|
|
574
|
+
const researchOptimizeField = (what) => z
|
|
575
|
+
.enum(["optimize", "gap", "develop", "latent"])
|
|
576
|
+
.default("optimize")
|
|
577
|
+
.describe(`Which clusters the ${what} are generated from. ${OPTIMIZE_MODE_OPTIMIZE}. ${OPTIMIZE_MODE_GAP}. ${OPTIMIZE_MODE_DEVELOP}. ${OPTIMIZE_MODE_LATENT}. ${INSIGHT_CLUSTERS_RETURNED}`);
|
|
578
|
+
const researchGapDepthField = (what) => z
|
|
579
|
+
.number()
|
|
580
|
+
.default(0)
|
|
581
|
+
.describe(`Which gap to generate ${what} for: 0 is the first, higher numbers reach less prominent ones. With optimize 'optimize' it selects the insight clusters at that depth, with 'gap' the next widest gap.`);
|
|
569
582
|
export const GenerateResearchQuestionsSchemaBase = z.object({
|
|
570
583
|
text: z
|
|
571
584
|
.string()
|
|
@@ -593,33 +606,16 @@ export const GenerateResearchQuestionsSchemaBase = z.object({
|
|
|
593
606
|
.boolean()
|
|
594
607
|
.default(false)
|
|
595
608
|
.describe("Generate questions for several content gaps found in text"),
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
.default(0)
|
|
599
|
-
.describe("Depth of content gaps to generate questions for"),
|
|
609
|
+
optimize: researchOptimizeField("questions"),
|
|
610
|
+
gapDepth: researchGapDepthField("questions"),
|
|
600
611
|
includeGraphSummary: z
|
|
601
612
|
.boolean()
|
|
602
613
|
.default(false)
|
|
603
614
|
.describe("Include graph summary string in the response to provide additional information about the text knowledge graph structure"),
|
|
604
615
|
modelToUse: z
|
|
605
|
-
.enum(
|
|
606
|
-
|
|
607
|
-
"
|
|
608
|
-
"claude-fable-5",
|
|
609
|
-
"gemini-2.5-pro",
|
|
610
|
-
"gemini-2.5-flash",
|
|
611
|
-
"gemini-2.5-flash-lite",
|
|
612
|
-
"grok-4.1-fast-non-reasoning",
|
|
613
|
-
"grok-4.1-fast-reasoning",
|
|
614
|
-
"gpt-4o",
|
|
615
|
-
"gpt-4o-mini",
|
|
616
|
-
"gpt-5.4",
|
|
617
|
-
"gpt-5.4-mini",
|
|
618
|
-
"gpt-5.6-terra",
|
|
619
|
-
"gpt-5.6-sol",
|
|
620
|
-
])
|
|
621
|
-
.default("gpt-5.4")
|
|
622
|
-
.describe("AI model to use for generating research questions: claude-opus-5, claude-sonnet-5, claude-fable-5, gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite, grok-4.1-fast-non-reasoning, grok-4.1-fast-reasoning, gpt-4o, gpt-4o-mini, gpt-5.4, gpt-5.4-mini, gpt-5.6-terra, gpt-5.6-sol"),
|
|
616
|
+
.enum(AI_MODELS)
|
|
617
|
+
.default(DEFAULT_AI_MODEL)
|
|
618
|
+
.describe("AI model to use for generating research questions. Default: gpt-6.1-terra."),
|
|
623
619
|
});
|
|
624
620
|
export const GenerateResearchQuestionsSchema = GenerateResearchQuestionsSchemaBase.refine((data) => (data.text !== undefined && data.text.trim().length > 0) ||
|
|
625
621
|
(data.url !== undefined && data.url.length > 0) ||
|
|
@@ -652,10 +648,8 @@ export const GenerateResearchIdeasSchemaBase = z.object({
|
|
|
652
648
|
.boolean()
|
|
653
649
|
.default(false)
|
|
654
650
|
.describe("Generate ideas for several content gaps found in text"),
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
.default(0)
|
|
658
|
-
.describe("Depth of content gaps to generate ideas for"),
|
|
651
|
+
optimize: researchOptimizeField("ideas"),
|
|
652
|
+
gapDepth: researchGapDepthField("ideas"),
|
|
659
653
|
shouldTranscend: z
|
|
660
654
|
.boolean()
|
|
661
655
|
.default(false)
|
|
@@ -669,24 +663,9 @@ export const GenerateResearchIdeasSchemaBase = z.object({
|
|
|
669
663
|
.default(false)
|
|
670
664
|
.describe("Include graph summary string in the response to provide additional information about the text knowledge graph structure"),
|
|
671
665
|
modelToUse: z
|
|
672
|
-
.enum(
|
|
673
|
-
|
|
674
|
-
"
|
|
675
|
-
"claude-fable-5",
|
|
676
|
-
"gemini-2.5-pro",
|
|
677
|
-
"gemini-2.5-flash",
|
|
678
|
-
"gemini-2.5-flash-lite",
|
|
679
|
-
"grok-4.1-fast-non-reasoning",
|
|
680
|
-
"grok-4.1-fast-reasoning",
|
|
681
|
-
"gpt-4o",
|
|
682
|
-
"gpt-4o-mini",
|
|
683
|
-
"gpt-5.4",
|
|
684
|
-
"gpt-5.4-mini",
|
|
685
|
-
"gpt-5.6-terra",
|
|
686
|
-
"gpt-5.6-sol",
|
|
687
|
-
])
|
|
688
|
-
.default("gpt-5.4")
|
|
689
|
-
.describe("AI model to use for generating research questions: claude-opus-5, claude-sonnet-5, claude-fable-5, gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite, grok-4.1-fast-non-reasoning, grok-4.1-fast-reasoning, gpt-4o, gpt-4o-mini, gpt-5.4, gpt-5.4-mini, gpt-5.6-terra, gpt-5.6-sol"),
|
|
666
|
+
.enum(AI_MODELS)
|
|
667
|
+
.default(DEFAULT_AI_MODEL)
|
|
668
|
+
.describe("AI model to use for generating research questions. Default: gpt-6.1-terra."),
|
|
690
669
|
});
|
|
691
670
|
export const GenerateResearchIdeasSchema = GenerateResearchIdeasSchemaBase.refine((data) => (data.text !== undefined && data.text.trim().length > 0) ||
|
|
692
671
|
(data.url !== undefined && data.url.length > 0) ||
|
|
@@ -716,24 +695,9 @@ export const OptimizeTextStructureSchemaBase = z.object({
|
|
|
716
695
|
.default("response")
|
|
717
696
|
.describe("Type of response to generate: 'response' — generates a response based on the gaps identified; 'idea' — generate a business idea that bridges the gap; 'question' — generate questions that focus on this context; 'transcend' — generate responses that go beyond the text and relate to a broader discourse."),
|
|
718
697
|
modelToUse: z
|
|
719
|
-
.enum(
|
|
720
|
-
|
|
721
|
-
"
|
|
722
|
-
"claude-fable-5",
|
|
723
|
-
"gemini-2.5-pro",
|
|
724
|
-
"gemini-2.5-flash",
|
|
725
|
-
"gemini-2.5-flash-lite",
|
|
726
|
-
"grok-4.1-fast-non-reasoning",
|
|
727
|
-
"grok-4.1-fast-reasoning",
|
|
728
|
-
"gpt-4o",
|
|
729
|
-
"gpt-4o-mini",
|
|
730
|
-
"gpt-5.4",
|
|
731
|
-
"gpt-5.4-mini",
|
|
732
|
-
"gpt-5.6-terra",
|
|
733
|
-
"gpt-5.6-sol",
|
|
734
|
-
])
|
|
735
|
-
.default("gpt-5.4")
|
|
736
|
-
.describe("AI model to use for generating optimization suggestions: claude-opus-5, claude-sonnet-5, claude-fable-5, gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite, grok-4.1-fast-non-reasoning, grok-4.1-fast-reasoning, gpt-4o, gpt-4o-mini, gpt-5.4, gpt-5.4-mini, gpt-5.6-terra, gpt-5.6-sol"),
|
|
698
|
+
.enum(AI_MODELS)
|
|
699
|
+
.default(DEFAULT_AI_MODEL)
|
|
700
|
+
.describe("AI model to use for generating optimization suggestions. Default: gpt-6.1-terra."),
|
|
737
701
|
});
|
|
738
702
|
export const OptimizeTextStructureSchema = OptimizeTextStructureSchemaBase.refine((data) => (data.text !== undefined && data.text.trim().length > 0) ||
|
|
739
703
|
(data.url !== undefined && data.url.length > 0) ||
|
|
@@ -749,24 +713,9 @@ export const OptimizeReasoningSchemaBase = z.object({
|
|
|
749
713
|
categoriesAsNodes: categoriesAsNodesField,
|
|
750
714
|
timestamps: timestampsField,
|
|
751
715
|
modelToUse: z
|
|
752
|
-
.enum(
|
|
753
|
-
|
|
754
|
-
"
|
|
755
|
-
"claude-fable-5",
|
|
756
|
-
"gemini-2.5-pro",
|
|
757
|
-
"gemini-2.5-flash",
|
|
758
|
-
"gemini-2.5-flash-lite",
|
|
759
|
-
"grok-4.1-fast-non-reasoning",
|
|
760
|
-
"grok-4.1-fast-reasoning",
|
|
761
|
-
"gpt-4o",
|
|
762
|
-
"gpt-4o-mini",
|
|
763
|
-
"gpt-5.4",
|
|
764
|
-
"gpt-5.4-mini",
|
|
765
|
-
"gpt-5.6-terra",
|
|
766
|
-
"gpt-5.6-sol",
|
|
767
|
-
])
|
|
768
|
-
.default("gpt-5.4")
|
|
769
|
-
.describe("AI model to use for generating the reasoning-optimization suggestions: claude-opus-5, claude-sonnet-5, claude-fable-5, gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite, grok-4.1-fast-non-reasoning, grok-4.1-fast-reasoning, gpt-4o, gpt-4o-mini, gpt-5.4, gpt-5.4-mini, gpt-5.6-terra, gpt-5.6-sol"),
|
|
716
|
+
.enum(AI_MODELS)
|
|
717
|
+
.default(DEFAULT_AI_MODEL)
|
|
718
|
+
.describe("AI model to use for generating the reasoning-optimization suggestions. Default: gpt-6.1-terra."),
|
|
770
719
|
});
|
|
771
720
|
export const OptimizeReasoningSchema = OptimizeReasoningSchemaBase;
|
|
772
721
|
export const DevelopLatentConceptsSchemaBase = z.object({
|
|
@@ -793,24 +742,9 @@ export const DevelopLatentConceptsSchemaBase = z.object({
|
|
|
793
742
|
.default("transcend")
|
|
794
743
|
.describe("Request mode: 'question' — generate questions that focus on this context; 'transcend' — generate responses that transcend and go beyond the content of the text and relate to a broader discourse."),
|
|
795
744
|
modelToUse: z
|
|
796
|
-
.enum(
|
|
797
|
-
|
|
798
|
-
"
|
|
799
|
-
"claude-fable-5",
|
|
800
|
-
"gemini-2.5-pro",
|
|
801
|
-
"gemini-2.5-flash",
|
|
802
|
-
"gemini-2.5-flash-lite",
|
|
803
|
-
"grok-4.1-fast-non-reasoning",
|
|
804
|
-
"grok-4.1-fast-reasoning",
|
|
805
|
-
"gpt-4o",
|
|
806
|
-
"gpt-4o-mini",
|
|
807
|
-
"gpt-5.4",
|
|
808
|
-
"gpt-5.4-mini",
|
|
809
|
-
"gpt-5.6-terra",
|
|
810
|
-
"gpt-5.6-sol",
|
|
811
|
-
])
|
|
812
|
-
.default("gpt-5.4")
|
|
813
|
-
.describe("AI model to use for generating research questions: claude-opus-5, claude-sonnet-5, claude-fable-5, gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite, grok-4.1-fast-non-reasoning, grok-4.1-fast-reasoning, gpt-4o, gpt-4o-mini, gpt-5.4, gpt-5.4-mini, gpt-5.6-terra, gpt-5.6-sol"),
|
|
745
|
+
.enum(AI_MODELS)
|
|
746
|
+
.default(DEFAULT_AI_MODEL)
|
|
747
|
+
.describe("AI model to use for generating research questions. Default: gpt-6.1-terra."),
|
|
814
748
|
});
|
|
815
749
|
export const DevelopLatentConceptsSchema = DevelopLatentConceptsSchemaBase.refine((data) => (data.text !== undefined && data.text.trim().length > 0) ||
|
|
816
750
|
(data.url !== undefined && data.url.length > 0) ||
|
|
@@ -887,6 +821,38 @@ export const GetNodeNeighborhoodSchema = z.object({
|
|
|
887
821
|
.default(true)
|
|
888
822
|
.describe("Include the statements on those links (with their categories and hop distance)"),
|
|
889
823
|
});
|
|
824
|
+
export const GetGraphAroundTermSchema = z.object({
|
|
825
|
+
terms: z
|
|
826
|
+
.union([z.string().min(1), z.array(z.string().min(1)).min(1).max(5)])
|
|
827
|
+
.describe("The term to look up — a word, a [[concept]] or an entity name, with or without [[ ]] — or several terms (at most 5): the statements that contain all of them (matchAll, the default) or any of them."),
|
|
828
|
+
matchAll: z
|
|
829
|
+
.boolean()
|
|
830
|
+
.default(true)
|
|
831
|
+
.describe("With several terms: true (default) takes only the statements that contain all of them — their shared context; false takes the statements that contain any of them — their contexts merged into one graph."),
|
|
832
|
+
graphNames: z
|
|
833
|
+
.array(z.string().min(1))
|
|
834
|
+
.default([])
|
|
835
|
+
.describe(`Which ${brand.name} graphs to search: one name for one graph, several names for those graphs, empty (the default) for every graph in the account.`),
|
|
836
|
+
removeTerms: z
|
|
837
|
+
.boolean()
|
|
838
|
+
.default(true)
|
|
839
|
+
.describe("Leave the terms out of the graph (default), so the clusters and gaps describe the context around them rather than the terms themselves. false keeps them in, to see what they bridge."),
|
|
840
|
+
includeGraph: z
|
|
841
|
+
.boolean()
|
|
842
|
+
.default(true)
|
|
843
|
+
.describe("Include the compact graph (nodes with their betweenness, weighted edges) next to the statistics; the statistics and the summary come either way."),
|
|
844
|
+
includeStatements: z
|
|
845
|
+
.boolean()
|
|
846
|
+
.default(false)
|
|
847
|
+
.describe("Include the statements that were found, each with the graph it came from and its cluster."),
|
|
848
|
+
maxNodes: z
|
|
849
|
+
.number()
|
|
850
|
+
.int()
|
|
851
|
+
.min(10)
|
|
852
|
+
.max(2000)
|
|
853
|
+
.default(150)
|
|
854
|
+
.describe("How many of the most important nodes the graph keeps."),
|
|
855
|
+
});
|
|
890
856
|
export const GenerateResponsesFromGraphSchemaBase = z.object({
|
|
891
857
|
graphName: z
|
|
892
858
|
.string()
|
|
@@ -915,24 +881,9 @@ export const GenerateResponsesFromGraphSchemaBase = z.object({
|
|
|
915
881
|
.min(1, "Prompt is required")
|
|
916
882
|
.describe("Prompt to generate responses to from the graph"),
|
|
917
883
|
modelToUse: z
|
|
918
|
-
.enum(
|
|
919
|
-
|
|
920
|
-
"
|
|
921
|
-
"claude-fable-5",
|
|
922
|
-
"gemini-2.5-pro",
|
|
923
|
-
"gemini-2.5-flash",
|
|
924
|
-
"gemini-2.5-flash-lite",
|
|
925
|
-
"grok-4.1-fast-non-reasoning",
|
|
926
|
-
"grok-4.1-fast-reasoning",
|
|
927
|
-
"gpt-4o",
|
|
928
|
-
"gpt-4o-mini",
|
|
929
|
-
"gpt-5.4",
|
|
930
|
-
"gpt-5.4-mini",
|
|
931
|
-
"gpt-5.6-terra",
|
|
932
|
-
"gpt-5.6-sol",
|
|
933
|
-
])
|
|
934
|
-
.default("gpt-5.4")
|
|
935
|
-
.describe("AI model to use for generating research questions: claude-opus-5, claude-sonnet-5, claude-fable-5, gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite, grok-4.1-fast-non-reasoning, grok-4.1-fast-reasoning, gpt-4o, gpt-4o-mini, gpt-5.4, gpt-5.4-mini, gpt-5.6-terra, gpt-5.6-sol"),
|
|
884
|
+
.enum(AI_MODELS)
|
|
885
|
+
.default(DEFAULT_AI_MODEL)
|
|
886
|
+
.describe("AI model to use for generating research questions. Default: gpt-6.1-terra."),
|
|
936
887
|
});
|
|
937
888
|
export const GenerateResponsesFromGraphSchema = GenerateResponsesFromGraphSchemaBase.refine((data) => (data.text !== undefined && data.text.trim().length > 0) ||
|
|
938
889
|
(data.url !== undefined && data.url.length > 0) ||
|
|
@@ -976,7 +927,7 @@ export const GenerateGeneralGraphSchema = z.object({
|
|
|
976
927
|
modifyAnalyzedText: z
|
|
977
928
|
.enum(["none", "detectEntities", "extractEntitiesOnly"])
|
|
978
929
|
.default("none")
|
|
979
|
-
.describe(
|
|
930
|
+
.describe(entityDetectionDescription),
|
|
980
931
|
});
|
|
981
932
|
/** Shared context item: one of { text }, { statements }, { url }, or { graphName }. Used by overlap and difference tools. */
|
|
982
933
|
const contextItemTextUrlOrGraphSchema = z.union([
|
|
@@ -1029,7 +980,7 @@ const GenerateOverlapGraphFromTextsSchemaBase = z.object({
|
|
|
1029
980
|
modifyAnalyzedText: z
|
|
1030
981
|
.enum(["none", "detectEntities", "extractEntitiesOnly"])
|
|
1031
982
|
.default("none")
|
|
1032
|
-
.describe(
|
|
983
|
+
.describe(entityDetectionDescription),
|
|
1033
984
|
includeStatements: z
|
|
1034
985
|
.boolean()
|
|
1035
986
|
.default(false)
|
|
@@ -1055,7 +1006,7 @@ const GenerateDifferenceGraphFromTextsSchemaBase = z.object({
|
|
|
1055
1006
|
modifyAnalyzedText: z
|
|
1056
1007
|
.enum(["none", "detectEntities", "extractEntitiesOnly"])
|
|
1057
1008
|
.default("none")
|
|
1058
|
-
.describe(
|
|
1009
|
+
.describe(entityDetectionDescription),
|
|
1059
1010
|
includeStatements: z
|
|
1060
1011
|
.boolean()
|
|
1061
1012
|
.default(false)
|
|
@@ -1508,24 +1459,9 @@ export const DevelopTextToolSchemaBase = z.object({
|
|
|
1508
1459
|
.default(false)
|
|
1509
1460
|
.describe("Shall we transcend and go beyond this text to relate to a broader discourse? If false, the focus is on this text only."),
|
|
1510
1461
|
modelToUse: z
|
|
1511
|
-
.enum(
|
|
1512
|
-
|
|
1513
|
-
"
|
|
1514
|
-
"claude-fable-5",
|
|
1515
|
-
"gemini-2.5-pro",
|
|
1516
|
-
"gemini-2.5-flash",
|
|
1517
|
-
"gemini-2.5-flash-lite",
|
|
1518
|
-
"grok-4.1-fast-non-reasoning",
|
|
1519
|
-
"grok-4.1-fast-reasoning",
|
|
1520
|
-
"gpt-4o",
|
|
1521
|
-
"gpt-4o-mini",
|
|
1522
|
-
"gpt-5.4",
|
|
1523
|
-
"gpt-5.4-mini",
|
|
1524
|
-
"gpt-5.6-terra",
|
|
1525
|
-
"gpt-5.6-sol",
|
|
1526
|
-
])
|
|
1527
|
-
.default("gpt-5.4")
|
|
1528
|
-
.describe("AI model to use for generating insights: claude-opus-5, claude-sonnet-5, claude-fable-5, gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite, grok-4.1-fast-non-reasoning, grok-4.1-fast-reasoning, gpt-4o, gpt-4o-mini, gpt-5.4, gpt-5.4-mini, gpt-5.6-terra, gpt-5.6-sol"),
|
|
1462
|
+
.enum(AI_MODELS)
|
|
1463
|
+
.default(DEFAULT_AI_MODEL)
|
|
1464
|
+
.describe("AI model to use for generating insights. Default: gpt-6.1-terra."),
|
|
1529
1465
|
});
|
|
1530
1466
|
export const DevelopTextToolSchema = DevelopTextToolSchemaBase.refine((data) => (data.text !== undefined && data.text.trim().length > 0) ||
|
|
1531
1467
|
(data.url !== undefined && data.url.length > 0) ||
|
|
@@ -1711,28 +1647,23 @@ export const OptimizeKnowledgeBaseSchema = z.object({
|
|
|
1711
1647
|
.max(2)
|
|
1712
1648
|
.optional()
|
|
1713
1649
|
.describe("Up to two other saved graphs of the same project to compare against (e.g. repo-<project>-structure when the primary is the digest, or docs when the primary is code). Each comparison reports what the other layer covers that the primary lacks, and the reverse — rules without code, code without documentation, features described but not built. Requires the primary to be a saved graph: graphName, or statements/text with saveAs."),
|
|
1650
|
+
optimize: z
|
|
1651
|
+
.enum(["optimize", "develop", "latent"])
|
|
1652
|
+
.default("optimize")
|
|
1653
|
+
.describe(`Which clusters the suggestions work on. ${OPTIMIZE_MODE_OPTIMIZE}. ${OPTIMIZE_MODE_DEVELOP}. ${OPTIMIZE_MODE_LATENT}, with ideas that go beyond the current content. ${INSIGHT_CLUSTERS_RETURNED}`),
|
|
1654
|
+
gapDepth: z
|
|
1655
|
+
.number()
|
|
1656
|
+
.int()
|
|
1657
|
+
.min(0)
|
|
1658
|
+
.default(0)
|
|
1659
|
+
.describe("With optimize 'optimize': which insight clusters the suggestions use. 0 is the first set; raise it on a later call to get suggestions for the next, less prominent set, so repeated calls work through the graph."),
|
|
1714
1660
|
includeLatent: z
|
|
1715
1661
|
.boolean()
|
|
1716
|
-
.
|
|
1717
|
-
.describe("Also run the latent-topics pass (one extra AI call) to list under-developed areas with ideas on how to develop them.
|
|
1662
|
+
.optional()
|
|
1663
|
+
.describe("Also run the latent-topics pass (one extra AI call) to list under-developed areas with ideas on how to develop them. When omitted it runs with optimize 'develop' and not with 'optimize', whose suggestions follow the insight clusters only. Never run a second time when optimize is 'latent'."),
|
|
1718
1664
|
modelToUse: z
|
|
1719
|
-
.enum(
|
|
1720
|
-
|
|
1721
|
-
"claude-sonnet-5",
|
|
1722
|
-
"claude-fable-5",
|
|
1723
|
-
"gemini-2.5-pro",
|
|
1724
|
-
"gemini-2.5-flash",
|
|
1725
|
-
"gemini-2.5-flash-lite",
|
|
1726
|
-
"grok-4.1-fast-non-reasoning",
|
|
1727
|
-
"grok-4.1-fast-reasoning",
|
|
1728
|
-
"gpt-4o",
|
|
1729
|
-
"gpt-4o-mini",
|
|
1730
|
-
"gpt-5.4",
|
|
1731
|
-
"gpt-5.4-mini",
|
|
1732
|
-
"gpt-5.6-terra",
|
|
1733
|
-
"gpt-5.6-sol",
|
|
1734
|
-
])
|
|
1735
|
-
.default("gpt-5.4")
|
|
1665
|
+
.enum(AI_MODELS)
|
|
1666
|
+
.default(DEFAULT_AI_MODEL)
|
|
1736
1667
|
.describe("AI model for the development suggestions and latent-topic ideas."),
|
|
1737
1668
|
});
|
|
1738
1669
|
// ---------------------------------------------------------------------------
|