indra_db_mcp 0.1.6 → 0.1.7
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 +58 -71
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,34 @@ 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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
+
When you figure something out, save it. Next time, search for it first.
|
|
40
|
+
|
|
41
|
+
## CRITICAL: When To Use These Tools
|
|
42
|
+
|
|
43
|
+
### BEFORE answering questions, use \`indra_search\`:
|
|
44
|
+
- "What should I..." → Search for prior recommendations on this topic
|
|
45
|
+
- "Which X is better..." → Search for past analysis of similar choices
|
|
46
|
+
- "How do I..." → Search for previous explanations you've given
|
|
47
|
+
- Any question about preferences, decisions, or past work
|
|
48
|
+
|
|
49
|
+
### AFTER providing analysis, use \`indra_remember\`:
|
|
50
|
+
- You made a recommendation → Save WHY you recommended it
|
|
51
|
+
- You explained something → Save the key insight
|
|
52
|
+
- You analyzed options → Save your conclusions
|
|
53
|
+
- You learned about user preferences → Save that context
|
|
54
|
+
|
|
55
|
+
## Why This Matters
|
|
56
|
+
Without using these tools, every conversation starts from zero.
|
|
57
|
+
With these tools, you build cumulative knowledge that improves over time.
|
|
58
|
+
|
|
59
|
+
## Quick Reference
|
|
60
|
+
- \`indra_search "topic"\` - Find what you know about a topic BEFORE answering
|
|
61
|
+
- \`indra_remember "insight"\` - Save your analysis AFTER answering
|
|
62
|
+
- \`indra_checkpoint "summary"\` - Mark completion of a unit of work`;
|
|
66
63
|
|
|
67
64
|
const server = new McpServer(
|
|
68
65
|
{
|
|
@@ -118,27 +115,22 @@ function formatError(error: unknown): { content: Array<{ type: "text"; text: str
|
|
|
118
115
|
|
|
119
116
|
server.tool(
|
|
120
117
|
"remember",
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
-
|
|
125
|
-
-
|
|
126
|
-
-
|
|
127
|
-
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
-
|
|
137
|
-
- Identifying an important pattern or insight
|
|
138
|
-
- Drawing a conclusion from analysis
|
|
139
|
-
- Forming a hypothesis or assumption
|
|
140
|
-
- Noting something surprising or unexpected
|
|
141
|
-
- Making a decision with rationale worth preserving`,
|
|
118
|
+
`📝 SAVE YOUR ANALYSIS - Record your reasoning, conclusions, or recommendations for future reference.
|
|
119
|
+
|
|
120
|
+
USE THIS AFTER you:
|
|
121
|
+
- Make a recommendation or decision (save WHY you recommended it)
|
|
122
|
+
- Answer a question that required analysis (save your reasoning)
|
|
123
|
+
- Figure something out (save the insight so you don't forget)
|
|
124
|
+
- Learn something about the user's preferences, situation, or context
|
|
125
|
+
|
|
126
|
+
This creates a searchable record. Next time a similar question comes up,
|
|
127
|
+
you can find your prior analysis instead of starting from scratch.
|
|
128
|
+
|
|
129
|
+
WHEN TO USE:
|
|
130
|
+
- After answering "which X should I use?" → save your recommendation rationale
|
|
131
|
+
- After explaining something complex → save the key insight
|
|
132
|
+
- After analyzing a problem → save your conclusions
|
|
133
|
+
- When you notice a pattern → save it for future reference`,
|
|
142
134
|
{
|
|
143
135
|
content: z.string().describe("The thought to capture - be specific and self-contained"),
|
|
144
136
|
id: z.string().optional().describe("Optional memorable identifier (e.g., 'key-insight-about-X'). Auto-generated if not provided."),
|
|
@@ -365,29 +357,24 @@ find related concepts, or understand context.`,
|
|
|
365
357
|
|
|
366
358
|
server.tool(
|
|
367
359
|
"search",
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
This is powerful: describe what you're looking for conceptually, and find
|
|
371
|
-
thoughts that match semantically. The embeddings capture meaning, so:
|
|
360
|
+
`🔍 CHECK PRIOR KNOWLEDGE - Search for relevant context before answering questions.
|
|
372
361
|
|
|
373
|
-
|
|
374
|
-
-
|
|
375
|
-
-
|
|
362
|
+
CALL THIS FIRST when:
|
|
363
|
+
- Answering questions about user preferences ("what do I like?", "which should I use?")
|
|
364
|
+
- Making recommendations that might have prior context
|
|
365
|
+
- Addressing topics you may have analyzed before
|
|
366
|
+
- The user asks something that sounds familiar
|
|
376
367
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
- Find thoughts to connect
|
|
380
|
-
- Check if you've already captured something similar
|
|
381
|
-
- Surface related ideas you may have forgotten
|
|
368
|
+
This searches your saved analyses, recommendations, and insights by meaning.
|
|
369
|
+
If you've reasoned about this topic before, you'll find it here.
|
|
382
370
|
|
|
383
|
-
|
|
371
|
+
EXAMPLES:
|
|
372
|
+
- User asks "what shoes for the gym?" → search "gym shoes recommendation"
|
|
373
|
+
- User asks "how should I structure this?" → search "architecture decisions"
|
|
374
|
+
- User asks "what's my preference?" → search the relevant topic
|
|
384
375
|
|
|
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"`,
|
|
376
|
+
Returns prior insights ranked by relevance. Use them to give consistent,
|
|
377
|
+
informed answers that build on past reasoning.`,
|
|
391
378
|
{
|
|
392
379
|
query: z.string().describe("What you're looking for - describe the meaning/concept"),
|
|
393
380
|
limit: z.number().min(1).max(100).default(10).describe("Maximum results to return"),
|