indra_db_mcp 0.1.6 → 0.1.8
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/INDRA_INSTRUCTIONS.md +22 -31
- package/package.json +1 -1
- package/src/index.ts +56 -70
package/INDRA_INSTRUCTIONS.md
CHANGED
|
@@ -1,42 +1,33 @@
|
|
|
1
|
-
# Indra:
|
|
1
|
+
# Indra: Your Knowledge Memory
|
|
2
2
|
|
|
3
|
-
You have access to **Indra**, a
|
|
3
|
+
You have access to **Indra**, a persistent memory for your insights and analysis.
|
|
4
4
|
|
|
5
5
|
## When to Use Indra
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
-
|
|
7
|
+
### BEFORE answering questions → `indra_search`
|
|
8
|
+
- "What should I..." → Search for prior recommendations
|
|
9
|
+
- "Which X is better..." → Search for past analysis
|
|
10
|
+
- "How do I..." → Search for previous explanations
|
|
11
|
+
- Any question about preferences, decisions, or past work
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
**Connect** related thoughts to build understanding:
|
|
16
|
-
- Link new insights to prior ones (derives_from, supports, contradicts)
|
|
17
|
-
- Build chains of reasoning visible in the graph
|
|
18
|
-
|
|
19
|
-
**Branch** when exploring alternatives:
|
|
20
|
-
- Create branches for "what if" scenarios
|
|
21
|
-
- Compare different approaches
|
|
13
|
+
### AFTER providing analysis → `indra_remember`
|
|
14
|
+
- You made a recommendation → Save WHY you recommended it
|
|
15
|
+
- You explained something → Save the key insight
|
|
16
|
+
- You analyzed options → Save your conclusions
|
|
17
|
+
- You learned user preferences → Save that context
|
|
22
18
|
|
|
23
19
|
## Quick Reference
|
|
24
20
|
|
|
25
|
-
|
|
|
26
|
-
|
|
27
|
-
|
|
|
28
|
-
|
|
|
29
|
-
|
|
|
30
|
-
| Exploring alternative | `indra_branch` then explore |
|
|
31
|
-
| Finished analysis | `indra_checkpoint` with summary |
|
|
21
|
+
| When | Tool | Example |
|
|
22
|
+
|------|------|---------|
|
|
23
|
+
| Before answering | `indra_search` | Search "gym shoes recommendation" |
|
|
24
|
+
| After analyzing | `indra_remember` | Save "Recommended Hokas for cycling because..." |
|
|
25
|
+
| Finishing a task | `indra_checkpoint` | "Completed workout gear analysis" |
|
|
32
26
|
|
|
33
|
-
##
|
|
27
|
+
## Why This Matters
|
|
34
28
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
2. indra_remember "Identified N+1 query in user loader" --id n-plus-one-finding
|
|
38
|
-
3. indra_connect n-plus-one-finding --to prior-perf-analysis --relationship derives_from
|
|
39
|
-
4. indra_checkpoint "Completed initial performance analysis"
|
|
40
|
-
```
|
|
29
|
+
Without Indra, every conversation starts from zero.
|
|
30
|
+
With Indra, you build cumulative knowledge that improves over time.
|
|
41
31
|
|
|
42
|
-
Use
|
|
32
|
+
Use `indra_search` BEFORE answering preference/recommendation questions.
|
|
33
|
+
Use `indra_remember` AFTER providing analysis worth preserving.
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -32,37 +32,31 @@ import { EdgeTypes, IndraError } from "./types.js";
|
|
|
32
32
|
* 2. When Claude should search for these tools
|
|
33
33
|
* 3. Key capabilities the server provides
|
|
34
34
|
*/
|
|
35
|
-
const SERVER_INSTRUCTIONS = `# Indra:
|
|
36
|
-
|
|
37
|
-
## What
|
|
38
|
-
Indra
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
2. Use \`indra_remember\` to capture key insights as you work
|
|
61
|
-
3. Use \`indra_connect\` to link related thoughts
|
|
62
|
-
4. Use \`indra_checkpoint\` when completing logical units of analysis
|
|
63
|
-
|
|
64
|
-
The user has configured Indra because they want their reasoning process externalized
|
|
65
|
-
and versioned. Use these tools proactively during complex tasks.`;
|
|
35
|
+
const SERVER_INSTRUCTIONS = `# Indra: Your Knowledge Memory
|
|
36
|
+
|
|
37
|
+
## What This Is
|
|
38
|
+
Indra is your persistent memory for insights, recommendations, and analysis.
|
|
39
|
+
The user has configured this because they WANT you to build cumulative knowledge.
|
|
40
|
+
|
|
41
|
+
## CRITICAL: When To Use These Tools
|
|
42
|
+
|
|
43
|
+
### BEFORE answering questions → \`indra_search\`
|
|
44
|
+
Search for prior knowledge when the user asks about:
|
|
45
|
+
- Preferences, recommendations, or choices
|
|
46
|
+
- Topics you may have discussed before
|
|
47
|
+
- Anything that sounds familiar
|
|
48
|
+
|
|
49
|
+
### AFTER learning something useful → \`indra_remember\`
|
|
50
|
+
**Don't ask permission. Just save it.** The user configured Indra because they want this.
|
|
51
|
+
Save when you:
|
|
52
|
+
- Learn user preferences or context
|
|
53
|
+
- Make recommendations with reasoning
|
|
54
|
+
- Discover patterns or insights
|
|
55
|
+
|
|
56
|
+
## The Pattern
|
|
57
|
+
1. Search first (check what you know)
|
|
58
|
+
2. Answer the question
|
|
59
|
+
3. Save what you learned (don't ask, just do it)`;
|
|
66
60
|
|
|
67
61
|
const server = new McpServer(
|
|
68
62
|
{
|
|
@@ -118,27 +112,24 @@ function formatError(error: unknown): { content: Array<{ type: "text"; text: str
|
|
|
118
112
|
|
|
119
113
|
server.tool(
|
|
120
114
|
"remember",
|
|
121
|
-
|
|
115
|
+
`📝 SAVE INSIGHTS FOR LATER - Record useful information you've learned or analyzed.
|
|
122
116
|
|
|
123
|
-
|
|
124
|
-
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
- Forming a hypothesis or assumption
|
|
140
|
-
- Noting something surprising or unexpected
|
|
141
|
-
- Making a decision with rationale worth preserving`,
|
|
117
|
+
The user has configured this tool because they WANT you to save insights.
|
|
118
|
+
Don't ask permission - if you learned something useful, save it.
|
|
119
|
+
|
|
120
|
+
SAVE when you:
|
|
121
|
+
- Learn about user preferences (shoe choices, workout patterns, etc.)
|
|
122
|
+
- Make a recommendation with reasoning worth preserving
|
|
123
|
+
- Discover something about the user's situation or context
|
|
124
|
+
- Analyze something that might be relevant again
|
|
125
|
+
|
|
126
|
+
WHAT TO SAVE:
|
|
127
|
+
- Key facts: "User is switching from Altra to Hoka for arch support"
|
|
128
|
+
- Recommendations: "Recommended Hokas for cycling due to PF recovery"
|
|
129
|
+
- Patterns: "User prefers cushioned shoes for recovery periods"
|
|
130
|
+
- Context: "User has plantar fasciitis, resting foot this week"
|
|
131
|
+
|
|
132
|
+
This creates searchable memory. Future sessions can find this context.`,
|
|
142
133
|
{
|
|
143
134
|
content: z.string().describe("The thought to capture - be specific and self-contained"),
|
|
144
135
|
id: z.string().optional().describe("Optional memorable identifier (e.g., 'key-insight-about-X'). Auto-generated if not provided."),
|
|
@@ -365,29 +356,24 @@ find related concepts, or understand context.`,
|
|
|
365
356
|
|
|
366
357
|
server.tool(
|
|
367
358
|
"search",
|
|
368
|
-
|
|
359
|
+
`🔍 CHECK PRIOR KNOWLEDGE - Search for relevant context before answering questions.
|
|
369
360
|
|
|
370
|
-
|
|
371
|
-
|
|
361
|
+
CALL THIS FIRST when:
|
|
362
|
+
- Answering questions about user preferences ("what do I like?", "which should I use?")
|
|
363
|
+
- Making recommendations that might have prior context
|
|
364
|
+
- Addressing topics you may have analyzed before
|
|
365
|
+
- The user asks something that sounds familiar
|
|
372
366
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
- "key decisions" might find "we chose to..."
|
|
376
|
-
|
|
377
|
-
Use this to:
|
|
378
|
-
- Rediscover relevant prior thinking
|
|
379
|
-
- Find thoughts to connect
|
|
380
|
-
- Check if you've already captured something similar
|
|
381
|
-
- Surface related ideas you may have forgotten
|
|
367
|
+
This searches your saved analyses, recommendations, and insights by meaning.
|
|
368
|
+
If you've reasoned about this topic before, you'll find it here.
|
|
382
369
|
|
|
383
|
-
|
|
370
|
+
EXAMPLES:
|
|
371
|
+
- User asks "what shoes for the gym?" → search "gym shoes recommendation"
|
|
372
|
+
- User asks "how should I structure this?" → search "architecture decisions"
|
|
373
|
+
- User asks "what's my preference?" → search the relevant topic
|
|
384
374
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
- Need context on a topic you've explored before
|
|
388
|
-
- Want to avoid duplicating previous insights
|
|
389
|
-
- Are about to make a decision (check if you've reasoned about this)
|
|
390
|
-
- Feel like "I think I've thought about this before"`,
|
|
375
|
+
Returns prior insights ranked by relevance. Use them to give consistent,
|
|
376
|
+
informed answers that build on past reasoning.`,
|
|
391
377
|
{
|
|
392
378
|
query: z.string().describe("What you're looking for - describe the meaning/concept"),
|
|
393
379
|
limit: z.number().min(1).max(100).default(10).describe("Maximum results to return"),
|