@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.
Files changed (70) hide show
  1. package/.deepquark/skills/bundled/knowledge-graph/SKILL.md +385 -0
  2. package/.deepquark/skills/bundled/knowledge-graph/STANDARDS.md +461 -0
  3. package/.deepquark/skills/bundled/knowledge-graph/lib/cli.ts +588 -0
  4. package/.deepquark/skills/bundled/knowledge-graph/lib/config.ts +630 -0
  5. package/.deepquark/skills/bundled/knowledge-graph/lib/connection-profile.ts +629 -0
  6. package/.deepquark/skills/bundled/knowledge-graph/lib/container.ts +756 -0
  7. package/.deepquark/skills/bundled/knowledge-graph/lib/mcp-client.ts +1310 -0
  8. package/.deepquark/skills/bundled/knowledge-graph/lib/output-formatter.ts +997 -0
  9. package/.deepquark/skills/bundled/knowledge-graph/lib/token-metrics.ts +335 -0
  10. package/.deepquark/skills/bundled/knowledge-graph/lib/transformation-log.ts +137 -0
  11. package/.deepquark/skills/bundled/knowledge-graph/lib/wrapper-config.ts +113 -0
  12. package/.deepquark/skills/bundled/knowledge-graph/server/.env.example +129 -0
  13. package/.deepquark/skills/bundled/knowledge-graph/server/compare-embeddings.ts +175 -0
  14. package/.deepquark/skills/bundled/knowledge-graph/server/config-falkordb.yaml +108 -0
  15. package/.deepquark/skills/bundled/knowledge-graph/server/config-neo4j.yaml +111 -0
  16. package/.deepquark/skills/bundled/knowledge-graph/server/diagnose.ts +483 -0
  17. package/.deepquark/skills/bundled/knowledge-graph/server/docker-compose-falkordb-dev.yml +146 -0
  18. package/.deepquark/skills/bundled/knowledge-graph/server/docker-compose-falkordb.yml +151 -0
  19. package/.deepquark/skills/bundled/knowledge-graph/server/docker-compose-neo4j-dev-local.yml +161 -0
  20. package/.deepquark/skills/bundled/knowledge-graph/server/docker-compose-neo4j-dev.yml +161 -0
  21. package/.deepquark/skills/bundled/knowledge-graph/server/docker-compose-neo4j.yml +169 -0
  22. package/.deepquark/skills/bundled/knowledge-graph/server/docker-compose-production.yml +128 -0
  23. package/.deepquark/skills/bundled/knowledge-graph/server/docker-compose-test.yml +10 -0
  24. package/.deepquark/skills/bundled/knowledge-graph/server/docker-compose.yml +84 -0
  25. package/.deepquark/skills/bundled/knowledge-graph/server/entrypoint.sh +40 -0
  26. package/.deepquark/skills/bundled/knowledge-graph/server/install.ts +2054 -0
  27. package/.deepquark/skills/bundled/knowledge-graph/server/podman-compose-falkordb.yml +78 -0
  28. package/.deepquark/skills/bundled/knowledge-graph/server/podman-compose-neo4j.yml +88 -0
  29. package/.deepquark/skills/bundled/knowledge-graph/server/podman-compose.yml +83 -0
  30. package/.deepquark/skills/bundled/knowledge-graph/server/test-all-llms-mcp.ts +387 -0
  31. package/.deepquark/skills/bundled/knowledge-graph/server/test-embedding-models.ts +201 -0
  32. package/.deepquark/skills/bundled/knowledge-graph/server/test-embedding-providers.ts +641 -0
  33. package/.deepquark/skills/bundled/knowledge-graph/server/test-graphiti-model.ts +217 -0
  34. package/.deepquark/skills/bundled/knowledge-graph/server/test-grok-correct.ts +141 -0
  35. package/.deepquark/skills/bundled/knowledge-graph/server/test-grok-llms-mcp.ts +386 -0
  36. package/.deepquark/skills/bundled/knowledge-graph/server/test-grok-models.ts +173 -0
  37. package/.deepquark/skills/bundled/knowledge-graph/server/test-llama-extraction.ts +188 -0
  38. package/.deepquark/skills/bundled/knowledge-graph/server/test-mcp-final.ts +240 -0
  39. package/.deepquark/skills/bundled/knowledge-graph/server/test-mcp-live.ts +187 -0
  40. package/.deepquark/skills/bundled/knowledge-graph/server/test-mcp-session.ts +127 -0
  41. package/.deepquark/skills/bundled/knowledge-graph/server/test-model-combinations.ts +316 -0
  42. package/.deepquark/skills/bundled/knowledge-graph/server/test-ollama-models.ts +228 -0
  43. package/.deepquark/skills/bundled/knowledge-graph/server/test-openrouter-models.ts +460 -0
  44. package/.deepquark/skills/bundled/knowledge-graph/server/test-real-life-mcp.ts +311 -0
  45. package/.deepquark/skills/bundled/knowledge-graph/server/test-search-debug.ts +199 -0
  46. package/.deepquark/skills/bundled/knowledge-graph/tools/Install.md +104 -0
  47. package/.deepquark/skills/bundled/knowledge-graph/tools/README.md +120 -0
  48. package/.deepquark/skills/bundled/knowledge-graph/tools/knowledge-cli.ts +996 -0
  49. package/.deepquark/skills/bundled/knowledge-graph/tools/server-cli.ts +531 -0
  50. package/.deepquark/skills/bundled/knowledge-graph/workflows/BulkImport.md +514 -0
  51. package/.deepquark/skills/bundled/knowledge-graph/workflows/CaptureEpisode.md +242 -0
  52. package/.deepquark/skills/bundled/knowledge-graph/workflows/ClearGraph.md +392 -0
  53. package/.deepquark/skills/bundled/knowledge-graph/workflows/GetRecent.md +352 -0
  54. package/.deepquark/skills/bundled/knowledge-graph/workflows/GetStatus.md +373 -0
  55. package/.deepquark/skills/bundled/knowledge-graph/workflows/HealthReport.md +212 -0
  56. package/.deepquark/skills/bundled/knowledge-graph/workflows/InvestigateEntity.md +142 -0
  57. package/.deepquark/skills/bundled/knowledge-graph/workflows/OntologyManagement.md +201 -0
  58. package/.deepquark/skills/bundled/knowledge-graph/workflows/RunMaintenance.md +302 -0
  59. package/.deepquark/skills/bundled/knowledge-graph/workflows/SearchByDate.md +255 -0
  60. package/.deepquark/skills/bundled/knowledge-graph/workflows/SearchFacts.md +382 -0
  61. package/.deepquark/skills/bundled/knowledge-graph/workflows/SearchKnowledge.md +374 -0
  62. package/.deepquark/skills/bundled/knowledge-graph/workflows/StixImport.md +212 -0
  63. package/bin/deepquark +0 -0
  64. package/package.json +1 -1
  65. package/.deepquark/skills/bundled/ge-payroll/SKILL.md +0 -153
  66. package/.deepquark/skills/bundled/ge-payroll/evals/evals.json +0 -23
  67. package/.deepquark/skills/bundled/ge-payroll/references/pain-points-improvements.md +0 -106
  68. package/.deepquark/skills/bundled/ge-payroll/references/process-detail.md +0 -217
  69. package/.deepquark/skills/bundled/ge-payroll/references/raci-stakeholders.md +0 -85
  70. package/.deepquark/skills/bundled/ge-payroll/references/timeline-mandays.md +0 -64
@@ -0,0 +1,212 @@
1
+ # Health Report Workflow
2
+
3
+ **Objective:** Get detailed memory decay metrics, lifecycle state distribution, and knowledge graph health information.
4
+
5
+ ---
6
+
7
+ ## Step 1: Announce Workflow
8
+
9
+ ```bash
10
+ ~/.claude/Tools/SkillWorkflowNotification HealthReport MadeinozKnowledgeSystem
11
+ ```
12
+
13
+ **Output to user:**
14
+ ```
15
+ Running the **HealthReport** workflow from the **MadeinozKnowledgeSystem** skill...
16
+ ```
17
+
18
+ ---
19
+
20
+ ## Step 2: Get Knowledge Health Metrics
21
+
22
+ **Use CLI (primary) for detailed health metrics:**
23
+
24
+ ```bash
25
+ bun run tools/knowledge-cli.ts health_metrics
26
+ ```
27
+
28
+ **Or use MCP tool (fallback only if CLI fails):**
29
+
30
+ ```typescript
31
+ // Get comprehensive health report with decay metrics
32
+ get_knowledge_health({})
33
+ ```
34
+
35
+ **This returns:**
36
+ - Memory counts by lifecycle state (ACTIVE, DORMANT, ARCHIVED, EXPIRED, SOFT_DELETED, PERMANENT)
37
+ - Aggregate statistics (total, average decay, average importance, average stability)
38
+ - Age distribution (under 7 days, 7-30 days, 30-90 days, over 90 days)
39
+ - Last maintenance run information
40
+
41
+ ---
42
+
43
+ ## Step 3: Present Health Report
44
+
45
+ **Format health information for user:**
46
+
47
+ ```markdown
48
+ 📊 **Knowledge Graph Health Report**
49
+ Memory Decay & Lifecycle Status
50
+
51
+ ---
52
+
53
+ **🔄 Memory Lifecycle Distribution**
54
+
55
+ | State | Count | Percentage | Description |
56
+ |-------|-------|------------|-------------|
57
+ | **ACTIVE** | [N] | [X]% | Recently accessed, full relevance |
58
+ | **DORMANT** | [N] | [X]% | Not accessed 30+ days |
59
+ | **ARCHIVED** | [N] | [X]% | Not accessed 90+ days |
60
+ | **EXPIRED** | [N] | [X]% | Marked for deletion |
61
+ | **SOFT_DELETED** | [N] | [X]% | Deleted but recoverable (90 days) |
62
+ | **PERMANENT** | [N] | [X]% | Exempt from decay (importance ≥4, stability ≥4) |
63
+
64
+ ---
65
+
66
+ **📈 Aggregate Metrics**
67
+
68
+ **Total Memories:** [N] (excluding soft-deleted)
69
+
70
+ **Decay Scores:**
71
+ - Average Decay Score: [X.XX] (0.0 = fresh, 1.0 = fully decayed)
72
+ - Decay Rate: [healthy/elevated/concerning]
73
+
74
+ **Classification:**
75
+ - Average Importance: [X.XX]/5.0 (1=trivial, 5=core)
76
+ - Average Stability: [X.XX]/5.0 (1=volatile, 5=permanent)
77
+
78
+ ---
79
+
80
+ **📅 Memory Age Distribution**
81
+
82
+ | Age Bucket | Count | Percentage |
83
+ |------------|-------|------------|
84
+ | **Under 7 days** | [N] | [X]% |
85
+ | **7-30 days** | [N] | [X]% |
86
+ | **30-90 days** | [N] | [X]% |
87
+ | **Over 90 days** | [N] | [X]% |
88
+
89
+ ---
90
+
91
+ **⚙️ Last Maintenance**
92
+
93
+ - **Last Run:** [date/time]
94
+ - **Duration:** [X.XX] seconds
95
+ - **Memories Processed:** [N]
96
+ - **State Transitions:** [N]
97
+ - **Decay Scores Updated:** [N]
98
+ - **Soft-Deleted Purged:** [N]
99
+
100
+ ---
101
+
102
+ **🎯 Health Status**
103
+
104
+ Overall Status: [🟢 Healthy / 🟡 Warning / 🔴 Action Needed]
105
+
106
+ **Recommendations:**
107
+ - [Based on metrics above]
108
+ ```
109
+
110
+ ---
111
+
112
+ ## Health Indicators
113
+
114
+ **🟢 Healthy Status:**
115
+ - Average decay score < 0.4
116
+ - Active memories > 50%
117
+ - Dormant + Archived < 30%
118
+ - No expired memories
119
+ - Maintenance ran within last 7 days
120
+
121
+ **🟡 Warning Status:**
122
+ - Average decay score 0.4-0.6
123
+ - Active memories 30-50%
124
+ - Dormant + Archived 30-50%
125
+ - Few expired memories (< 10)
126
+ - Maintenance ran 7-14 days ago
127
+
128
+ **🔴 Action Needed:**
129
+ - Average decay score > 0.6
130
+ - Active memories < 30%
131
+ - Dormant + Archived > 50%
132
+ - Many expired memories (> 10)
133
+ - Maintenance not run in 14+ days
134
+
135
+ ---
136
+
137
+ ## Decay Score Interpretation
138
+
139
+ **What Decay Scores Mean:**
140
+
141
+ | Score Range | Interpretation | Action |
142
+ |-------------|----------------|--------|
143
+ | 0.0 - 0.2 | Fresh | No action needed |
144
+ | 0.2 - 0.4 | Slightly stale | Consider re-accessing if important |
145
+ | 0.4 - 0.6 | Moderately stale | May transition to DORMANT soon |
146
+ | 0.6 - 0.8 | Significantly stale | Likely DORMANT/ARCHIVED, consider reviewing |
147
+ | 0.8 - 1.0 | Fully decayed | Candidate for archival/deletion |
148
+
149
+ **Factors Affecting Decay:**
150
+ - **Time since last access** - Primary factor
151
+ - **Stability score** - Higher stability = slower decay
152
+ - **Importance score** - Higher importance = slower decay
153
+ - **Permanent memories** (importance ≥4, stability ≥4) - Never decay
154
+
155
+ ---
156
+
157
+ ## Lifecycle State Transitions
158
+
159
+ **Automatic Transitions (During Maintenance):**
160
+
161
+ ```
162
+ ACTIVE → DORMANT (30+ days inactive, decay ≥ 0.3)
163
+
164
+ DORMANT → ARCHIVED (90+ days inactive, decay ≥ 0.5)
165
+
166
+ ARCHIVED → EXPIRED (180+ days inactive, decay ≥ 0.7, importance < 3)
167
+
168
+ EXPIRED → SOFT_DELETED (on maintenance run)
169
+
170
+ SOFT_DELETED → (purged after 90-day retention)
171
+ ```
172
+
173
+ **Reactivation (On Access):**
174
+ - Any access to DORMANT or ARCHIVED memory → immediately back to ACTIVE
175
+ - Decay score resets to 0.0
176
+ - Last accessed timestamp updated
177
+
178
+ **Permanent Memories:**
179
+ - Never transition from ACTIVE
180
+ - Decay score always 0.0
181
+ - Exempt from all lifecycle transitions
182
+
183
+ ---
184
+
185
+ ## Maintenance Recommendations
186
+
187
+ **When to Run Maintenance:**
188
+
189
+ 1. **Scheduled:** Run weekly to recalculate decay scores
190
+ 2. **After bulk import:** Classify new memories
191
+ 3. **High decay scores:** Recalculate after significant time has passed
192
+ 4. **Before cleanup:** Identify expired memories for review
193
+
194
+ **How to Run Maintenance:**
195
+
196
+ See `RunMaintenance.md` workflow for detailed instructions.
197
+
198
+ ---
199
+
200
+ ## Integration with Other Workflows
201
+
202
+ **Before:**
203
+ - GetStatus - Ensure server is healthy before requesting health report
204
+
205
+ **After:**
206
+ - RunMaintenance - If health shows stale decay scores, run: `bun run tools/knowledge-cli.ts run_maintenance`
207
+ - SearchKnowledge - Review memories in concerning lifecycle states
208
+
209
+ **Related Workflows:**
210
+ - `RunMaintenance.md` - Update decay scores and transition states
211
+ - `GetStatus.md` - Check server operational health
212
+ - `SearchKnowledge.md` - Find memories in specific lifecycle states
@@ -0,0 +1,142 @@
1
+ # Investigative Search Workflow
2
+
3
+ **Feature 020**: Graph traversal for entity connection analysis
4
+
5
+ ## Triggers
6
+
7
+ - "investigate entity", "investigate [entity name]"
8
+ - "find connections", "show connections", "entity connections"
9
+ - "graph traversal", "connected entities", "entity network"
10
+ - "threat hunting", "related entities", "link analysis"
11
+
12
+ ## Purpose
13
+
14
+ Discover entities connected to a target entity through graph traversal, enabling:
15
+ - **Threat Hunting**: Trace malware to threat actors, infrastructure, and campaigns
16
+ - **OSINT Analysis**: Map relationships between accounts, domains, and investigations
17
+ - **Knowledge Exploration**: Find related concepts, people, and organizations
18
+
19
+ ## Usage
20
+
21
+ ### Basic Investigation
22
+
23
+ ```bash
24
+ # Investigate an entity (1-hop by default)
25
+ bun run tools/knowledge-cli.ts investigate "apt28"
26
+
27
+ # Investigate with deeper traversal
28
+ bun run tools/knowledge-cli.ts investigate "apt28" --depth 2
29
+ bun run tools/knowledge-cli.ts investigate "trinity-mini" --depth 3
30
+ ```
31
+
32
+ ### Filter by Relationship Type
33
+
34
+ ```bash
35
+ # Only show specific relationship types
36
+ bun run tools/knowledge-cli.ts investigate "apt28" --relationship-type attributed_to --relationship-type uses
37
+
38
+ # Combine depth and relationship filters
39
+ bun run tools/knowledge-cli.ts investigate "malware-x" --depth 2 --relationship-type variant_of
40
+ ```
41
+
42
+ ## Options
43
+
44
+ | Option | Description | Default | Range |
45
+ |--------|-------------|---------|-------|
46
+ | `--depth <N>` | Traversal depth (hops from source) | 1 | 1-3 |
47
+ | `--relationship-type` | Filter by relationship type (multiple allowed) | All types | Any valid type |
48
+
49
+ ## Output Format
50
+
51
+ ```
52
+ Entity: [TYPE] name - summary
53
+ Created: [timestamp] | Importance: [score] | Stability: [score]
54
+
55
+ Connections (2-hop):
56
+ 1. [RELATIONSHIP] target-name [TYPE] (hop 1)
57
+ → [RELATIONSHIP] next-target [TYPE] (hop 2)
58
+
59
+ Investigation completed in 234ms
60
+ ```
61
+
62
+ ## Relationship Types
63
+
64
+ **Standard**: related_to, contains, located_at, part_of
65
+
66
+ **CTI (Feature 018)**:
67
+ - `uses` - Malware uses TTPs
68
+ - `targets` - Campaign targets organization
69
+ - `attributed_to` - Attack attributed to threat actor
70
+ - `exploits` - Malware exploits vulnerability
71
+ - `variant_of` - Malware is variant of parent
72
+
73
+ **OSINT (Feature 018)**:
74
+ - `owns` - Person owns account
75
+ - `hosted_on` - Domain hosted on infrastructure
76
+ - `investigates` - Investigation investigates entity
77
+ - `links_to` - Indicator links to infrastructure
78
+
79
+ ## Examples
80
+
81
+ ### Example 1: Threat Actor Investigation
82
+
83
+ User: "Investigate apt28 connections"
84
+
85
+ ```bash
86
+ bun run tools/knowledge-cli.ts investigate "apt28" --depth 2
87
+ ```
88
+
89
+ Output:
90
+ ```
91
+ Entity: THREAT_ACTOR APT28 - Russian state-sponsored threat actor
92
+ Created: 2026-01-15 | Importance: 5 | Stability: 5
93
+
94
+ Connections (2-hop):
95
+ 1. [attributed_to] Sandworm Team [THREAT_ACTOR] (hop 1)
96
+ 2. [uses] Covenant [MALWARE] (hop 1)
97
+ → [exploits] CVE-2023-1234 [VULNERABILITY] (hop 2)
98
+ 3. [targets] Energy Sector [ORGANIZATION] (hop 1)
99
+ 4. [uses] Sobek [MALWARE] (hop 1)
100
+ → [variant_of] Sombra [MALWARE] (hop 2)
101
+
102
+ Investigation completed in 456ms
103
+ ```
104
+
105
+ ### Example 2: OSINT Account Analysis
106
+
107
+ User: "Find connections to @suspicious_user"
108
+
109
+ ```bash
110
+ bun run tools/knowledge-cli.ts investigate "@suspicious_user" --depth 2 --relationship-type owns
111
+ ```
112
+
113
+ ### Example 3: Malware Family Tracing
114
+
115
+ User: "Show what trinity-mini connects to"
116
+
117
+ ```bash
118
+ bun run tools/knowledge-cli.ts investigate "trinity-mini" --depth 3
119
+ ```
120
+
121
+ ## Use Cases
122
+
123
+ | Domain | Example | Depth |
124
+ |--------|---------|-------|
125
+ | **Threat Intel** | Trace malware → threat actor → campaign | 2-3 |
126
+ | **OSINT** | Map account → person → other accounts | 2 |
127
+ | **Due Diligence** | Company → subsidiaries → executives | 2 |
128
+ | **Research** | Concept → related concepts → documents | 1-2 |
129
+
130
+ ## Performance Notes
131
+
132
+ - **Depth 1**: < 100ms typical
133
+ - **Depth 2**: 100-500ms typical
134
+ - **Depth 3**: 500-2000ms typical (highly connected entities)
135
+
136
+ **Warning**: Entities with 500+ connections may trigger performance alerts.
137
+
138
+ ## Related Workflows
139
+
140
+ - **SearchKnowledge** - Find entities by semantic search
141
+ - **SearchFacts** - Find specific relationships
142
+ - **OntologyManagement** - Configure custom entity/relationship types
@@ -0,0 +1,201 @@
1
+ # Ontology Management Workflow
2
+
3
+ **Feature 018**: OSINT/CTI custom entity and relationship types
4
+
5
+ ## Triggers
6
+
7
+ - "list ontology", "custom entity types", "CTI entities", "OSINT entities"
8
+ - "ontology config", "validate ontology", "check ontology"
9
+ - "reload ontology", "refresh ontology types"
10
+
11
+ ## Purpose
12
+
13
+ Manage custom entity types and relationship types for Cyber Threat Intelligence (CTI) and Open Source Intelligence (OSINT) workflows.
14
+
15
+ ## OSINT/CTI Entity Types
16
+
17
+ ### CTI Entities
18
+
19
+ | Type | Description | Example |
20
+ |------|-------------|---------|
21
+ | **ThreatActor** | Malicious actors, APT groups | APT28, Sandworm |
22
+ | **Malware** | Malicious software, ransomware | LockBit 3.0, TrickBot |
23
+ | **Vulnerability** | CVE, security flaws | CVE-2023-23397 |
24
+ | **Campaign** | Coordinated threat activities | Operation Winter Vivern |
25
+ | **Indicator** | IoCs, hashes, IPs, domains | 192.168.1.1, malware.exe |
26
+ | **Infrastructure** | C2 servers, attack infrastructure | malicious-c2[.]com |
27
+ | **TTP** | Tactics, Techniques, Procedures | Phishing, Lateral Movement |
28
+
29
+ ### OSINT Entities
30
+
31
+ | Type | Description | Example |
32
+ |------|-------------|---------|
33
+ | **Account** | Social media, email accounts | @target_user, admin@example.com |
34
+ | **Domain** | Registered domains, DNS | suspicious-domain[.]com |
35
+ | **Email** | Email addresses | target@company.com |
36
+ | **Phone** | Phone numbers, mobile devices | +1-555-0123 |
37
+ | **Image** | Photos, screenshots, media | evidence_screenshot.png |
38
+ | **Investigation** | OSINT investigations, cases | Case-2024-001 |
39
+
40
+ ## Relationship Types
41
+
42
+ ### CTI Relationships
43
+
44
+ | Relationship | From → To | Example |
45
+ |--------------|-----------|---------|
46
+ | `uses` | ThreatActor/Malware → TTP | APT28 uses Phishing |
47
+ | `targets` | ThreatActor/Campaign → Org | APT28 targets Energy Sector |
48
+ | `attributed_to` | Attack → ThreatActor | Attack attributed to APT28 |
49
+ | `exploits` | Malware → Vulnerability | LockBit exploits CVE-2023-1234 |
50
+ | `variant_of` | Malware → Malware | BlackCat variant of ALPHV |
51
+ | `located_at` | Infrastructure → Location | C2 located_at Russia |
52
+ | `communicates_with` | Infrastructure → Infrastructure | Bot1 communicates_with C2 |
53
+ | `associated_with` | Any → Any | Campaign associated_with ThreatActor |
54
+
55
+ ### OSINT Relationships
56
+
57
+ | Relationship | From → To | Example |
58
+ |--------------|-----------|---------|
59
+ | `owns` | Person → Account | User owns @twitter_handle |
60
+ | `registered_to` | Domain → Person/Org | Domain registered_to John Doe |
61
+ | `hosted_on` | Domain → Infrastructure | Domain hosted_on 1.2.3.4 |
62
+ | `contacted_via` | Person → Phone/Email | User contacted_via phone |
63
+ | `contains` | Investigation → Evidence | Case contains image |
64
+ | `investigates` | Investigation → Entity | Case investigates ThreatActor |
65
+ | `links_to` | Indicator → Infrastructure | IP links_to Domain |
66
+ | `exposes` | Evidence → Entity | Screenshot exposes Account |
67
+
68
+ ## CLI Commands
69
+
70
+ ### List Ontology Types
71
+
72
+ ```bash
73
+ # Show all custom entity and relationship types
74
+ bun run tools/knowledge-cli.ts ontology:list
75
+ ```
76
+
77
+ Output:
78
+ ```
79
+ Custom Entity Types (13):
80
+ CTI: ThreatActor, Malware, Vulnerability, Campaign, Indicator, Infrastructure, TTP
81
+ OSINT: Account, Domain, Email, Phone, Image, Investigation
82
+
83
+ Custom Relationship Types (17):
84
+ CTI: uses, targets, attributed_to, exploits, variant_of, located_at, communicates_with, associated_with
85
+ OSINT: owns, registered_to, hosted_on, contacted_via, contains, investigates, links_to, exposes
86
+
87
+ Configured from: config/ontology-types.yaml
88
+ Template: cti-base (7 entity types, 8 relationship types)
89
+ Loaded: 2026-02-04T12:00:00Z
90
+ ```
91
+
92
+ ### Validate Ontology
93
+
94
+ ```bash
95
+ # Validate ontology configuration
96
+ bun run tools/knowledge-cli.ts ontology:validate
97
+ ```
98
+
99
+ Output:
100
+ ```
101
+ ✓ Ontology configuration is valid
102
+ - 13 entity types defined
103
+ - 17 relationship types defined
104
+ - No duplicate type names
105
+ - No invalid YAML syntax
106
+ ```
107
+
108
+ ### Reload Ontology
109
+
110
+ ```bash
111
+ # Hot-reload ontology configuration (no restart required)
112
+ bun run tools/knowledge-cli.ts ontology:reload
113
+ ```
114
+
115
+ Use after editing `config/ontology-types.yaml` or `config/ontologies/` templates.
116
+
117
+ ## Configuration
118
+
119
+ Ontology types are configured in `config/ontology-types.yaml`:
120
+
121
+ ```yaml
122
+ custom_entity_types:
123
+ cti:
124
+ - ThreatActor
125
+ - Malware
126
+ - Vulnerability
127
+ - Campaign
128
+ - Indicator
129
+ - Infrastructure
130
+ - TTP
131
+ osint:
132
+ - Account
133
+ - Domain
134
+ - Email
135
+ - Phone
136
+ - Image
137
+ - Investigation
138
+
139
+ custom_relationship_types:
140
+ cti:
141
+ - uses
142
+ - targets
143
+ - attributed_to
144
+ # ... more types
145
+ osint:
146
+ - owns
147
+ - registered_to
148
+ # ... more types
149
+ ```
150
+
151
+ ## Templates
152
+
153
+ Pre-built ontology templates available in `config/ontologies/`:
154
+
155
+ | Template | Description | File |
156
+ |----------|-------------|------|
157
+ | `cti-base` | Basic CTI entities (7) | `cti-base.yaml` |
158
+ | `mitre-attack` | MITRE ATT&CK aligned | `mitre-attack.yaml` |
159
+ | `osint-base` | OSINT entities (6) | `osint-base.yaml` |
160
+
161
+ Switch templates by editing `config/ontology-types.yaml` and reloading.
162
+
163
+ ## Examples
164
+
165
+ ### Example 1: List Available Types
166
+
167
+ User: "What entity types are available?"
168
+
169
+ ```bash
170
+ bun run tools/knowledge-cli.ts ontology:list
171
+ ```
172
+
173
+ ### Example 2: Validate After Edit
174
+
175
+ User: "Check if my ontology config is valid"
176
+
177
+ ```bash
178
+ bun run tools/knowledge-cli.ts ontology:validate
179
+ ```
180
+
181
+ ### Example 3: Apply New Configuration
182
+
183
+ User: "I added custom types, reload the config"
184
+
185
+ ```bash
186
+ bun run tools/knowledge-cli.ts ontology:reload
187
+ ```
188
+
189
+ ## Related Workflows
190
+
191
+ - **InvestigateEntity** - Use custom entity types for graph traversal
192
+ - **StixImport** - Import STIX 2.1 bundles with custom types
193
+ - **CaptureEpisode** - Episodes automatically extract custom entities
194
+
195
+ ## MCP Tools
196
+
197
+ | Tool | Description |
198
+ |------|-------------|
199
+ | `list_ontology_types` | List custom entity and relationship types |
200
+ | `validate_ontology` | Validate ontology configuration |
201
+ | `reload_ontology` | Hot-reload ontology from config file |