@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,385 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Knowledge
|
|
3
|
+
version: 1.9.0
|
|
4
|
+
description: Personal knowledge management using Graphiti knowledge graph with Neo4j/FalkorDB, supporting remote MCP access with connection profiles and TLS, OSINT/CTI ontology, and investigative search. USE WHEN 'store this', 'remember this', 'add to knowledge', 'search my knowledge', 'what do I know about', 'find in knowledge base', 'save to memory', 'graphiti', 'knowledge graph', 'entity extraction', 'relationship mapping', 'semantic search', 'episode', 'install knowledge', 'setup knowledge system', 'configure knowledge graph', 'remote knowledge server', 'connect to knowledge', 'knowledge profile', knowledge capture, retrieval, synthesis, memory decay, decay scoring, lifecycle state, importance classification, stability classification, health metrics, run maintenance, permanent memory, soft-delete, 'investigate entity', 'find connections', 'graph traversal', 'threat hunting', 'list ontology', 'custom entity types', 'CTI entities', 'OSINT entities', 'import STIX', 'STIX bundle', 'threat intel import'.
|
|
5
|
+
tools:
|
|
6
|
+
# MCP Wrapper CLI (76%+ token savings vs direct MCP calls)
|
|
7
|
+
- Bash(bun run */knowledge-cli.ts add_episode *)
|
|
8
|
+
- Bash(bun run */knowledge-cli.ts search_nodes *)
|
|
9
|
+
- Bash(bun run */knowledge-cli.ts search_facts *)
|
|
10
|
+
- Bash(bun run */knowledge-cli.ts get_episodes *)
|
|
11
|
+
- Bash(bun run */knowledge-cli.ts get_status)
|
|
12
|
+
- Bash(bun run */knowledge-cli.ts clear_graph *)
|
|
13
|
+
- Bash(bun run */knowledge-cli.ts health)
|
|
14
|
+
# Feature 009: Memory decay and lifecycle
|
|
15
|
+
- Bash(bun run */knowledge-cli.ts health_metrics *)
|
|
16
|
+
- Bash(bun run */knowledge-cli.ts run_maintenance *)
|
|
17
|
+
- Bash(bun run */knowledge-cli.ts classify_memory *)
|
|
18
|
+
- Bash(bun run */knowledge-cli.ts recover_memory *)
|
|
19
|
+
# Feature 010: Remote MCP access
|
|
20
|
+
- Bash(bun run */knowledge-cli.ts status)
|
|
21
|
+
- Bash(bun run */knowledge-cli.ts list_profiles)
|
|
22
|
+
# Feature 018: OSINT/CTI Ontology
|
|
23
|
+
- Bash(bun run */knowledge-cli.ts ontology:list)
|
|
24
|
+
- Bash(bun run */knowledge-cli.ts ontology:validate)
|
|
25
|
+
- Bash(bun run */knowledge-cli.ts ontology:reload)
|
|
26
|
+
- Bash(bun run */knowledge-cli.ts stix:import *)
|
|
27
|
+
- Bash(bun run */knowledge-cli.ts stix:status)
|
|
28
|
+
# Feature 020: Investigative Search
|
|
29
|
+
- Bash(bun run */knowledge-cli.ts investigate *)
|
|
30
|
+
# Server management
|
|
31
|
+
- Bash(bun run server-cli *)
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
# Knowledge
|
|
35
|
+
|
|
36
|
+
Persistent personal knowledge system powered by Graphiti knowledge graph with Neo4j (default) or FalkorDB backend. Automatically extracts entities, relationships, and temporal context from conversations, documents, and ideas.
|
|
37
|
+
|
|
38
|
+
## Workflow Routing
|
|
39
|
+
|
|
40
|
+
| Workflow | Trigger | File |
|
|
41
|
+
|----------|---------|------|
|
|
42
|
+
| **Install** | "install knowledge", "setup knowledge system", "configure knowledge graph", "install knowledge system" | `tools/Install.md` |
|
|
43
|
+
| **Capture Episode** | "remember this", "store this", "add to knowledge", "save this", "log this" | `workflows/CaptureEpisode.md` |
|
|
44
|
+
| **Search Knowledge** | "search my knowledge", "what do I know about", "find in my knowledge base", "recall" | `workflows/SearchKnowledge.md` |
|
|
45
|
+
| **Search Facts** | "what's the connection", "how are these related", "show relationships" | `workflows/SearchFacts.md` |
|
|
46
|
+
| **Search By Date** | "what did I learn today", "knowledge from last week", "show January entries", "yesterday's knowledge" | `workflows/SearchByDate.md` |
|
|
47
|
+
| **Get Recent Episodes** | "what did I learn", "recent additions", "latest knowledge" | `workflows/GetRecent.md` |
|
|
48
|
+
| **Get Status** | "knowledge status", "graph health", "knowledge stats", "system health", "memory health" | `workflows/GetStatus.md` |
|
|
49
|
+
| **Health Report** | "knowledge health report", "memory decay status", "lifecycle report", "decay metrics" | `workflows/HealthReport.md` |
|
|
50
|
+
| **Run Maintenance** | "run knowledge maintenance", "update decay scores", "recalculate memory decay" | `workflows/RunMaintenance.md` |
|
|
51
|
+
| **Clear Graph** | "clear knowledge", "reset graph", "delete all knowledge" | `workflows/ClearGraph.md` |
|
|
52
|
+
| **Bulk Import** | "import these documents", "bulk knowledge import" | `workflows/BulkImport.md` |
|
|
53
|
+
| **Investigate Entity** | "investigate entity", "find connections", "graph traversal", "threat hunting", "connected entities" | `workflows/InvestigateEntity.md` |
|
|
54
|
+
| **Ontology Management** | "list ontology", "custom entity types", "CTI entities", "OSINT entities", "ontology config" | `workflows/OntologyManagement.md` |
|
|
55
|
+
| **STIX Import** | "import STIX", "STIX bundle", "threat intel import", "CTI data" | `workflows/StixImport.md` |
|
|
56
|
+
|
|
57
|
+
## Core Capabilities
|
|
58
|
+
|
|
59
|
+
**Knowledge Graph Features:**
|
|
60
|
+
|
|
61
|
+
- **Automatic Entity Extraction** - Identifies people, organizations, locations, concepts, preferences, requirements
|
|
62
|
+
- **Relationship Mapping** - Tracks how entities connect with temporal context
|
|
63
|
+
- **Semantic Search** - Finds relevant knowledge using vector embeddings
|
|
64
|
+
- **Episode-Based Storage** - Preserves context and conversations over time
|
|
65
|
+
- **Multi-Source Input** - Accepts text, JSON, messages, and structured data
|
|
66
|
+
|
|
67
|
+
**Built-in Entity Types:**
|
|
68
|
+
|
|
69
|
+
**Standard Types:**
|
|
70
|
+
- **Preferences** - User choices, opinions, configurations
|
|
71
|
+
- **Requirements** - Features, needs, specifications
|
|
72
|
+
- **Procedures** - SOPs, workflows, how-to guides
|
|
73
|
+
- **Locations** - Physical or virtual places
|
|
74
|
+
- **Events** - Time-bound occurrences, experiences
|
|
75
|
+
- **Organizations** - Companies, institutions, groups
|
|
76
|
+
- **Documents** - Articles, reports, books, content
|
|
77
|
+
|
|
78
|
+
**OSINT/CTI Types (Feature 018):**
|
|
79
|
+
- **ThreatActor** - Malicious actors, APT groups, threat campaigns
|
|
80
|
+
- **Malware** - Malicious software, viruses, ransomware
|
|
81
|
+
- **Vulnerability** - CVE, security flaws, exploits
|
|
82
|
+
- **Campaign** - Coordinated threat activities
|
|
83
|
+
- **Indicator** - IoCs, hashes, IPs, domains (STIX Indicator)
|
|
84
|
+
- **Infrastructure** - Command & control, attack infrastructure
|
|
85
|
+
- **TTP** - Tactics, Techniques, and Procedures (MITRE ATT&CK)
|
|
86
|
+
- **Account** - Social media, email, service accounts
|
|
87
|
+
- **Domain** - Registered domains, DNS records
|
|
88
|
+
- **Email** - Email addresses, mailboxes
|
|
89
|
+
- **Phone** - Phone numbers, mobile devices
|
|
90
|
+
- **Image** - Photos, screenshots, media files
|
|
91
|
+
- **Investigation** - OSINT investigations, case files
|
|
92
|
+
|
|
93
|
+
## Prerequisites
|
|
94
|
+
|
|
95
|
+
**Required Setup:**
|
|
96
|
+
|
|
97
|
+
The skill is installed at `~/.claude/skills/Knowledge/` (or `$PAI_DIR/skills/Knowledge/`).
|
|
98
|
+
|
|
99
|
+
1. **Start the Graphiti MCP server:**
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
cd ~/.claude/skills/Knowledge
|
|
103
|
+
bun run server-cli start
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
2. **Verify server is running:**
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
cd ~/.claude/skills/Knowledge && bun run server-cli status
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
3. **Other server commands:**
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
bun run server-cli stop # Stop containers
|
|
116
|
+
bun run server-cli restart # Restart containers
|
|
117
|
+
bun run server-cli logs # View logs
|
|
118
|
+
bun run server-cli logs --mcp # MCP server logs only
|
|
119
|
+
bun run server-cli logs --db # Database logs only
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
4. **Configure API key** (in PAI .env `~/.claude/.env`):
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
MADEINOZ_KNOWLEDGE_OPENAI_API_KEY=sk-your-key-here
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Interface Priority: CLI-First, MCP-Fallback
|
|
129
|
+
|
|
130
|
+
**ALWAYS use this execution order:**
|
|
131
|
+
|
|
132
|
+
1. **PRIMARY: Knowledge CLI** (via Bash) - Reliable, token-efficient, human-readable
|
|
133
|
+
2. **FALLBACK: MCP Tools** - Only if CLI fails or for programmatic access
|
|
134
|
+
|
|
135
|
+
**Why CLI-first?**
|
|
136
|
+
- MCP tools may have session/connection issues in Claude Code
|
|
137
|
+
- CLI provides 25-35% token savings with compact output
|
|
138
|
+
- CLI has better error messages and troubleshooting
|
|
139
|
+
- CLI works reliably via direct Bash execution
|
|
140
|
+
|
|
141
|
+
### Knowledge CLI (Primary Interface)
|
|
142
|
+
|
|
143
|
+
**Run commands from the skill directory:**
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
cd ~/.claude/skills/Knowledge
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**Commands:**
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
# Add knowledge (REQUIRES both title AND body as separate quoted strings)
|
|
153
|
+
bun run tools/knowledge-cli.ts add_episode "Short Title" "Full content body text here" "Source"
|
|
154
|
+
|
|
155
|
+
# Search entities (30%+ token savings)
|
|
156
|
+
bun run tools/knowledge-cli.ts search_nodes "query" 10
|
|
157
|
+
|
|
158
|
+
# Search relationships (30%+ token savings)
|
|
159
|
+
bun run tools/knowledge-cli.ts search_facts "query" 10
|
|
160
|
+
|
|
161
|
+
# Get recent episodes (25%+ token savings)
|
|
162
|
+
bun run tools/knowledge-cli.ts get_episodes 10
|
|
163
|
+
|
|
164
|
+
# Get system status
|
|
165
|
+
bun run tools/knowledge-cli.ts get_status
|
|
166
|
+
|
|
167
|
+
# Clear graph (destructive - requires --force)
|
|
168
|
+
bun run tools/knowledge-cli.ts clear_graph --force
|
|
169
|
+
|
|
170
|
+
# Check server health
|
|
171
|
+
bun run tools/knowledge-cli.ts health
|
|
172
|
+
|
|
173
|
+
# Feature 009: Memory decay and lifecycle
|
|
174
|
+
bun run tools/knowledge-cli.ts health_metrics
|
|
175
|
+
bun run tools/knowledge-cli.ts run_maintenance
|
|
176
|
+
bun run tools/knowledge-cli.ts run_maintenance --dry-run
|
|
177
|
+
bun run tools/knowledge-cli.ts classify_memory "content" --source "description"
|
|
178
|
+
bun run tools/knowledge-cli.ts recover_memory <uuid>
|
|
179
|
+
|
|
180
|
+
# Feature 018: OSINT/CTI Ontology
|
|
181
|
+
bun run tools/knowledge-cli.ts ontology:list
|
|
182
|
+
bun run tools/knowledge-cli.ts ontology:validate
|
|
183
|
+
bun run tools/knowledge-cli.ts ontology:reload
|
|
184
|
+
bun run tools/knowledge-cli.ts stix:import <file-or-url>
|
|
185
|
+
bun run tools/knowledge-cli.ts stix:status
|
|
186
|
+
|
|
187
|
+
# Feature 020: Investigative Search
|
|
188
|
+
bun run tools/knowledge-cli.ts investigate "entity-name" --depth 2
|
|
189
|
+
bun run tools/knowledge-cli.ts investigate "apt28" --relationship-type attributed_to --relationship-type uses
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**Options:**
|
|
193
|
+
|
|
194
|
+
- `--raw` - Output raw JSON instead of compact format
|
|
195
|
+
- `--metrics` - Display token metrics after each operation
|
|
196
|
+
- `--metrics-file <path>` - Append metrics to JSONL file
|
|
197
|
+
- `--since <date>` - Filter results created after this date
|
|
198
|
+
- `--until <date>` - Filter results created before this date
|
|
199
|
+
- `--weighted` - Apply weighted scoring (60% semantic + 25% recency + 15% importance)
|
|
200
|
+
- `--depth <N>` - Investigation depth for graph traversal (1-3 hops, default: 1)
|
|
201
|
+
- `--relationship-type <TYPE>` - Filter by relationship type (can specify multiple)
|
|
202
|
+
|
|
203
|
+
**Temporal Search (date filtering):**
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
# Today's knowledge
|
|
207
|
+
bun run tools/knowledge-cli.ts search_nodes "query" --since today
|
|
208
|
+
|
|
209
|
+
# Last 7 days
|
|
210
|
+
bun run tools/knowledge-cli.ts search_facts "query" --since 7d
|
|
211
|
+
|
|
212
|
+
# Date range
|
|
213
|
+
bun run tools/knowledge-cli.ts search_nodes "query" --since 2026-01-01 --until 2026-01-15
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
**Date formats:** `today`, `yesterday`, `7d`, `1w`, `1m`, or ISO dates (`2026-01-26`)
|
|
217
|
+
|
|
218
|
+
**What Gets Captured:**
|
|
219
|
+
|
|
220
|
+
- Conversations and insights from work sessions
|
|
221
|
+
- Research findings and web content
|
|
222
|
+
- Code snippets and technical decisions
|
|
223
|
+
- Project documentation and notes
|
|
224
|
+
- Personal preferences and decisions
|
|
225
|
+
- Meeting notes and action items
|
|
226
|
+
|
|
227
|
+
## Examples
|
|
228
|
+
|
|
229
|
+
**Example 1: Capture a Learning**
|
|
230
|
+
|
|
231
|
+
User: "Remember that when using Podman volumes, you should always mount to /container/path not host/path"
|
|
232
|
+
|
|
233
|
+
→ Invokes CaptureEpisode workflow
|
|
234
|
+
→ **AI extracts title from content and calls CLI with TWO arguments:**
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
bun run tools/knowledge-cli.ts add_episode \
|
|
238
|
+
"Podman Volume Mounting Syntax" \
|
|
239
|
+
"When using Podman volumes, always mount to /container/path not host/path. The left side is host path, right side is container path." \
|
|
240
|
+
"User learning"
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
→ Stores episode with extracted entities:
|
|
244
|
+
|
|
245
|
+
- Entity: "Podman volumes" (Topic)
|
|
246
|
+
- Entity: "volume mounting" (Procedure)
|
|
247
|
+
- Fact: "Podman volumes use /container/path syntax"
|
|
248
|
+
→ User receives: "✓ Captured: Podman volume mounting syntax"
|
|
249
|
+
|
|
250
|
+
**Example 2: Search Knowledge**
|
|
251
|
+
|
|
252
|
+
User: "What do I know about Graphiti?"
|
|
253
|
+
|
|
254
|
+
→ Invokes SearchKnowledge workflow
|
|
255
|
+
→ Searches knowledge graph for "Graphiti" entities
|
|
256
|
+
→ Returns related entities, facts, and summaries
|
|
257
|
+
→ User receives: "Based on your knowledge graph, Graphiti is..."
|
|
258
|
+
|
|
259
|
+
**Example 3: Find Relationships**
|
|
260
|
+
|
|
261
|
+
User: "How are FalkorDB and Graphiti connected?"
|
|
262
|
+
|
|
263
|
+
→ Invokes SearchFacts workflow
|
|
264
|
+
→ Searches for edges between FalkorDB and Graphiti entities
|
|
265
|
+
→ Returns facts showing relationship with temporal context
|
|
266
|
+
→ User receives: "FalkorDB is the graph database backend for Graphiti MCP server"
|
|
267
|
+
|
|
268
|
+
**Example 4: Get Recent Learning**
|
|
269
|
+
|
|
270
|
+
User: "What did I learn this week about PAI?"
|
|
271
|
+
|
|
272
|
+
→ Invokes GetRecent workflow
|
|
273
|
+
→ Retrieves recent episodes mentioning "PAI" or "Personal AI Infrastructure"
|
|
274
|
+
→ Returns chronological list with timestamps
|
|
275
|
+
→ User receives: "Recent additions: 1) PAI skills architecture... 2) Canonical skill structure..."
|
|
276
|
+
|
|
277
|
+
**Example 5: Clear and Reset**
|
|
278
|
+
|
|
279
|
+
User: "Clear my knowledge graph and start fresh"
|
|
280
|
+
|
|
281
|
+
→ Invokes ClearGraph workflow
|
|
282
|
+
→ Confirms destructive action
|
|
283
|
+
→ Deletes all entities and relationships
|
|
284
|
+
→ Rebuilds indices
|
|
285
|
+
→ User receives: "✓ Knowledge graph cleared. Ready for fresh knowledge capture."
|
|
286
|
+
|
|
287
|
+
## MCP Integration (Fallback Only)
|
|
288
|
+
|
|
289
|
+
**⚠️ Use MCP tools only when CLI fails or for programmatic TypeScript access.**
|
|
290
|
+
|
|
291
|
+
**MCP Server Endpoint:**
|
|
292
|
+
|
|
293
|
+
```
|
|
294
|
+
http://localhost:8000/mcp/
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
**Available MCP Tools (Fallback):**
|
|
298
|
+
|
|
299
|
+
| MCP Tool | Graphiti Concept | User-Friendly Action |
|
|
300
|
+
|----------|------------------|----------------------|
|
|
301
|
+
| `add_memory` | Episode | "Store this knowledge" |
|
|
302
|
+
| `search_nodes` | Nodes/Entities | "Search my knowledge" |
|
|
303
|
+
| `search_memory_facts` | Facts/Edges | "Find relationships" |
|
|
304
|
+
| `get_episodes` | Episodes | "Show recent additions" |
|
|
305
|
+
| `delete_episode` | Episode | "Remove this entry" |
|
|
306
|
+
| `delete_entity_edge` | Edge | "Remove relationship" |
|
|
307
|
+
| `get_entity_edge` | Edge | "Get relationship details" |
|
|
308
|
+
| `clear_graph` | Graph | "Clear all knowledge" |
|
|
309
|
+
| `get_status` | - | "Check knowledge status" |
|
|
310
|
+
| `get_knowledge_health` | - | "Get memory decay and lifecycle metrics" |
|
|
311
|
+
| `run_decay_maintenance` | - | "Run decay maintenance cycle" |
|
|
312
|
+
| `classify_memory` | - | "Classify memory importance and stability" |
|
|
313
|
+
| `recover_soft_deleted` | - | "Recover soft-deleted memory" |
|
|
314
|
+
| `investigate_entity` | - | "Investigate entity connections (graph traversal)" |
|
|
315
|
+
| `list_ontology_types` | - | "List custom entity and relationship types" |
|
|
316
|
+
| `validate_ontology` | - | "Validate ontology configuration" |
|
|
317
|
+
| `reload_ontology` | - | "Reload ontology configuration (hot-reload)" |
|
|
318
|
+
| `import_stix_bundle` | - | "Import STIX 2.1 bundle from file or URL" |
|
|
319
|
+
|
|
320
|
+
**Naming Convention (Hybrid Approach):**
|
|
321
|
+
|
|
322
|
+
- **User-facing (Skills/Workflows):** Knowledge-friendly language ("store knowledge", "search my knowledge")
|
|
323
|
+
- **Internal (TypeScript):** Graphiti-native methods (`addEpisode`, `searchNodes`, `searchFacts`)
|
|
324
|
+
- **MCP Layer:** Actual tool names (`add_memory`, `search_nodes`, `search_memory_facts`)
|
|
325
|
+
|
|
326
|
+
**Response Caching:**
|
|
327
|
+
Search operations (`search_nodes`, `search_memory_facts`) are cached to improve performance:
|
|
328
|
+
|
|
329
|
+
- **TTL:** 5 minutes (configurable via `cacheTtlMs`)
|
|
330
|
+
- **Max entries:** 100 (configurable via `cacheMaxSize`)
|
|
331
|
+
- **Scope:** Per-client instance (not shared across sessions)
|
|
332
|
+
- **Cache invalidation:** Automatic on TTL expiry, or manual via `clearCache()`
|
|
333
|
+
|
|
334
|
+
To disable caching, initialize the client with `enableCache: false`.
|
|
335
|
+
|
|
336
|
+
## Configuration Options
|
|
337
|
+
|
|
338
|
+
**Environment Variables** (set in PAI config: `$PAI_DIR/.env` or `~/.claude/.env`):
|
|
339
|
+
|
|
340
|
+
```bash
|
|
341
|
+
# LLM Configuration (OpenRouter recommended)
|
|
342
|
+
MADEINOZ_KNOWLEDGE_OPENAI_API_KEY=sk-or-v1-your-key-here
|
|
343
|
+
MADEINOZ_KNOWLEDGE_OPENAI_BASE_URL=https://openrouter.ai/api/v1
|
|
344
|
+
MADEINOZ_KNOWLEDGE_MODEL_NAME=openai/gpt-4o-mini
|
|
345
|
+
MADEINOZ_KNOWLEDGE_LLM_PROVIDER=openai
|
|
346
|
+
|
|
347
|
+
# Embedder Configuration (Ollama recommended - free & fast)
|
|
348
|
+
MADEINOZ_KNOWLEDGE_EMBEDDER_PROVIDER=ollama
|
|
349
|
+
MADEINOZ_KNOWLEDGE_EMBEDDER_PROVIDER_URL=http://host.containers.internal:11434
|
|
350
|
+
MADEINOZ_KNOWLEDGE_EMBEDDER_MODEL=mxbai-embed-large
|
|
351
|
+
MADEINOZ_KNOWLEDGE_EMBEDDER_DIMENSIONS=1024
|
|
352
|
+
|
|
353
|
+
# Concurrency (adjust based on API tier)
|
|
354
|
+
MADEINOZ_KNOWLEDGE_SEMAPHORE_LIMIT=10
|
|
355
|
+
|
|
356
|
+
# Group ID (for multiple knowledge graphs)
|
|
357
|
+
MADEINOZ_KNOWLEDGE_GROUP_ID=main
|
|
358
|
+
|
|
359
|
+
# Disable telemetry
|
|
360
|
+
MADEINOZ_KNOWLEDGE_GRAPHITI_TELEMETRY_ENABLED=false
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
**Model Recommendations:**
|
|
364
|
+
|
|
365
|
+
*Via OpenRouter (Recommended):*
|
|
366
|
+
|
|
367
|
+
- **openai/gpt-4o-mini** - Most reliable, $0.129/1K ops
|
|
368
|
+
- **google/gemini-2.0-flash-001** - Best value, $0.125/1K ops
|
|
369
|
+
- **openai/gpt-4o** - Fastest, $2.155/1K ops
|
|
370
|
+
|
|
371
|
+
*Direct OpenAI:*
|
|
372
|
+
|
|
373
|
+
- **gpt-4o-mini** - Fast, cost-effective for daily use
|
|
374
|
+
- **gpt-4o** - Better for complex reasoning
|
|
375
|
+
|
|
376
|
+
⚠️ **Known Failures:** Llama, Mistral, DeepSeek models fail Graphiti Pydantic validation
|
|
377
|
+
|
|
378
|
+
## Related Documentation
|
|
379
|
+
|
|
380
|
+
- `${PAI_DIR}/skills/CORE/SkillSystem.md` - Canonical skill structure guide
|
|
381
|
+
- `${PAI_DIR}/skills/CORE/SYSTEM/MEMORYSYSTEM.md` - PAI's memory documentation
|
|
382
|
+
- [Graphiti Documentation](https://help.getzep.com/graphiti)
|
|
383
|
+
- [Podman Configuration](../README.md)
|
|
384
|
+
|
|
385
|
+
**Last Updated:** 2026-02-04
|