mindgraph-mcp 0.3.2 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +53 -42
- package/dist/index.js +53 -42
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -874,7 +874,7 @@ var init_tools = __esm({
|
|
|
874
874
|
},
|
|
875
875
|
{
|
|
876
876
|
name: "mindgraph_retrieve",
|
|
877
|
-
description: "Search
|
|
877
|
+
description: "Search the knowledge graph using BM25 keyword matching. Primary action: 'context' \u2014 pass 1\u20133 discriminating keywords (proper nouns, technical terms) extracted from the user's question. Drop filler words (what, how, tell me about, implications of). GOOD: 'Kissinger NATO', 'Rust async runtime'. BAD: 'What is Kissinger\\'s view on NATO?'. Use 'text' for fast keyword-only lookup. Other actions ('active_goals', 'open_questions', 'weak_claims', 'pending_approvals', 'unresolved_contradictions', 'layer', 'recent') are ONLY for when the user explicitly asks about those topics \u2014 never pre-fetch them.",
|
|
878
878
|
inputSchema: {
|
|
879
879
|
type: "object",
|
|
880
880
|
properties: {
|
|
@@ -895,7 +895,7 @@ var init_tools = __esm({
|
|
|
895
895
|
},
|
|
896
896
|
query: {
|
|
897
897
|
type: "string",
|
|
898
|
-
description: "
|
|
898
|
+
description: "BM25 keyword query \u2014 extract 1\u20133 discriminating terms from the user's question, drop filler words. User asks 'What is Kissinger's view on NATO?' \u2192 'Kissinger NATO'. User asks about async in Rust \u2192 'Rust async runtime'. NEVER pass natural language sentences. (for text, context)"
|
|
899
899
|
},
|
|
900
900
|
node_types: {
|
|
901
901
|
type: "array",
|
|
@@ -1039,61 +1039,72 @@ var init_src = __esm({
|
|
|
1039
1039
|
baseUrl: BASE_URL,
|
|
1040
1040
|
apiKey: API_KEY
|
|
1041
1041
|
});
|
|
1042
|
-
INSTRUCTIONS = `You have access to a persistent knowledge graph via MindGraph.
|
|
1042
|
+
INSTRUCTIONS = `You have access to a persistent knowledge graph via MindGraph.
|
|
1043
1043
|
|
|
1044
|
-
##
|
|
1044
|
+
## #1 RULE: Go straight to the user's topic
|
|
1045
1045
|
|
|
1046
|
-
|
|
1047
|
-
- **Parallelize tool calls.** When you need to search and capture at the same time, issue all calls in a single parallel batch \u2014 never serialize independent calls.
|
|
1046
|
+
When the user asks about something, your FIRST and ONLY action should be a SINGLE \`mindgraph_retrieve\` call with action "context" and keyword terms from their message. Nothing else first.
|
|
1048
1047
|
|
|
1049
|
-
|
|
1048
|
+
**NEVER do any of these before addressing the user's topic:**
|
|
1049
|
+
- Do NOT retrieve active_goals
|
|
1050
|
+
- Do NOT retrieve open_questions
|
|
1051
|
+
- Do NOT retrieve contradictions or weak_claims
|
|
1052
|
+
- Do NOT follow a "session lifecycle" or "warm-up" sequence
|
|
1053
|
+
- Do NOT make multiple serial retrieve calls when one "context" call covers it
|
|
1050
1054
|
|
|
1051
|
-
|
|
1052
|
-
- User asks about a topic \u2192 \`mindgraph_retrieve\` with action "context" and keyword query
|
|
1053
|
-
- User asks about goals \u2192 \`mindgraph_retrieve\` with action "active_goals"
|
|
1054
|
-
- User asks about open questions \u2192 \`mindgraph_retrieve\` with action "open_questions"
|
|
1055
|
-
- Before asserting something the user previously told you \u2192 retrieve to check
|
|
1055
|
+
There is no session to open. There is no context to pre-load. Just search for what the user asked about.
|
|
1056
1056
|
|
|
1057
|
-
|
|
1057
|
+
**Example:** User says "Tell me about Indian philosophy and Taoism"
|
|
1058
|
+
\u2713 CORRECT: \`mindgraph_retrieve({action: "context", query: "Indian philosophy Taoism"})\` \u2014 extracted key nouns, dropped "Tell me about"
|
|
1059
|
+
\u2717 WRONG: First retrieve active_goals, then open_questions, then search for the topic
|
|
1060
|
+
\u2717 WRONG: \`mindgraph_retrieve({action: "context", query: "Tell me about Indian philosophy and Taoism"})\` \u2014 natural language sentence won't match BM25 index
|
|
1058
1061
|
|
|
1059
|
-
## Search query style
|
|
1062
|
+
## Search query style \u2014 BM25 keyword matching
|
|
1060
1063
|
|
|
1061
|
-
|
|
1062
|
-
- GOOD: \`"Rust async runtime"\`, \`"project deadline March"\`, \`"Sarah engineering manager"\`
|
|
1063
|
-
- BAD: \`"what do I know about async programming in Rust?"\`, \`"tell me about Sarah's role"\`
|
|
1064
|
+
The search index uses BM25 keyword matching against node labels and summaries. It matches individual words, NOT meaning or concepts. Drop filler words like "what", "how", "implications of", "tell me about". Query with 1\u20133 discriminating terms (proper nouns, technical terms, domain-specific words).
|
|
1064
1065
|
|
|
1065
|
-
|
|
1066
|
+
**Derive keywords from the user's question \u2014 examples:**
|
|
1067
|
+
- User asks "What is Kissinger's view on NATO expansion?" \u2192 query: \`"Kissinger NATO"\`
|
|
1068
|
+
- User asks "Tell me about async programming in Rust" \u2192 query: \`"Rust async runtime"\`
|
|
1069
|
+
- User asks "How does Indian philosophy relate to Taoism?" \u2192 query: \`"Indian philosophy Taoism"\`
|
|
1070
|
+
- User asks "What are the implications of carbon tax policy?" \u2192 query: \`"carbon tax"\`
|
|
1066
1071
|
|
|
1067
|
-
|
|
1072
|
+
**GOOD queries:** \`"Rust async runtime"\`, \`"Kissinger NATO"\`, \`"carbon tax emissions"\`
|
|
1073
|
+
**BAD queries:** \`"what do I know about async programming in Rust?"\`, \`"how does X relate to Y"\`, \`"implications of climate change"\`
|
|
1068
1074
|
|
|
1069
|
-
|
|
1070
|
-
- **People, organizations, places, events** \u2192 \`mindgraph_capture\` with action "entity"
|
|
1071
|
-
- **Quick notes, preferences, reflections, moods** \u2192 \`mindgraph_journal\`
|
|
1072
|
-
- **Factual observations** \u2192 \`mindgraph_capture\` with action "observation"
|
|
1073
|
-
- **Claims with evidence** \u2192 \`mindgraph_argue\`
|
|
1074
|
-
- **Questions to track** \u2192 \`mindgraph_inquire\` with action "open_question"
|
|
1075
|
-
- **Hypotheses or theories** \u2192 \`mindgraph_inquire\` with action "hypothesis" or "theory"
|
|
1076
|
-
- **Goals or projects** \u2192 \`mindgraph_commit\`
|
|
1077
|
-
- **Decisions** \u2192 \`mindgraph_decide\`
|
|
1078
|
-
- **Long-form content** \u2192 \`mindgraph_ingest\`
|
|
1075
|
+
If the first query returns no results, try synonym or related terms (e.g. \`"global warming"\` instead of \`"climate change"\`).
|
|
1079
1076
|
|
|
1080
|
-
##
|
|
1077
|
+
## When to READ
|
|
1081
1078
|
|
|
1082
|
-
-
|
|
1083
|
-
-
|
|
1084
|
-
-
|
|
1085
|
-
-
|
|
1079
|
+
- User asks about topic X \u2192 \`mindgraph_retrieve\` action "context", query "X keywords"
|
|
1080
|
+
- User explicitly asks "what are my goals?" \u2192 action "active_goals"
|
|
1081
|
+
- User explicitly asks about open questions \u2192 action "open_questions"
|
|
1082
|
+
- Before asserting something the user previously said \u2192 retrieve to check
|
|
1083
|
+
- Parallelize independent calls in a single batch
|
|
1086
1084
|
|
|
1087
|
-
##
|
|
1085
|
+
## When to WRITE
|
|
1088
1086
|
|
|
1089
|
-
|
|
1090
|
-
-
|
|
1091
|
-
-
|
|
1092
|
-
-
|
|
1087
|
+
Capture knowledge when the user shares something worth remembering:
|
|
1088
|
+
- People/orgs/places/events \u2192 \`mindgraph_capture\` action "entity"
|
|
1089
|
+
- Quick notes, preferences \u2192 \`mindgraph_journal\`
|
|
1090
|
+
- Factual observations \u2192 \`mindgraph_capture\` action "observation"
|
|
1091
|
+
- Claims with evidence \u2192 \`mindgraph_argue\`
|
|
1092
|
+
- Questions to track \u2192 \`mindgraph_inquire\` action "open_question"
|
|
1093
|
+
- Goals or projects \u2192 \`mindgraph_commit\`
|
|
1094
|
+
- Decisions \u2192 \`mindgraph_decide\`
|
|
1095
|
+
- Long-form content \u2192 \`mindgraph_ingest\`
|
|
1096
|
+
|
|
1097
|
+
## Tool tips
|
|
1098
|
+
|
|
1099
|
+
- \`capture\` for structured/factual, \`journal\` for personal/informal
|
|
1100
|
+
- \`argue\` when evidence exists, \`inquire\` for open questions
|
|
1101
|
+
- \`text\` for fast lookup, \`context\` for rich retrieval with graph traversal
|
|
1102
|
+
- Confidence: 0.9+ for facts, 0.5-0.8 for uncertain, <0.5 for speculation
|
|
1103
|
+
- Don't narrate tool usage \u2014 capture naturally as part of conversation`;
|
|
1093
1104
|
server = new import_server.Server(
|
|
1094
1105
|
{
|
|
1095
1106
|
name: "mindgraph",
|
|
1096
|
-
version: "0.
|
|
1107
|
+
version: "0.3.4"
|
|
1097
1108
|
},
|
|
1098
1109
|
{
|
|
1099
1110
|
capabilities: {
|
|
@@ -1226,7 +1237,7 @@ Store knowledge whenever the user shares something worth remembering:
|
|
|
1226
1237
|
role: "user",
|
|
1227
1238
|
content: {
|
|
1228
1239
|
type: "text",
|
|
1229
|
-
text: `Search my knowledge graph for everything related to "${topic}". Use context retrieval with keyword queries
|
|
1240
|
+
text: `Search my knowledge graph for everything related to "${topic}". Use context retrieval with short BM25 keyword queries (1\u20133 discriminating terms extracted from the topic, not full sentences). Try multiple keyword variations and synonyms to ensure broad coverage. Present a structured overview of what I know about this topic, highlighting any gaps or open questions.`
|
|
1230
1241
|
}
|
|
1231
1242
|
}
|
|
1232
1243
|
]
|
|
@@ -1321,7 +1332,7 @@ ${conversation}`
|
|
|
1321
1332
|
{
|
|
1322
1333
|
uriTemplate: "mindgraph://search/{query}",
|
|
1323
1334
|
name: "Search Results",
|
|
1324
|
-
description: "
|
|
1335
|
+
description: "BM25 keyword search across all nodes \u2014 pass 1\u20133 discriminating terms (e.g. 'Kissinger NATO'), not natural language sentences",
|
|
1325
1336
|
mimeType: "application/json"
|
|
1326
1337
|
},
|
|
1327
1338
|
{
|
package/dist/index.js
CHANGED
|
@@ -389,7 +389,7 @@ var TOOLS = [
|
|
|
389
389
|
},
|
|
390
390
|
{
|
|
391
391
|
name: "mindgraph_retrieve",
|
|
392
|
-
description: "Search
|
|
392
|
+
description: "Search the knowledge graph using BM25 keyword matching. Primary action: 'context' \u2014 pass 1\u20133 discriminating keywords (proper nouns, technical terms) extracted from the user's question. Drop filler words (what, how, tell me about, implications of). GOOD: 'Kissinger NATO', 'Rust async runtime'. BAD: 'What is Kissinger\\'s view on NATO?'. Use 'text' for fast keyword-only lookup. Other actions ('active_goals', 'open_questions', 'weak_claims', 'pending_approvals', 'unresolved_contradictions', 'layer', 'recent') are ONLY for when the user explicitly asks about those topics \u2014 never pre-fetch them.",
|
|
393
393
|
inputSchema: {
|
|
394
394
|
type: "object",
|
|
395
395
|
properties: {
|
|
@@ -410,7 +410,7 @@ var TOOLS = [
|
|
|
410
410
|
},
|
|
411
411
|
query: {
|
|
412
412
|
type: "string",
|
|
413
|
-
description: "
|
|
413
|
+
description: "BM25 keyword query \u2014 extract 1\u20133 discriminating terms from the user's question, drop filler words. User asks 'What is Kissinger's view on NATO?' \u2192 'Kissinger NATO'. User asks about async in Rust \u2192 'Rust async runtime'. NEVER pass natural language sentences. (for text, context)"
|
|
414
414
|
},
|
|
415
415
|
node_types: {
|
|
416
416
|
type: "array",
|
|
@@ -996,61 +996,72 @@ var client = new import_mindgraph.MindGraph({
|
|
|
996
996
|
baseUrl: BASE_URL,
|
|
997
997
|
apiKey: API_KEY
|
|
998
998
|
});
|
|
999
|
-
var INSTRUCTIONS = `You have access to a persistent knowledge graph via MindGraph.
|
|
999
|
+
var INSTRUCTIONS = `You have access to a persistent knowledge graph via MindGraph.
|
|
1000
1000
|
|
|
1001
|
-
##
|
|
1001
|
+
## #1 RULE: Go straight to the user's topic
|
|
1002
1002
|
|
|
1003
|
-
|
|
1004
|
-
- **Parallelize tool calls.** When you need to search and capture at the same time, issue all calls in a single parallel batch \u2014 never serialize independent calls.
|
|
1003
|
+
When the user asks about something, your FIRST and ONLY action should be a SINGLE \`mindgraph_retrieve\` call with action "context" and keyword terms from their message. Nothing else first.
|
|
1005
1004
|
|
|
1006
|
-
|
|
1005
|
+
**NEVER do any of these before addressing the user's topic:**
|
|
1006
|
+
- Do NOT retrieve active_goals
|
|
1007
|
+
- Do NOT retrieve open_questions
|
|
1008
|
+
- Do NOT retrieve contradictions or weak_claims
|
|
1009
|
+
- Do NOT follow a "session lifecycle" or "warm-up" sequence
|
|
1010
|
+
- Do NOT make multiple serial retrieve calls when one "context" call covers it
|
|
1007
1011
|
|
|
1008
|
-
|
|
1009
|
-
- User asks about a topic \u2192 \`mindgraph_retrieve\` with action "context" and keyword query
|
|
1010
|
-
- User asks about goals \u2192 \`mindgraph_retrieve\` with action "active_goals"
|
|
1011
|
-
- User asks about open questions \u2192 \`mindgraph_retrieve\` with action "open_questions"
|
|
1012
|
-
- Before asserting something the user previously told you \u2192 retrieve to check
|
|
1012
|
+
There is no session to open. There is no context to pre-load. Just search for what the user asked about.
|
|
1013
1013
|
|
|
1014
|
-
|
|
1014
|
+
**Example:** User says "Tell me about Indian philosophy and Taoism"
|
|
1015
|
+
\u2713 CORRECT: \`mindgraph_retrieve({action: "context", query: "Indian philosophy Taoism"})\` \u2014 extracted key nouns, dropped "Tell me about"
|
|
1016
|
+
\u2717 WRONG: First retrieve active_goals, then open_questions, then search for the topic
|
|
1017
|
+
\u2717 WRONG: \`mindgraph_retrieve({action: "context", query: "Tell me about Indian philosophy and Taoism"})\` \u2014 natural language sentence won't match BM25 index
|
|
1015
1018
|
|
|
1016
|
-
## Search query style
|
|
1019
|
+
## Search query style \u2014 BM25 keyword matching
|
|
1017
1020
|
|
|
1018
|
-
|
|
1019
|
-
- GOOD: \`"Rust async runtime"\`, \`"project deadline March"\`, \`"Sarah engineering manager"\`
|
|
1020
|
-
- BAD: \`"what do I know about async programming in Rust?"\`, \`"tell me about Sarah's role"\`
|
|
1021
|
+
The search index uses BM25 keyword matching against node labels and summaries. It matches individual words, NOT meaning or concepts. Drop filler words like "what", "how", "implications of", "tell me about". Query with 1\u20133 discriminating terms (proper nouns, technical terms, domain-specific words).
|
|
1021
1022
|
|
|
1022
|
-
|
|
1023
|
+
**Derive keywords from the user's question \u2014 examples:**
|
|
1024
|
+
- User asks "What is Kissinger's view on NATO expansion?" \u2192 query: \`"Kissinger NATO"\`
|
|
1025
|
+
- User asks "Tell me about async programming in Rust" \u2192 query: \`"Rust async runtime"\`
|
|
1026
|
+
- User asks "How does Indian philosophy relate to Taoism?" \u2192 query: \`"Indian philosophy Taoism"\`
|
|
1027
|
+
- User asks "What are the implications of carbon tax policy?" \u2192 query: \`"carbon tax"\`
|
|
1023
1028
|
|
|
1024
|
-
|
|
1029
|
+
**GOOD queries:** \`"Rust async runtime"\`, \`"Kissinger NATO"\`, \`"carbon tax emissions"\`
|
|
1030
|
+
**BAD queries:** \`"what do I know about async programming in Rust?"\`, \`"how does X relate to Y"\`, \`"implications of climate change"\`
|
|
1025
1031
|
|
|
1026
|
-
|
|
1027
|
-
- **People, organizations, places, events** \u2192 \`mindgraph_capture\` with action "entity"
|
|
1028
|
-
- **Quick notes, preferences, reflections, moods** \u2192 \`mindgraph_journal\`
|
|
1029
|
-
- **Factual observations** \u2192 \`mindgraph_capture\` with action "observation"
|
|
1030
|
-
- **Claims with evidence** \u2192 \`mindgraph_argue\`
|
|
1031
|
-
- **Questions to track** \u2192 \`mindgraph_inquire\` with action "open_question"
|
|
1032
|
-
- **Hypotheses or theories** \u2192 \`mindgraph_inquire\` with action "hypothesis" or "theory"
|
|
1033
|
-
- **Goals or projects** \u2192 \`mindgraph_commit\`
|
|
1034
|
-
- **Decisions** \u2192 \`mindgraph_decide\`
|
|
1035
|
-
- **Long-form content** \u2192 \`mindgraph_ingest\`
|
|
1032
|
+
If the first query returns no results, try synonym or related terms (e.g. \`"global warming"\` instead of \`"climate change"\`).
|
|
1036
1033
|
|
|
1037
|
-
##
|
|
1034
|
+
## When to READ
|
|
1038
1035
|
|
|
1039
|
-
-
|
|
1040
|
-
-
|
|
1041
|
-
-
|
|
1042
|
-
-
|
|
1036
|
+
- User asks about topic X \u2192 \`mindgraph_retrieve\` action "context", query "X keywords"
|
|
1037
|
+
- User explicitly asks "what are my goals?" \u2192 action "active_goals"
|
|
1038
|
+
- User explicitly asks about open questions \u2192 action "open_questions"
|
|
1039
|
+
- Before asserting something the user previously said \u2192 retrieve to check
|
|
1040
|
+
- Parallelize independent calls in a single batch
|
|
1043
1041
|
|
|
1044
|
-
##
|
|
1042
|
+
## When to WRITE
|
|
1045
1043
|
|
|
1046
|
-
|
|
1047
|
-
-
|
|
1048
|
-
-
|
|
1049
|
-
-
|
|
1044
|
+
Capture knowledge when the user shares something worth remembering:
|
|
1045
|
+
- People/orgs/places/events \u2192 \`mindgraph_capture\` action "entity"
|
|
1046
|
+
- Quick notes, preferences \u2192 \`mindgraph_journal\`
|
|
1047
|
+
- Factual observations \u2192 \`mindgraph_capture\` action "observation"
|
|
1048
|
+
- Claims with evidence \u2192 \`mindgraph_argue\`
|
|
1049
|
+
- Questions to track \u2192 \`mindgraph_inquire\` action "open_question"
|
|
1050
|
+
- Goals or projects \u2192 \`mindgraph_commit\`
|
|
1051
|
+
- Decisions \u2192 \`mindgraph_decide\`
|
|
1052
|
+
- Long-form content \u2192 \`mindgraph_ingest\`
|
|
1053
|
+
|
|
1054
|
+
## Tool tips
|
|
1055
|
+
|
|
1056
|
+
- \`capture\` for structured/factual, \`journal\` for personal/informal
|
|
1057
|
+
- \`argue\` when evidence exists, \`inquire\` for open questions
|
|
1058
|
+
- \`text\` for fast lookup, \`context\` for rich retrieval with graph traversal
|
|
1059
|
+
- Confidence: 0.9+ for facts, 0.5-0.8 for uncertain, <0.5 for speculation
|
|
1060
|
+
- Don't narrate tool usage \u2014 capture naturally as part of conversation`;
|
|
1050
1061
|
var server = new import_server.Server(
|
|
1051
1062
|
{
|
|
1052
1063
|
name: "mindgraph",
|
|
1053
|
-
version: "0.
|
|
1064
|
+
version: "0.3.4"
|
|
1054
1065
|
},
|
|
1055
1066
|
{
|
|
1056
1067
|
capabilities: {
|
|
@@ -1183,7 +1194,7 @@ server.setRequestHandler(import_types.GetPromptRequestSchema, async (request) =>
|
|
|
1183
1194
|
role: "user",
|
|
1184
1195
|
content: {
|
|
1185
1196
|
type: "text",
|
|
1186
|
-
text: `Search my knowledge graph for everything related to "${topic}". Use context retrieval with keyword queries
|
|
1197
|
+
text: `Search my knowledge graph for everything related to "${topic}". Use context retrieval with short BM25 keyword queries (1\u20133 discriminating terms extracted from the topic, not full sentences). Try multiple keyword variations and synonyms to ensure broad coverage. Present a structured overview of what I know about this topic, highlighting any gaps or open questions.`
|
|
1187
1198
|
}
|
|
1188
1199
|
}
|
|
1189
1200
|
]
|
|
@@ -1278,7 +1289,7 @@ server.setRequestHandler(import_types.ListResourceTemplatesRequestSchema, async
|
|
|
1278
1289
|
{
|
|
1279
1290
|
uriTemplate: "mindgraph://search/{query}",
|
|
1280
1291
|
name: "Search Results",
|
|
1281
|
-
description: "
|
|
1292
|
+
description: "BM25 keyword search across all nodes \u2014 pass 1\u20133 discriminating terms (e.g. 'Kissinger NATO'), not natural language sentences",
|
|
1282
1293
|
mimeType: "application/json"
|
|
1283
1294
|
},
|
|
1284
1295
|
{
|
package/package.json
CHANGED