@duckmind/deepquark-darwin-arm64 0.9.83 → 0.9.90
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/.deepquark/skills/bundled/knowledge-graph/SKILL.md +385 -0
- package/.deepquark/skills/bundled/knowledge-graph/STANDARDS.md +461 -0
- package/.deepquark/skills/bundled/knowledge-graph/lib/cli.ts +588 -0
- package/.deepquark/skills/bundled/knowledge-graph/lib/config.ts +630 -0
- package/.deepquark/skills/bundled/knowledge-graph/lib/connection-profile.ts +629 -0
- package/.deepquark/skills/bundled/knowledge-graph/lib/container.ts +756 -0
- package/.deepquark/skills/bundled/knowledge-graph/lib/mcp-client.ts +1310 -0
- package/.deepquark/skills/bundled/knowledge-graph/lib/output-formatter.ts +997 -0
- package/.deepquark/skills/bundled/knowledge-graph/lib/token-metrics.ts +335 -0
- package/.deepquark/skills/bundled/knowledge-graph/lib/transformation-log.ts +137 -0
- package/.deepquark/skills/bundled/knowledge-graph/lib/wrapper-config.ts +113 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/.env.example +129 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/compare-embeddings.ts +175 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/config-falkordb.yaml +108 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/config-neo4j.yaml +111 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/diagnose.ts +483 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/docker-compose-falkordb-dev.yml +146 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/docker-compose-falkordb.yml +151 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/docker-compose-neo4j-dev-local.yml +161 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/docker-compose-neo4j-dev.yml +161 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/docker-compose-neo4j.yml +169 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/docker-compose-production.yml +128 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/docker-compose-test.yml +10 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/docker-compose.yml +84 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/entrypoint.sh +40 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/install.ts +2054 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/podman-compose-falkordb.yml +78 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/podman-compose-neo4j.yml +88 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/podman-compose.yml +83 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-all-llms-mcp.ts +387 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-embedding-models.ts +201 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-embedding-providers.ts +641 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-graphiti-model.ts +217 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-grok-correct.ts +141 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-grok-llms-mcp.ts +386 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-grok-models.ts +173 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-llama-extraction.ts +188 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-mcp-final.ts +240 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-mcp-live.ts +187 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-mcp-session.ts +127 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-model-combinations.ts +316 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-ollama-models.ts +228 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-openrouter-models.ts +460 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-real-life-mcp.ts +311 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-search-debug.ts +199 -0
- package/.deepquark/skills/bundled/knowledge-graph/tools/Install.md +104 -0
- package/.deepquark/skills/bundled/knowledge-graph/tools/README.md +120 -0
- package/.deepquark/skills/bundled/knowledge-graph/tools/knowledge-cli.ts +996 -0
- package/.deepquark/skills/bundled/knowledge-graph/tools/server-cli.ts +531 -0
- package/.deepquark/skills/bundled/knowledge-graph/workflows/BulkImport.md +514 -0
- package/.deepquark/skills/bundled/knowledge-graph/workflows/CaptureEpisode.md +242 -0
- package/.deepquark/skills/bundled/knowledge-graph/workflows/ClearGraph.md +392 -0
- package/.deepquark/skills/bundled/knowledge-graph/workflows/GetRecent.md +352 -0
- package/.deepquark/skills/bundled/knowledge-graph/workflows/GetStatus.md +373 -0
- package/.deepquark/skills/bundled/knowledge-graph/workflows/HealthReport.md +212 -0
- package/.deepquark/skills/bundled/knowledge-graph/workflows/InvestigateEntity.md +142 -0
- package/.deepquark/skills/bundled/knowledge-graph/workflows/OntologyManagement.md +201 -0
- package/.deepquark/skills/bundled/knowledge-graph/workflows/RunMaintenance.md +302 -0
- package/.deepquark/skills/bundled/knowledge-graph/workflows/SearchByDate.md +255 -0
- package/.deepquark/skills/bundled/knowledge-graph/workflows/SearchFacts.md +382 -0
- package/.deepquark/skills/bundled/knowledge-graph/workflows/SearchKnowledge.md +374 -0
- package/.deepquark/skills/bundled/knowledge-graph/workflows/StixImport.md +212 -0
- package/bin/deepquark +0 -0
- package/package.json +1 -1
- package/.deepquark/skills/bundled/ge-payroll/SKILL.md +0 -153
- package/.deepquark/skills/bundled/ge-payroll/evals/evals.json +0 -23
- package/.deepquark/skills/bundled/ge-payroll/references/pain-points-improvements.md +0 -106
- package/.deepquark/skills/bundled/ge-payroll/references/process-detail.md +0 -217
- package/.deepquark/skills/bundled/ge-payroll/references/raci-stakeholders.md +0 -85
- package/.deepquark/skills/bundled/ge-payroll/references/timeline-mandays.md +0 -64
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
# Capture Episode Workflow
|
|
2
|
+
|
|
3
|
+
**Objective:** Add knowledge to the Graphiti knowledge graph with automatic entity extraction and relationship mapping.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Step 1: Announce Workflow
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
~/.claude/Tools/SkillWorkflowNotification CaptureEpisode MadeinozKnowledgeSystem
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**Output to user:**
|
|
14
|
+
```
|
|
15
|
+
Running the **CaptureEpisode** workflow from the **MadeinozKnowledgeSystem** skill...
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Step 2: Prepare Episode Content
|
|
21
|
+
|
|
22
|
+
**Determine episode source format:**
|
|
23
|
+
|
|
24
|
+
### Text/Conversational Content
|
|
25
|
+
- User's own words and ideas
|
|
26
|
+
- Conversation transcripts
|
|
27
|
+
- Meeting notes
|
|
28
|
+
- Documentation
|
|
29
|
+
|
|
30
|
+
### JSON/Structured Data
|
|
31
|
+
- API responses
|
|
32
|
+
- Database records
|
|
33
|
+
- Configuration files
|
|
34
|
+
- System outputs
|
|
35
|
+
|
|
36
|
+
### Message Format
|
|
37
|
+
- Chat logs
|
|
38
|
+
- Email threads
|
|
39
|
+
- Comment threads
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Step 3: Extract Episode Metadata
|
|
44
|
+
|
|
45
|
+
**Gather from context:**
|
|
46
|
+
|
|
47
|
+
1. **Episode Name** - Brief title describing the content
|
|
48
|
+
2. **Episode Body** - The actual content to store
|
|
49
|
+
3. **Source Description** - Where this came from (optional)
|
|
50
|
+
4. **Reference Date** - When this occurred (if temporal context matters)
|
|
51
|
+
|
|
52
|
+
**Example:**
|
|
53
|
+
```yaml
|
|
54
|
+
name: "Podman Volume Mounting Syntax"
|
|
55
|
+
episode_body: "When using Podman volumes, always mount to /container/path not host/path. The left side is host path, right side is container path."
|
|
56
|
+
source_description: "Technical learning about Podman"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Step 4: Add Episode (CLI-First, MCP-Fallback)
|
|
62
|
+
|
|
63
|
+
### Primary: Knowledge CLI (via Bash)
|
|
64
|
+
|
|
65
|
+
**ALWAYS try CLI first - it's more reliable and token-efficient:**
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
bun run ~/.claude/skills/Knowledge/tools/knowledge-cli.ts add_episode "Episode Title" "Content to store" "Source description"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**CRITICAL: This command requires TWO separate quoted arguments (title AND body).**
|
|
72
|
+
|
|
73
|
+
Passing a single argument will fail with: `Usage: add_episode <title> <body> [source_description]`
|
|
74
|
+
|
|
75
|
+
**Arguments:**
|
|
76
|
+
1. **Title** (required) - Brief title describing the content (extract from user's request)
|
|
77
|
+
2. **Body** (required) - The full content to store in the graph
|
|
78
|
+
3. **Source description** (optional) - Where this came from
|
|
79
|
+
|
|
80
|
+
**When user says "remember that X":**
|
|
81
|
+
- Extract a short title from the content (e.g., "Podman Volume Syntax")
|
|
82
|
+
- Use the full content as the body
|
|
83
|
+
- Pass both as separate quoted strings
|
|
84
|
+
|
|
85
|
+
**Options:**
|
|
86
|
+
- `--raw` - Output raw JSON instead of compact format
|
|
87
|
+
- `--metrics` - Display token metrics after operation
|
|
88
|
+
|
|
89
|
+
### Fallback: MCP Tool (Only if CLI fails)
|
|
90
|
+
|
|
91
|
+
**⚠️ Only use MCP if CLI returns connection/execution errors.**
|
|
92
|
+
|
|
93
|
+
> **MCP Tool:** `add_memory` (internally adds an "episode" to the graph)
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
// TypeScript: addEpisode() → calls MCP tool "add_memory"
|
|
97
|
+
{
|
|
98
|
+
name: "Episode Title Here",
|
|
99
|
+
episode_body: "The full content to store in the graph",
|
|
100
|
+
source_description: "Where this came from (optional)"
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Parameters:**
|
|
105
|
+
- `name` (required) - Brief title
|
|
106
|
+
- `episode_body` (required) - Content to process
|
|
107
|
+
- `source` (optional) - "text", "json", or "messages" (default: "text")
|
|
108
|
+
- `source_description` (optional) - Origin of this knowledge
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Step 5: Present Results
|
|
113
|
+
|
|
114
|
+
**Confirm capture to user:**
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
✓ **Knowledge Captured**
|
|
118
|
+
|
|
119
|
+
Stored episode: [Episode Name]
|
|
120
|
+
|
|
121
|
+
Entities extracted:
|
|
122
|
+
- [Entity 1] ([Type])
|
|
123
|
+
- [Entity 2] ([Type])
|
|
124
|
+
- [Entity 3] ([Type])
|
|
125
|
+
|
|
126
|
+
Relationships identified:
|
|
127
|
+
- [Entity 1] → [relationship] → [Entity 2]
|
|
128
|
+
- [Entity 2] → [relationship] → [Entity 3]
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**If MCP tool fails:**
|
|
132
|
+
```
|
|
133
|
+
❌ **Capture Failed**
|
|
134
|
+
|
|
135
|
+
Error: [error message]
|
|
136
|
+
|
|
137
|
+
Troubleshooting:
|
|
138
|
+
1. Check if Graphiti server is running: curl http://localhost:8000/health
|
|
139
|
+
2. Verify MADEINOZ_KNOWLEDGE_OPENAI_API_KEY is configured
|
|
140
|
+
3. Check server logs: podman logs graphiti-knowledge-graph-mcp
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Best Practices
|
|
146
|
+
|
|
147
|
+
**What to Capture:**
|
|
148
|
+
✅ Technical decisions and rationale
|
|
149
|
+
✅ Debugging solutions and workarounds
|
|
150
|
+
✅ Configuration patterns and preferences
|
|
151
|
+
✅ Process documentation (SOPs)
|
|
152
|
+
✅ Meeting insights and action items
|
|
153
|
+
✅ Research findings and sources
|
|
154
|
+
✅ Code explanations and patterns
|
|
155
|
+
|
|
156
|
+
**What NOT to Capture:**
|
|
157
|
+
❌ Transient conversations without substance
|
|
158
|
+
❌ Duplicate information
|
|
159
|
+
❌ Sensitive credentials or secrets
|
|
160
|
+
❌ Obviously incorrect information
|
|
161
|
+
|
|
162
|
+
**Episode Naming:**
|
|
163
|
+
- Use descriptive, searchable titles
|
|
164
|
+
- Include key topics in the name
|
|
165
|
+
- Keep under 100 characters
|
|
166
|
+
- Use Title_Case_With_Underscores
|
|
167
|
+
|
|
168
|
+
**Content Quality:**
|
|
169
|
+
- Provide context, not just facts
|
|
170
|
+
- Include relationships between concepts
|
|
171
|
+
- Add temporal context when relevant (when this happened)
|
|
172
|
+
- Be specific and detailed
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Examples
|
|
177
|
+
|
|
178
|
+
**Example 1: Capture Technical Learning**
|
|
179
|
+
|
|
180
|
+
Input: "Remember that Podman volume syntax is host:container, not the other way around"
|
|
181
|
+
|
|
182
|
+
```typescript
|
|
183
|
+
add_episode({
|
|
184
|
+
name: "Podman Volume Syntax",
|
|
185
|
+
episode_body: "Podman volume mounting uses host:container syntax. The left side (before colon) is the host machine path, the right side (after colon) is the container path. This is the opposite of what some expect.",
|
|
186
|
+
source_description: "Technical learning about containerization"
|
|
187
|
+
})
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**Example 2: Capture Meeting Notes**
|
|
191
|
+
|
|
192
|
+
Input: "Log from our architecture discussion: We decided to use Graphiti for knowledge management because it supports temporal context and automatic entity extraction"
|
|
193
|
+
|
|
194
|
+
```typescript
|
|
195
|
+
add_episode({
|
|
196
|
+
name: "Architecture Decision - Graphiti Selection",
|
|
197
|
+
episode_body: "Architecture team decided to use Graphiti knowledge graph framework for the personal knowledge management system. Key reasons: 1) Temporal context support for tracking when knowledge was added, 2) Automatic entity extraction from unstructured text, 3) Built-in relationship mapping, 4) FalkorDB integration for efficient graph queries.",
|
|
198
|
+
source_description: "Architecture meeting notes"
|
|
199
|
+
})
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
**Example 3: Capture Configuration Pattern**
|
|
203
|
+
|
|
204
|
+
Input: "Store my VS Code settings: I prefer 2-space tabs, auto-save on focus change, and the One Dark Pro theme"
|
|
205
|
+
|
|
206
|
+
```typescript
|
|
207
|
+
add_episode({
|
|
208
|
+
name: "VS Code Preferences",
|
|
209
|
+
episode_body: "User's preferred VS Code configuration: Tab size = 2 spaces, Auto-save = onWindowChange, Theme = One Dark Pro, Font = JetBrains Mono (if available)",
|
|
210
|
+
source_description: "User preferences - development environment"
|
|
211
|
+
})
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Troubleshooting
|
|
217
|
+
|
|
218
|
+
**Error: "Connection refused"**
|
|
219
|
+
- Graphiti MCP server is not running
|
|
220
|
+
- Start server: `bun run server-cli start`
|
|
221
|
+
|
|
222
|
+
**Error: "API key not configured"**
|
|
223
|
+
- MADEINOZ_KNOWLEDGE_OPENAI_API_KEY is missing or invalid
|
|
224
|
+
- Check PAI config (`$PAI_DIR/.env` or `~/.claude/.env`) has valid key
|
|
225
|
+
- Restart server after updating config
|
|
226
|
+
|
|
227
|
+
**Error: "No entities extracted"**
|
|
228
|
+
- Episode content may be too vague or brief
|
|
229
|
+
- Add more context and detail
|
|
230
|
+
- Ensure content has clear entities (people, places, concepts)
|
|
231
|
+
|
|
232
|
+
**Poor entity extraction quality:**
|
|
233
|
+
- Consider upgrading model (gpt-4o vs gpt-4o-mini)
|
|
234
|
+
- Provide more structured, detailed content
|
|
235
|
+
- Use `source: "json"` for structured data
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
**Related Workflows:**
|
|
240
|
+
- `SearchKnowledge.md` - Find what you've stored
|
|
241
|
+
- `GetRecent.md` - Review recent additions
|
|
242
|
+
- `ClearGraph.md` - Reset and start fresh
|
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
# Clear Graph Workflow
|
|
2
|
+
|
|
3
|
+
**Objective:** Completely clear all knowledge from the graph, deleting all entities, relationships, and episodes, then rebuild indices. **DESTRUCTIVE OPERATION - cannot be undone.**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## ⚠️ CRITICAL WARNING
|
|
8
|
+
|
|
9
|
+
**THIS IS A DESTRUCTIVE OPERATION**
|
|
10
|
+
|
|
11
|
+
- **ALL** knowledge will be permanently deleted
|
|
12
|
+
- **ALL** entities will be removed
|
|
13
|
+
- **ALL** relationships will be destroyed
|
|
14
|
+
- **ALL** episodes will be deleted
|
|
15
|
+
- **Cannot be undone** without backups
|
|
16
|
+
|
|
17
|
+
**Only perform this operation if:**
|
|
18
|
+
- Starting fresh with a new knowledge domain
|
|
19
|
+
- Graph is corrupted and needs reset
|
|
20
|
+
- Switching to completely different use case
|
|
21
|
+
- Explicitly requested by user
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Step 1: Announce Workflow
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
~/.claude/Tools/SkillWorkflowNotification ClearGraph MadeinozKnowledgeSystem
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Output to user:**
|
|
32
|
+
```
|
|
33
|
+
Running the **ClearGraph** workflow from the **MadeinozKnowledgeSystem** skill...
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Step 2: Confirm User Intent
|
|
39
|
+
|
|
40
|
+
**EXPLICIT CONFIRMATION REQUIRED**
|
|
41
|
+
|
|
42
|
+
Before proceeding, user must clearly state they want to clear the graph.
|
|
43
|
+
|
|
44
|
+
**Acceptable confirmations:**
|
|
45
|
+
- "Yes, clear it"
|
|
46
|
+
- "Confirm clear graph"
|
|
47
|
+
- "I understand, proceed with clearing"
|
|
48
|
+
- "Delete all knowledge"
|
|
49
|
+
|
|
50
|
+
**Unacceptable (ambiguous):**
|
|
51
|
+
- "ok"
|
|
52
|
+
- "sure"
|
|
53
|
+
- "go ahead"
|
|
54
|
+
- "do it"
|
|
55
|
+
|
|
56
|
+
**If confirmation not clear:**
|
|
57
|
+
```markdown
|
|
58
|
+
⚠️ **CONFIRMATION REQUIRED**
|
|
59
|
+
|
|
60
|
+
You are about to **PERMANENTLY DELETE** all knowledge from your graph.
|
|
61
|
+
|
|
62
|
+
This will remove:
|
|
63
|
+
- [Count] entities
|
|
64
|
+
- [Count] relationships
|
|
65
|
+
- [Count] episodes
|
|
66
|
+
|
|
67
|
+
**This operation CANNOT be undone.**
|
|
68
|
+
|
|
69
|
+
To confirm, type: **"Yes, clear the graph"**
|
|
70
|
+
To cancel, type: **"Cancel"**
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Step 3: Show What Will Be Lost
|
|
76
|
+
|
|
77
|
+
**Before clearing, display summary:**
|
|
78
|
+
|
|
79
|
+
```markdown
|
|
80
|
+
📋 **Knowledge Graph Summary**
|
|
81
|
+
|
|
82
|
+
**Current Contents:**
|
|
83
|
+
|
|
84
|
+
**Entities:** [Total count]
|
|
85
|
+
- Preferences: [X]
|
|
86
|
+
- Procedures: [X]
|
|
87
|
+
- Locations: [X]
|
|
88
|
+
- Events: [X]
|
|
89
|
+
- Organizations: [X]
|
|
90
|
+
- Documents: [X]
|
|
91
|
+
- Other: [X]
|
|
92
|
+
|
|
93
|
+
**Relationships:** [Total count]
|
|
94
|
+
**Episodes:** [Total count]
|
|
95
|
+
|
|
96
|
+
**Most Recent Knowledge:**
|
|
97
|
+
1. [Episode name] — [Date]
|
|
98
|
+
2. [Episode name] — [Date]
|
|
99
|
+
3. [Episode name] — [Date]
|
|
100
|
+
|
|
101
|
+
**Knowledge Domains:**
|
|
102
|
+
- [Domain 1] — [X] episodes
|
|
103
|
+
- [Domain 2] — [Y] episodes
|
|
104
|
+
- [Domain 3] — [Z] episodes
|
|
105
|
+
|
|
106
|
+
⚠️ **ALL OF THIS WILL BE PERMANENTLY DELETED**
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Step 4: Suggest Backup (Optional)
|
|
112
|
+
|
|
113
|
+
**Offer backup opportunity:**
|
|
114
|
+
|
|
115
|
+
```markdown
|
|
116
|
+
💾 **Backup Recommendation**
|
|
117
|
+
|
|
118
|
+
Before clearing, consider backing up your knowledge:
|
|
119
|
+
|
|
120
|
+
**Option 1: Export Recent Episodes**
|
|
121
|
+
- Use GetRecent with high limit
|
|
122
|
+
- Save output to file
|
|
123
|
+
- Can manually re-add important knowledge later
|
|
124
|
+
|
|
125
|
+
**Option 2: Podman Volume Backup**
|
|
126
|
+
```bash
|
|
127
|
+
# Stop container
|
|
128
|
+
podman stop graphiti-knowledge-graph-mcp
|
|
129
|
+
|
|
130
|
+
# Backup volume
|
|
131
|
+
podman volume inspect graphiti-data # Find volume location
|
|
132
|
+
cp -r [volume_path] [backup_location]
|
|
133
|
+
|
|
134
|
+
# Restart container
|
|
135
|
+
podman start graphiti-knowledge-graph-mcp
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**Option 3: Proceed without backup**
|
|
139
|
+
- If you're sure, continue to clear
|
|
140
|
+
|
|
141
|
+
Do you want to create a backup before clearing?
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Step 5: Execute Clear Operation (CLI-First, MCP-Fallback)
|
|
147
|
+
|
|
148
|
+
### Primary: Knowledge CLI (via Bash)
|
|
149
|
+
|
|
150
|
+
**ALWAYS try CLI first - it's more reliable:**
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
bun run ~/.claude/skills/Knowledge/tools/knowledge-cli.ts clear_graph --force
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
**Note:** The `--force` flag is required as a safety measure. Without it, the command will fail with a warning.
|
|
157
|
+
|
|
158
|
+
**Options:**
|
|
159
|
+
- `--raw` - Output raw JSON instead of compact format
|
|
160
|
+
- `--metrics` - Display token metrics after operation
|
|
161
|
+
|
|
162
|
+
### Fallback: MCP Tool (Only if CLI fails)
|
|
163
|
+
|
|
164
|
+
**⚠️ Only use MCP if CLI returns connection/execution errors.**
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
// Use the clear_graph tool
|
|
168
|
+
clear_graph({})
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**This operation:**
|
|
172
|
+
1. Deletes all entities from the graph
|
|
173
|
+
2. Deletes all relationships/edges
|
|
174
|
+
3. Deletes all episodes
|
|
175
|
+
4. Rebuilds indices
|
|
176
|
+
5. Resets graph to initial state
|
|
177
|
+
|
|
178
|
+
**Expected duration:**
|
|
179
|
+
- Small graphs (<1000 entities): <10 seconds
|
|
180
|
+
- Medium graphs (1000-10000): 10-60 seconds
|
|
181
|
+
- Large graphs (>10000): 1-5 minutes
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Step 6: Confirm Clear Operation
|
|
186
|
+
|
|
187
|
+
**Verify successful clear:**
|
|
188
|
+
|
|
189
|
+
```markdown
|
|
190
|
+
✅ **Knowledge Graph Cleared**
|
|
191
|
+
|
|
192
|
+
**All knowledge has been permanently deleted:**
|
|
193
|
+
- ✓ Entities deleted
|
|
194
|
+
- ✓ Relationships deleted
|
|
195
|
+
- ✓ Episodes deleted
|
|
196
|
+
- ✓ Indices rebuilt
|
|
197
|
+
|
|
198
|
+
**Current Status:**
|
|
199
|
+
- Total Entities: 0
|
|
200
|
+
- Total Relationships: 0
|
|
201
|
+
- Total Episodes: 0
|
|
202
|
+
|
|
203
|
+
**Knowledge graph is ready for fresh knowledge capture.**
|
|
204
|
+
|
|
205
|
+
💡 **Next Steps:**
|
|
206
|
+
1. Capture new knowledge using CaptureEpisode
|
|
207
|
+
2. Import documents using BulkImport
|
|
208
|
+
3. Start building your new knowledge base
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
🕊️ *In memoriam: [X] entities, [Y] relationships, [Z] episodes served*
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Error Handling
|
|
217
|
+
|
|
218
|
+
**If Clear Fails:**
|
|
219
|
+
|
|
220
|
+
```markdown
|
|
221
|
+
❌ **Clear Operation Failed**
|
|
222
|
+
|
|
223
|
+
**Error:** [Error message from MCP tool]
|
|
224
|
+
|
|
225
|
+
**Possible causes:**
|
|
226
|
+
1. Database connection lost
|
|
227
|
+
2. Server not responding
|
|
228
|
+
3. Insufficient permissions
|
|
229
|
+
4. Graph locked by another operation
|
|
230
|
+
|
|
231
|
+
**Troubleshooting:**
|
|
232
|
+
1. Check server status: GetStatus
|
|
233
|
+
2. Verify database connectivity
|
|
234
|
+
3. Check container logs: podman logs graphiti-knowledge-graph-mcp
|
|
235
|
+
4. Retry after resolving issue
|
|
236
|
+
|
|
237
|
+
⚠️ Graph may be in partial state. Verify status before proceeding.
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Post-Clear Actions
|
|
243
|
+
|
|
244
|
+
**Immediate Next Steps:**
|
|
245
|
+
|
|
246
|
+
```markdown
|
|
247
|
+
🎯 **Building Your Fresh Knowledge Base**
|
|
248
|
+
|
|
249
|
+
**Quick Start:**
|
|
250
|
+
1. Capture your current work/context
|
|
251
|
+
→ "Remember that I'm working on [project]"
|
|
252
|
+
→ "Log my current setup: [configuration details]"
|
|
253
|
+
|
|
254
|
+
2. Import recent documents
|
|
255
|
+
→ Use BulkImport for important files
|
|
256
|
+
→ Focus on high-value knowledge
|
|
257
|
+
|
|
258
|
+
3. Capture recurring patterns
|
|
259
|
+
→ Procedures you use regularly
|
|
260
|
+
→ Preferences and decisions
|
|
261
|
+
→ Project documentation
|
|
262
|
+
|
|
263
|
+
**Suggested First Captures:**
|
|
264
|
+
- Current project context and goals
|
|
265
|
+
- Development environment setup
|
|
266
|
+
- Key decisions and rationale
|
|
267
|
+
- Team structure and contacts
|
|
268
|
+
- Important workflows and procedures
|
|
269
|
+
|
|
270
|
+
💡 The knowledge graph compounds over time. Start capturing today!
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## When to Use Clear Graph
|
|
276
|
+
|
|
277
|
+
**Appropriate Use Cases:**
|
|
278
|
+
|
|
279
|
+
✅ **Starting New Project**
|
|
280
|
+
- Switching to completely different domain
|
|
281
|
+
- Want clean slate for new initiative
|
|
282
|
+
|
|
283
|
+
✅ **Graph Corruption**
|
|
284
|
+
- Data inconsistencies that can't be fixed
|
|
285
|
+
- Entity extraction producing garbage results
|
|
286
|
+
|
|
287
|
+
✅ **Testing/Development**
|
|
288
|
+
- Testing knowledge capture workflows
|
|
289
|
+
- Development environment resets
|
|
290
|
+
|
|
291
|
+
✅ **Privacy Cleanup**
|
|
292
|
+
- Remove sensitive information
|
|
293
|
+
- Clean before sharing system
|
|
294
|
+
|
|
295
|
+
**Inappropriate Use Cases:**
|
|
296
|
+
|
|
297
|
+
❌ **Too Much Knowledge**
|
|
298
|
+
- Use topic filtering or multiple group_ids instead
|
|
299
|
+
- Consider archiving old knowledge to separate namespace
|
|
300
|
+
|
|
301
|
+
❌ **Poor Quality Knowledge**
|
|
302
|
+
- Use delete_episode for specific bad episodes
|
|
303
|
+
- Use delete_entity_edge for specific bad relationships
|
|
304
|
+
|
|
305
|
+
❌ **Performance Issues**
|
|
306
|
+
- Tune SEMAPHORE_LIMIT and model settings first
|
|
307
|
+
- Consider database optimization before clearing
|
|
308
|
+
|
|
309
|
+
❌ **Accidental Captures**
|
|
310
|
+
- Delete specific episodes instead
|
|
311
|
+
- Much more surgical than full clear
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
## Alternative: Selective Cleanup
|
|
316
|
+
|
|
317
|
+
**Before clearing, consider these alternatives:**
|
|
318
|
+
|
|
319
|
+
**Delete Specific Episodes:**
|
|
320
|
+
```typescript
|
|
321
|
+
// Remove bad episodes without clearing everything
|
|
322
|
+
delete_episode({
|
|
323
|
+
episode_uuid: "specific-episode-uuid"
|
|
324
|
+
})
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
**Delete Specific Relationships:**
|
|
328
|
+
```typescript
|
|
329
|
+
// Remove incorrect relationships
|
|
330
|
+
delete_entity_edge({
|
|
331
|
+
edge_uuid: "specific-edge-uuid"
|
|
332
|
+
})
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
**Use Multiple Group IDs:**
|
|
336
|
+
```typescript
|
|
337
|
+
// Keep old knowledge, start fresh in new namespace
|
|
338
|
+
group_id: "project-2" // Instead of clearing "main"
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
---
|
|
342
|
+
|
|
343
|
+
## Recovery Options
|
|
344
|
+
|
|
345
|
+
**If you cleared by mistake:**
|
|
346
|
+
|
|
347
|
+
**Option 1: Restore from Volume Backup**
|
|
348
|
+
```bash
|
|
349
|
+
# Stop container
|
|
350
|
+
podman stop graphiti-knowledge-graph-mcp
|
|
351
|
+
|
|
352
|
+
# Restore backup
|
|
353
|
+
podman volume rm graphiti-data
|
|
354
|
+
podman volume create graphiti-data
|
|
355
|
+
cp -r [backup_location]/* [volume_path]/
|
|
356
|
+
|
|
357
|
+
# Restart
|
|
358
|
+
podman start graphiti-knowledge-graph-mcp
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
**Option 2: Recapture from Other Sources**
|
|
362
|
+
- Check if episodes were exported before clear
|
|
363
|
+
- Look for knowledge in other systems (notes, docs)
|
|
364
|
+
- Use BulkImport to rebuild from documents
|
|
365
|
+
- Manually re-capture critical knowledge
|
|
366
|
+
|
|
367
|
+
**Option 3: Accept and Rebuild**
|
|
368
|
+
- Knowledge graph improves over time
|
|
369
|
+
- Second time around is often better organized
|
|
370
|
+
- Focus on capturing highest-value knowledge first
|
|
371
|
+
|
|
372
|
+
---
|
|
373
|
+
|
|
374
|
+
## Safety Checklist
|
|
375
|
+
|
|
376
|
+
Before executing clear_graph:
|
|
377
|
+
|
|
378
|
+
- [ ] User has provided explicit confirmation
|
|
379
|
+
- [ ] User understands this is permanent
|
|
380
|
+
- [ ] User has seen what will be deleted
|
|
381
|
+
- [ ] Backup was offered (user may decline)
|
|
382
|
+
- [ ] No better alternative (selective delete, new group_id)
|
|
383
|
+
- [ ] Server and database are operational
|
|
384
|
+
- [ ] No other operations are running
|
|
385
|
+
|
|
386
|
+
---
|
|
387
|
+
|
|
388
|
+
**Related Workflows:**
|
|
389
|
+
- `GetStatus.md` - Check before clearing
|
|
390
|
+
- `GetRecent.md` - Review what will be lost
|
|
391
|
+
- `CaptureEpisode.md` - Start adding knowledge after clear
|
|
392
|
+
- `BulkImport.md` - Quickly rebuild knowledge base
|