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.
@@ -1,42 +1,33 @@
1
- # Indra: Versioned Thinking Tools
1
+ # Indra: Your Knowledge Memory
2
2
 
3
- You have access to **Indra**, a knowledge graph for externalizing and versioning your reasoning. Use it proactively during complex tasks.
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
- **Search first** when starting work on a topic - you may have prior insights:
8
- - `indra_search` - Find related thoughts before duplicating work
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
- **Remember** key insights as you work:
11
- - Observations, hypotheses, conclusions
12
- - Important patterns or surprises
13
- - Decisions and their rationale
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
- | Situation | Tool |
26
- |-----------|------|
27
- | Starting a task | `indra_search` for prior context |
28
- | Key insight | `indra_remember` to capture it |
29
- | Building on prior thought | `indra_connect` with relationship |
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
- ## Example Flow
27
+ ## Why This Matters
34
28
 
35
- ```
36
- 1. indra_search "database optimization" find prior work
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 Indra to make your reasoning visible and traceable.
32
+ Use `indra_search` BEFORE answering preference/recommendation questions.
33
+ Use `indra_remember` AFTER providing analysis worth preserving.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "indra_db_mcp",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "MCP server for indra_db - a content-addressed graph database for versioned thoughts",
5
5
  "type": "module",
6
6
  "bin": {
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: Versioned Thinking Tools
36
-
37
- ## What These Tools Do
38
- Indra provides a **knowledge graph for externalizing and versioning your reasoning**.
39
- Think of it as git for your thoughts - capture insights, connect ideas, and track how
40
- your understanding evolves over time.
41
-
42
- ## When To Search For These Tools
43
- Use Indra tools when you are:
44
- - **Starting complex analysis** - Search for prior insights on the topic before beginning
45
- - **Having key insights** - Capture important observations, hypotheses, or conclusions
46
- - **Building on prior work** - Connect new thoughts to previous ones
47
- - **Exploring alternatives** - Branch to try different approaches without losing progress
48
- - **Completing a unit of work** - Checkpoint your progress with a meaningful summary
49
-
50
- ## Key Capabilities
51
- - \`indra_search\` - Find prior thoughts by semantic meaning (not just keywords)
52
- - \`indra_remember\` - Capture a thought with optional memorable ID
53
- - \`indra_connect\` - Link thoughts with typed relationships (supports, contradicts, derives_from, etc.)
54
- - \`indra_branch\` / \`indra_switch_branch\` - Explore alternative lines of reasoning
55
- - \`indra_checkpoint\` - Save progress with a descriptive commit message
56
- - \`indra_list_thoughts\` / \`indra_explore\` - Review current state and connections
57
-
58
- ## Usage Pattern
59
- 1. Start sessions with \`indra_search\` to find relevant prior work
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
- `🧠 CAPTURE A THOUGHT - Crystallize an idea, insight, or realization into the knowledge graph.
115
+ `📝 SAVE INSIGHTS FOR LATER - Record useful information you've learned or analyzed.
122
116
 
123
- Use this when you:
124
- - Have an insight worth preserving
125
- - Want to externalize part of your reasoning
126
- - Need to create a reference point for later
127
- - Are building understanding incrementally
128
-
129
- The thought will be embedded for semantic search, allowing you to find it later
130
- by meaning rather than exact words. Each thought becomes a node that can be
131
- connected to others, forming a web of understanding.
132
-
133
- This is how you think out loud - make your reasoning visible and traceable.
134
-
135
- PROACTIVE TRIGGERS - Use this tool when you notice yourself:
136
- - Making a key observation or having an "aha" moment
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`,
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
- `🔮 SEMANTIC SEARCH - Find thoughts by meaning, not just keywords.
359
+ `🔍 CHECK PRIOR KNOWLEDGE - Search for relevant context before answering questions.
369
360
 
370
- This is powerful: describe what you're looking for conceptually, and find
371
- thoughts that match semantically. The embeddings capture meaning, so:
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
- - "initial hypothesis" might find "my first theory about X"
374
- - "things that went wrong" might find "problems encountered"
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
- Higher scores = more semantically similar.
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
- PROACTIVE TRIGGERS - Use this tool when you:
386
- - Start working on a new task (search for related prior work)
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"),