wisdomgraph 0.1.0__tar.gz

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 (34) hide show
  1. wisdomgraph-0.1.0/LICENSE +21 -0
  2. wisdomgraph-0.1.0/PKG-INFO +336 -0
  3. wisdomgraph-0.1.0/README.md +269 -0
  4. wisdomgraph-0.1.0/pyproject.toml +87 -0
  5. wisdomgraph-0.1.0/setup.cfg +4 -0
  6. wisdomgraph-0.1.0/tests/test_cache.py +68 -0
  7. wisdomgraph-0.1.0/tests/test_classify.py +113 -0
  8. wisdomgraph-0.1.0/tests/test_detect.py +98 -0
  9. wisdomgraph-0.1.0/tests/test_ingest.py +46 -0
  10. wisdomgraph-0.1.0/tests/test_security.py +74 -0
  11. wisdomgraph-0.1.0/tests/test_validate.py +84 -0
  12. wisdomgraph-0.1.0/wisdom/__init__.py +10 -0
  13. wisdomgraph-0.1.0/wisdom/__main__.py +429 -0
  14. wisdomgraph-0.1.0/wisdom/cache.py +81 -0
  15. wisdomgraph-0.1.0/wisdom/classify.py +121 -0
  16. wisdomgraph-0.1.0/wisdom/connect.py +147 -0
  17. wisdomgraph-0.1.0/wisdom/detect.py +145 -0
  18. wisdomgraph-0.1.0/wisdom/docker.py +94 -0
  19. wisdomgraph-0.1.0/wisdom/export.py +125 -0
  20. wisdomgraph-0.1.0/wisdom/ingest.py +88 -0
  21. wisdomgraph-0.1.0/wisdom/merge.py +158 -0
  22. wisdomgraph-0.1.0/wisdom/reflect.py +254 -0
  23. wisdomgraph-0.1.0/wisdom/report.py +131 -0
  24. wisdomgraph-0.1.0/wisdom/security.py +54 -0
  25. wisdomgraph-0.1.0/wisdom/skill-claw.md +43 -0
  26. wisdomgraph-0.1.0/wisdom/skill.md +417 -0
  27. wisdomgraph-0.1.0/wisdom/traverse.py +224 -0
  28. wisdomgraph-0.1.0/wisdom/validate.py +46 -0
  29. wisdomgraph-0.1.0/wisdomgraph.egg-info/PKG-INFO +336 -0
  30. wisdomgraph-0.1.0/wisdomgraph.egg-info/SOURCES.txt +32 -0
  31. wisdomgraph-0.1.0/wisdomgraph.egg-info/dependency_links.txt +1 -0
  32. wisdomgraph-0.1.0/wisdomgraph.egg-info/entry_points.txt +2 -0
  33. wisdomgraph-0.1.0/wisdomgraph.egg-info/requires.txt +57 -0
  34. wisdomgraph-0.1.0/wisdomgraph.egg-info/top_level.txt +1 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 wisdomGraph contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,336 @@
1
+ Metadata-Version: 2.4
2
+ Name: wisdomgraph
3
+ Version: 0.1.0
4
+ Summary: Accumulative Neo4j-native DIKW wisdom memory for AI coding assistants (Claude Code, OpenClaw)
5
+ License-Expression: MIT
6
+ Project-URL: Homepage, https://github.com/cklam12345/wisdomGraph
7
+ Project-URL: Repository, https://github.com/cklam12345/wisdomGraph
8
+ Project-URL: Issues, https://github.com/cklam12345/wisdomGraph/issues
9
+ Keywords: claude,claude-code,openclaw,neo4j,knowledge-graph,graphrag,dikw,wisdom,memory,accumulative,llm,skill,agent-memory,dozerdb
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: neo4j>=5.0
14
+ Provides-Extra: ast
15
+ Requires-Dist: tree-sitter; extra == "ast"
16
+ Requires-Dist: tree-sitter-python; extra == "ast"
17
+ Requires-Dist: tree-sitter-javascript; extra == "ast"
18
+ Requires-Dist: tree-sitter-typescript; extra == "ast"
19
+ Requires-Dist: tree-sitter-go; extra == "ast"
20
+ Requires-Dist: tree-sitter-rust; extra == "ast"
21
+ Requires-Dist: tree-sitter-java; extra == "ast"
22
+ Requires-Dist: tree-sitter-c; extra == "ast"
23
+ Requires-Dist: tree-sitter-cpp; extra == "ast"
24
+ Requires-Dist: tree-sitter-ruby; extra == "ast"
25
+ Requires-Dist: tree-sitter-c-sharp; extra == "ast"
26
+ Requires-Dist: tree-sitter-kotlin; extra == "ast"
27
+ Requires-Dist: tree-sitter-scala; extra == "ast"
28
+ Requires-Dist: tree-sitter-php; extra == "ast"
29
+ Requires-Dist: tree-sitter-swift; extra == "ast"
30
+ Requires-Dist: tree-sitter-lua; extra == "ast"
31
+ Requires-Dist: tree-sitter-zig; extra == "ast"
32
+ Requires-Dist: tree-sitter-powershell; extra == "ast"
33
+ Requires-Dist: tree-sitter-elixir; extra == "ast"
34
+ Requires-Dist: tree-sitter-objc; extra == "ast"
35
+ Provides-Extra: pdf
36
+ Requires-Dist: pypdf; extra == "pdf"
37
+ Requires-Dist: html2text; extra == "pdf"
38
+ Provides-Extra: office
39
+ Requires-Dist: python-docx; extra == "office"
40
+ Requires-Dist: openpyxl; extra == "office"
41
+ Provides-Extra: all
42
+ Requires-Dist: tree-sitter; extra == "all"
43
+ Requires-Dist: tree-sitter-python; extra == "all"
44
+ Requires-Dist: tree-sitter-javascript; extra == "all"
45
+ Requires-Dist: tree-sitter-typescript; extra == "all"
46
+ Requires-Dist: tree-sitter-go; extra == "all"
47
+ Requires-Dist: tree-sitter-rust; extra == "all"
48
+ Requires-Dist: tree-sitter-java; extra == "all"
49
+ Requires-Dist: tree-sitter-c; extra == "all"
50
+ Requires-Dist: tree-sitter-cpp; extra == "all"
51
+ Requires-Dist: tree-sitter-ruby; extra == "all"
52
+ Requires-Dist: tree-sitter-c-sharp; extra == "all"
53
+ Requires-Dist: tree-sitter-kotlin; extra == "all"
54
+ Requires-Dist: tree-sitter-scala; extra == "all"
55
+ Requires-Dist: tree-sitter-php; extra == "all"
56
+ Requires-Dist: tree-sitter-swift; extra == "all"
57
+ Requires-Dist: tree-sitter-lua; extra == "all"
58
+ Requires-Dist: tree-sitter-zig; extra == "all"
59
+ Requires-Dist: tree-sitter-powershell; extra == "all"
60
+ Requires-Dist: tree-sitter-elixir; extra == "all"
61
+ Requires-Dist: tree-sitter-objc; extra == "all"
62
+ Requires-Dist: pypdf; extra == "all"
63
+ Requires-Dist: html2text; extra == "all"
64
+ Requires-Dist: python-docx; extra == "all"
65
+ Requires-Dist: openpyxl; extra == "all"
66
+ Dynamic: license-file
67
+
68
+ # wisdomGraph
69
+
70
+ [English](README.md) | [简体中文](README.zh-CN.md)
71
+
72
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
73
+ [![Neo4j](https://img.shields.io/badge/Neo4j-native-008CC1?logo=neo4j)](https://neo4j.com)
74
+ [![Claude Code](https://img.shields.io/badge/Claude%20Code-skill-blueviolet)](https://claude.ai/code)
75
+ [![OpenClaw](https://img.shields.io/badge/OpenClaw-skill-orange)](https://openclaw.ai)
76
+
77
+ > **graphify gives you a snapshot. wisdomGraph gives you memory that compounds.**
78
+
79
+ Type `/wisdom` in Claude Code or OpenClaw. Feed it your codebases, notes, papers, conversations — every run **merges** into a living Neo4j graph. The graph doesn't reset. It accumulates. Facts become patterns. Patterns become insights. Insights become wisdom.
80
+
81
+ ```
82
+ /wisdom . # absorb this project into the wisdom graph
83
+ /wisdom ask "what patterns repeat across all my projects?"
84
+ /wisdom reflect # promote insights → wisdom, close the feedback loop
85
+ ```
86
+
87
+ ---
88
+
89
+ ## The step function over graphify
90
+
91
+ graphify is excellent at what it does: turn a folder into a knowledge graph snapshot. One run, one `graph.json`, one `GRAPH_REPORT.md`. Read it. Next session, start over.
92
+
93
+ wisdomGraph does something fundamentally different.
94
+
95
+ | | graphify | wisdomGraph |
96
+ |---|---|---|
97
+ | **Storage** | `graph.json` file (per-project) | Neo4j (persistent, all projects) |
98
+ | **Node types** | flat (code entities, concepts) | typed DIKW: Knowledge / Experience / Insight / Wisdom |
99
+ | **Runs** | snapshot, overwrites | MERGE — each run grows the graph |
100
+ | **Query** | read GRAPH_REPORT.md | live Cypher traversal at inference time |
101
+ | **Memory** | resets each session | accumulates across sessions, projects, months |
102
+ | **Reasoning** | community detection (topology) | graph path traversal + DIKW hierarchy |
103
+ | **Feedback loop** | none | Wisdom → Knowledge (neuroplasticity) |
104
+ | **Database** | none required | Neo4j Aura (free) or DozerDB Docker |
105
+
106
+ The difference is not incremental. It's architectural. graphify compresses a codebase into a readable report. wisdomGraph builds an artificial epistemology — one that remembers, connects, and grows.
107
+
108
+ ---
109
+
110
+ ## The DIKW pyramid, operationalized
111
+
112
+ Human experts don't store flat facts. They organize experience into layers:
113
+
114
+ ```
115
+ Wisdom ← actionable principles derived from patterns
116
+
117
+ Insight ← patterns detected across multiple experiences
118
+
119
+ Experience ← events, decisions, outcomes with context
120
+
121
+ Knowledge ← verified facts, documented behaviors, extracted structure
122
+ ```
123
+
124
+ Every node in the wisdomGraph carries a `tier` label. The graph topology **is** the cognitive architecture. When you ask a question, Cypher traverses upward through the tiers — not keyword-matching flat text, but reasoning across lived experience.
125
+
126
+ The feedback loop is critical: when a Wisdom node is queried and found useful, it reinforces connected Knowledge nodes. The graph learns what matters.
127
+
128
+ ---
129
+
130
+ ## Install
131
+
132
+ **Requires:** Python 3.10+ and one of: [Claude Code](https://claude.ai/code), [OpenClaw](https://openclaw.ai)
133
+
134
+ **And one of:** [Neo4j Aura Free](https://neo4j.com/cloud/platform/aura-graph-database/) (cloud, no install) or [DozerDB](https://dozerdb.org) (local Docker, APOC included)
135
+
136
+ ```bash
137
+ pip install wisdomgraph && wisdom install
138
+ ```
139
+
140
+ ### Option A — Neo4j Aura (zero infra, recommended for individuals)
141
+
142
+ 1. Create a free account at [neo4j.com/cloud/aura](https://neo4j.com/cloud/aura)
143
+ 2. Create a free AuraDB instance — copy the connection URI and password
144
+ 3. Run:
145
+
146
+ ```bash
147
+ wisdom connect bolt+s://xxxxxxxx.databases.neo4j.io --user neo4j --password <your-password>
148
+ ```
149
+
150
+ Free tier: 200,000 nodes. Enough for years of accumulated wisdom.
151
+
152
+ ### Option B — DozerDB local Docker (full control, APOC included)
153
+
154
+ ```bash
155
+ wisdom docker up # pulls graphstack/dozerdb:5.26.3.0 and starts it
156
+ wisdom connect bolt://localhost:7687 --user neo4j --password password
157
+ ```
158
+
159
+ Or manually:
160
+
161
+ ```bash
162
+ docker run -d \
163
+ -p 7474:7474 -p 7687:7687 \
164
+ -v $HOME/neo4j/data:/data \
165
+ -v $HOME/neo4j/logs:/logs \
166
+ --env NEO4J_AUTH=neo4j/password \
167
+ --env NEO4J_PLUGINS='["apoc"]' \
168
+ graphstack/dozerdb:5.26.3.0
169
+ ```
170
+
171
+ Open [localhost:7474](http://localhost:7474) — Neo4j Browser is your visual window into the wisdom graph.
172
+
173
+ ---
174
+
175
+ ## Platform support
176
+
177
+ | Platform | Install command |
178
+ |----------|----------------|
179
+ | Claude Code (Linux/Mac) | `wisdom install` |
180
+ | Claude Code (Windows) | `wisdom install --platform windows` |
181
+ | OpenClaw | `wisdom install --platform claw` |
182
+
183
+ Then open your AI coding assistant and type:
184
+
185
+ ```
186
+ /wisdom .
187
+ ```
188
+
189
+ ---
190
+
191
+ ## Usage
192
+
193
+ ```
194
+ /wisdom # absorb current directory
195
+ /wisdom ./raw # absorb a specific folder
196
+ /wisdom ./raw --mode deep # aggressive INFERRED edge extraction
197
+ /wisdom ./raw --update # re-absorb only changed files, MERGE into graph
198
+ /wisdom ./raw --tier knowledge # force all extractions into Knowledge tier only
199
+
200
+ /wisdom add https://arxiv.org/abs/1706.03762 # absorb a paper
201
+ /wisdom add https://x.com/... # absorb a tweet thread
202
+ /wisdom add https://... --author "Name" # tag the source author
203
+
204
+ /wisdom ask "what patterns repeat across all my projects?"
205
+ /wisdom ask "what do I know about authentication flows?"
206
+ /wisdom ask "trace the path from attention to optimizer"
207
+ /wisdom ask "..." --tier wisdom # only traverse Wisdom-tier nodes in answer
208
+
209
+ /wisdom reflect # LLM promotion pass: Knowledge→Experience→Insight→Wisdom
210
+ /wisdom reflect --project ./raw # reflect only on nodes from this corpus
211
+
212
+ /wisdom path "DigestAuth" "OAuth" # shortest path between two concepts
213
+ /wisdom explain "CausalSelfAttention" # full DIKW context for a node
214
+ /wisdom god-nodes # highest-degree concepts across all projects
215
+
216
+ /wisdom export --cypher # dump all nodes/edges as Cypher CREATE statements
217
+ /wisdom export --json # export to graph.json (graphify-compatible)
218
+ /wisdom export --obsidian # export to Obsidian vault
219
+
220
+ /wisdom status # graph stats: node counts by tier, edge counts, last update
221
+ /wisdom purge --project ./raw # remove nodes from one corpus, touch nothing else
222
+ ```
223
+
224
+ ---
225
+
226
+ ## How wisdom accumulates
227
+
228
+ **Run 1** — absorb your auth library:
229
+ ```
230
+ Knowledge: JWT, session tokens, cookie flags, PKCE flow
231
+ Experience: (none yet — single source)
232
+ ```
233
+
234
+ **Run 2** — absorb a different project's auth:
235
+ ```
236
+ Knowledge: JWT, PKCE — MERGE deduplicates, adds a source link
237
+ Experience: two implementations, same pattern detected
238
+ Insight: JWT + PKCE is the converged pattern in your work
239
+ ```
240
+
241
+ **Run 3** — `/wisdom reflect`:
242
+ ```
243
+ Wisdom: "Use stateless JWT for APIs, PKCE for browser flows.
244
+ Shipped this pattern across 3 projects without incident."
245
+ ```
246
+
247
+ **Run 4** — `/wisdom ask "how should I handle auth in this new service?"`:
248
+ ```
249
+ Traversal: Knowledge → Experience → Insight → Wisdom
250
+ Answer: your own battle-tested principle, grounded in your actual history
251
+ ```
252
+
253
+ This is not RAG. This is not summarization. This is the graph traversing your accumulated experience to return *your own wisdom back to you*.
254
+
255
+ ---
256
+
257
+ ## Graph schema
258
+
259
+ ```cypher
260
+ // DIKW node labels
261
+ (:Knowledge {id, label, content, source_file, confidence, timestamp, project})
262
+ (:Experience {id, label, content, context, outcome, timestamp, project})
263
+ (:Insight {id, label, content, pattern_strength, source_count, timestamp})
264
+ (:Wisdom {id, label, principle, confidence, reinforcement_count, timestamp})
265
+
266
+ // Relationships
267
+ (Knowledge)-[:GROUNDS]->(Experience)
268
+ (Experience)-[:REVEALS]->(Insight)
269
+ (Insight)-[:CRYSTALLIZES_INTO]->(Wisdom)
270
+ (Wisdom)-[:REINFORCES]->(Knowledge) // feedback loop — the graph learns
271
+
272
+ (Knowledge)-[:SEMANTICALLY_SIMILAR_TO]->(Knowledge)
273
+ (Insight)-[:CONTRADICTS]->(Insight) // tension surfaces, needs reflection
274
+ (any)-[:SOURCED_FROM]->(Source {uri, author, ingested_at})
275
+
276
+ // Cross-agent composite index
277
+ CREATE INDEX wisdom_composite IF NOT EXISTS
278
+ FOR (n:Knowledge|Experience|Insight|Wisdom)
279
+ ON (n.id, n.timestamp, n.confidence)
280
+ ```
281
+
282
+ Confidence flows through the graph. An Insight grounded in 8 Experiences has higher `pattern_strength` than one from 2. Wisdom nodes track `reinforcement_count` — how many traversals confirmed the principle.
283
+
284
+ ---
285
+
286
+ ## What you get
287
+
288
+ **Cross-project god nodes** — concepts central across *all* your projects and corpora, not just one repo.
289
+
290
+ **Contradiction detection** — two Insights pointing in opposite directions surface as `CONTRADICTS` edges. The graph shows the conflict; you resolve it into better Wisdom.
291
+
292
+ **Temporal decay** — nodes carry timestamps. Old Knowledge not reinforced by recent Experience gets flagged. The graph ages gracefully, like expert memory.
293
+
294
+ **Full provenance chain** — every node links back to its `Source`. `/wisdom explain "node"` returns the full DIKW path: fact → context → pattern → principle.
295
+
296
+ **The "why" chain** — not just *what* but *why it matters*, extracted from docstrings, `# NOTE:` comments, design rationale in docs, and the DIKW promotion reasoning.
297
+
298
+ ---
299
+
300
+ ## Deployment options
301
+
302
+ | | Aura Free | DozerDB Local |
303
+ |---|---|---|
304
+ | **Setup** | 3 clicks + URI | 1 docker command |
305
+ | **Cost** | Free (200K nodes) | Free forever |
306
+ | **APOC** | Available | Included |
307
+ | **Data location** | Neo4j cloud | Your machine |
308
+ | **Visual browser** | neo4j.com console | localhost:7474 |
309
+ | **Best for** | Quick start, individuals | Teams, air-gap, full control |
310
+
311
+ ---
312
+
313
+ ## Privacy
314
+
315
+ wisdomGraph sends file contents to your AI coding assistant's model API for semantic extraction — Anthropic (Claude Code) or whichever provider your platform uses. Code files are processed locally via tree-sitter AST. All graph data lives in *your* Neo4j instance (Aura or local). No telemetry, no usage tracking, no analytics.
316
+
317
+ ---
318
+
319
+ ## Tech stack
320
+
321
+ Neo4j (Aura or DozerDB) + tree-sitter + APOC. Semantic extraction via Claude (Claude Code) or your platform's model. The graph database is the intelligence layer — traversal, path-finding, and community detection run natively in Cypher via Neo4j GDS (Graph Data Science library).
322
+
323
+ ---
324
+
325
+ <details>
326
+ <summary>Contributing</summary>
327
+
328
+ **Worked examples** are the highest-trust contribution. Run `/wisdom` on a real multi-project corpus, let it reflect a few times, document what Wisdom nodes emerged and whether they match your intuition. Submit to `worked/{slug}/`.
329
+
330
+ **Schema proposals** — have a relationship type that captures something the current schema misses? Open an issue with the Cypher pattern and a worked example.
331
+
332
+ **DIKW promotion heuristics** — better prompts or rules for when to promote Knowledge → Experience → Insight → Wisdom. The promotion logic is the heart of the system.
333
+
334
+ See [ARCHITECTURE.md](ARCHITECTURE.md) for the full pipeline design, Cypher schemas, and how to extend the tiers.
335
+
336
+ </details>
@@ -0,0 +1,269 @@
1
+ # wisdomGraph
2
+
3
+ [English](README.md) | [简体中文](README.zh-CN.md)
4
+
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
6
+ [![Neo4j](https://img.shields.io/badge/Neo4j-native-008CC1?logo=neo4j)](https://neo4j.com)
7
+ [![Claude Code](https://img.shields.io/badge/Claude%20Code-skill-blueviolet)](https://claude.ai/code)
8
+ [![OpenClaw](https://img.shields.io/badge/OpenClaw-skill-orange)](https://openclaw.ai)
9
+
10
+ > **graphify gives you a snapshot. wisdomGraph gives you memory that compounds.**
11
+
12
+ Type `/wisdom` in Claude Code or OpenClaw. Feed it your codebases, notes, papers, conversations — every run **merges** into a living Neo4j graph. The graph doesn't reset. It accumulates. Facts become patterns. Patterns become insights. Insights become wisdom.
13
+
14
+ ```
15
+ /wisdom . # absorb this project into the wisdom graph
16
+ /wisdom ask "what patterns repeat across all my projects?"
17
+ /wisdom reflect # promote insights → wisdom, close the feedback loop
18
+ ```
19
+
20
+ ---
21
+
22
+ ## The step function over graphify
23
+
24
+ graphify is excellent at what it does: turn a folder into a knowledge graph snapshot. One run, one `graph.json`, one `GRAPH_REPORT.md`. Read it. Next session, start over.
25
+
26
+ wisdomGraph does something fundamentally different.
27
+
28
+ | | graphify | wisdomGraph |
29
+ |---|---|---|
30
+ | **Storage** | `graph.json` file (per-project) | Neo4j (persistent, all projects) |
31
+ | **Node types** | flat (code entities, concepts) | typed DIKW: Knowledge / Experience / Insight / Wisdom |
32
+ | **Runs** | snapshot, overwrites | MERGE — each run grows the graph |
33
+ | **Query** | read GRAPH_REPORT.md | live Cypher traversal at inference time |
34
+ | **Memory** | resets each session | accumulates across sessions, projects, months |
35
+ | **Reasoning** | community detection (topology) | graph path traversal + DIKW hierarchy |
36
+ | **Feedback loop** | none | Wisdom → Knowledge (neuroplasticity) |
37
+ | **Database** | none required | Neo4j Aura (free) or DozerDB Docker |
38
+
39
+ The difference is not incremental. It's architectural. graphify compresses a codebase into a readable report. wisdomGraph builds an artificial epistemology — one that remembers, connects, and grows.
40
+
41
+ ---
42
+
43
+ ## The DIKW pyramid, operationalized
44
+
45
+ Human experts don't store flat facts. They organize experience into layers:
46
+
47
+ ```
48
+ Wisdom ← actionable principles derived from patterns
49
+
50
+ Insight ← patterns detected across multiple experiences
51
+
52
+ Experience ← events, decisions, outcomes with context
53
+
54
+ Knowledge ← verified facts, documented behaviors, extracted structure
55
+ ```
56
+
57
+ Every node in the wisdomGraph carries a `tier` label. The graph topology **is** the cognitive architecture. When you ask a question, Cypher traverses upward through the tiers — not keyword-matching flat text, but reasoning across lived experience.
58
+
59
+ The feedback loop is critical: when a Wisdom node is queried and found useful, it reinforces connected Knowledge nodes. The graph learns what matters.
60
+
61
+ ---
62
+
63
+ ## Install
64
+
65
+ **Requires:** Python 3.10+ and one of: [Claude Code](https://claude.ai/code), [OpenClaw](https://openclaw.ai)
66
+
67
+ **And one of:** [Neo4j Aura Free](https://neo4j.com/cloud/platform/aura-graph-database/) (cloud, no install) or [DozerDB](https://dozerdb.org) (local Docker, APOC included)
68
+
69
+ ```bash
70
+ pip install wisdomgraph && wisdom install
71
+ ```
72
+
73
+ ### Option A — Neo4j Aura (zero infra, recommended for individuals)
74
+
75
+ 1. Create a free account at [neo4j.com/cloud/aura](https://neo4j.com/cloud/aura)
76
+ 2. Create a free AuraDB instance — copy the connection URI and password
77
+ 3. Run:
78
+
79
+ ```bash
80
+ wisdom connect bolt+s://xxxxxxxx.databases.neo4j.io --user neo4j --password <your-password>
81
+ ```
82
+
83
+ Free tier: 200,000 nodes. Enough for years of accumulated wisdom.
84
+
85
+ ### Option B — DozerDB local Docker (full control, APOC included)
86
+
87
+ ```bash
88
+ wisdom docker up # pulls graphstack/dozerdb:5.26.3.0 and starts it
89
+ wisdom connect bolt://localhost:7687 --user neo4j --password password
90
+ ```
91
+
92
+ Or manually:
93
+
94
+ ```bash
95
+ docker run -d \
96
+ -p 7474:7474 -p 7687:7687 \
97
+ -v $HOME/neo4j/data:/data \
98
+ -v $HOME/neo4j/logs:/logs \
99
+ --env NEO4J_AUTH=neo4j/password \
100
+ --env NEO4J_PLUGINS='["apoc"]' \
101
+ graphstack/dozerdb:5.26.3.0
102
+ ```
103
+
104
+ Open [localhost:7474](http://localhost:7474) — Neo4j Browser is your visual window into the wisdom graph.
105
+
106
+ ---
107
+
108
+ ## Platform support
109
+
110
+ | Platform | Install command |
111
+ |----------|----------------|
112
+ | Claude Code (Linux/Mac) | `wisdom install` |
113
+ | Claude Code (Windows) | `wisdom install --platform windows` |
114
+ | OpenClaw | `wisdom install --platform claw` |
115
+
116
+ Then open your AI coding assistant and type:
117
+
118
+ ```
119
+ /wisdom .
120
+ ```
121
+
122
+ ---
123
+
124
+ ## Usage
125
+
126
+ ```
127
+ /wisdom # absorb current directory
128
+ /wisdom ./raw # absorb a specific folder
129
+ /wisdom ./raw --mode deep # aggressive INFERRED edge extraction
130
+ /wisdom ./raw --update # re-absorb only changed files, MERGE into graph
131
+ /wisdom ./raw --tier knowledge # force all extractions into Knowledge tier only
132
+
133
+ /wisdom add https://arxiv.org/abs/1706.03762 # absorb a paper
134
+ /wisdom add https://x.com/... # absorb a tweet thread
135
+ /wisdom add https://... --author "Name" # tag the source author
136
+
137
+ /wisdom ask "what patterns repeat across all my projects?"
138
+ /wisdom ask "what do I know about authentication flows?"
139
+ /wisdom ask "trace the path from attention to optimizer"
140
+ /wisdom ask "..." --tier wisdom # only traverse Wisdom-tier nodes in answer
141
+
142
+ /wisdom reflect # LLM promotion pass: Knowledge→Experience→Insight→Wisdom
143
+ /wisdom reflect --project ./raw # reflect only on nodes from this corpus
144
+
145
+ /wisdom path "DigestAuth" "OAuth" # shortest path between two concepts
146
+ /wisdom explain "CausalSelfAttention" # full DIKW context for a node
147
+ /wisdom god-nodes # highest-degree concepts across all projects
148
+
149
+ /wisdom export --cypher # dump all nodes/edges as Cypher CREATE statements
150
+ /wisdom export --json # export to graph.json (graphify-compatible)
151
+ /wisdom export --obsidian # export to Obsidian vault
152
+
153
+ /wisdom status # graph stats: node counts by tier, edge counts, last update
154
+ /wisdom purge --project ./raw # remove nodes from one corpus, touch nothing else
155
+ ```
156
+
157
+ ---
158
+
159
+ ## How wisdom accumulates
160
+
161
+ **Run 1** — absorb your auth library:
162
+ ```
163
+ Knowledge: JWT, session tokens, cookie flags, PKCE flow
164
+ Experience: (none yet — single source)
165
+ ```
166
+
167
+ **Run 2** — absorb a different project's auth:
168
+ ```
169
+ Knowledge: JWT, PKCE — MERGE deduplicates, adds a source link
170
+ Experience: two implementations, same pattern detected
171
+ Insight: JWT + PKCE is the converged pattern in your work
172
+ ```
173
+
174
+ **Run 3** — `/wisdom reflect`:
175
+ ```
176
+ Wisdom: "Use stateless JWT for APIs, PKCE for browser flows.
177
+ Shipped this pattern across 3 projects without incident."
178
+ ```
179
+
180
+ **Run 4** — `/wisdom ask "how should I handle auth in this new service?"`:
181
+ ```
182
+ Traversal: Knowledge → Experience → Insight → Wisdom
183
+ Answer: your own battle-tested principle, grounded in your actual history
184
+ ```
185
+
186
+ This is not RAG. This is not summarization. This is the graph traversing your accumulated experience to return *your own wisdom back to you*.
187
+
188
+ ---
189
+
190
+ ## Graph schema
191
+
192
+ ```cypher
193
+ // DIKW node labels
194
+ (:Knowledge {id, label, content, source_file, confidence, timestamp, project})
195
+ (:Experience {id, label, content, context, outcome, timestamp, project})
196
+ (:Insight {id, label, content, pattern_strength, source_count, timestamp})
197
+ (:Wisdom {id, label, principle, confidence, reinforcement_count, timestamp})
198
+
199
+ // Relationships
200
+ (Knowledge)-[:GROUNDS]->(Experience)
201
+ (Experience)-[:REVEALS]->(Insight)
202
+ (Insight)-[:CRYSTALLIZES_INTO]->(Wisdom)
203
+ (Wisdom)-[:REINFORCES]->(Knowledge) // feedback loop — the graph learns
204
+
205
+ (Knowledge)-[:SEMANTICALLY_SIMILAR_TO]->(Knowledge)
206
+ (Insight)-[:CONTRADICTS]->(Insight) // tension surfaces, needs reflection
207
+ (any)-[:SOURCED_FROM]->(Source {uri, author, ingested_at})
208
+
209
+ // Cross-agent composite index
210
+ CREATE INDEX wisdom_composite IF NOT EXISTS
211
+ FOR (n:Knowledge|Experience|Insight|Wisdom)
212
+ ON (n.id, n.timestamp, n.confidence)
213
+ ```
214
+
215
+ Confidence flows through the graph. An Insight grounded in 8 Experiences has higher `pattern_strength` than one from 2. Wisdom nodes track `reinforcement_count` — how many traversals confirmed the principle.
216
+
217
+ ---
218
+
219
+ ## What you get
220
+
221
+ **Cross-project god nodes** — concepts central across *all* your projects and corpora, not just one repo.
222
+
223
+ **Contradiction detection** — two Insights pointing in opposite directions surface as `CONTRADICTS` edges. The graph shows the conflict; you resolve it into better Wisdom.
224
+
225
+ **Temporal decay** — nodes carry timestamps. Old Knowledge not reinforced by recent Experience gets flagged. The graph ages gracefully, like expert memory.
226
+
227
+ **Full provenance chain** — every node links back to its `Source`. `/wisdom explain "node"` returns the full DIKW path: fact → context → pattern → principle.
228
+
229
+ **The "why" chain** — not just *what* but *why it matters*, extracted from docstrings, `# NOTE:` comments, design rationale in docs, and the DIKW promotion reasoning.
230
+
231
+ ---
232
+
233
+ ## Deployment options
234
+
235
+ | | Aura Free | DozerDB Local |
236
+ |---|---|---|
237
+ | **Setup** | 3 clicks + URI | 1 docker command |
238
+ | **Cost** | Free (200K nodes) | Free forever |
239
+ | **APOC** | Available | Included |
240
+ | **Data location** | Neo4j cloud | Your machine |
241
+ | **Visual browser** | neo4j.com console | localhost:7474 |
242
+ | **Best for** | Quick start, individuals | Teams, air-gap, full control |
243
+
244
+ ---
245
+
246
+ ## Privacy
247
+
248
+ wisdomGraph sends file contents to your AI coding assistant's model API for semantic extraction — Anthropic (Claude Code) or whichever provider your platform uses. Code files are processed locally via tree-sitter AST. All graph data lives in *your* Neo4j instance (Aura or local). No telemetry, no usage tracking, no analytics.
249
+
250
+ ---
251
+
252
+ ## Tech stack
253
+
254
+ Neo4j (Aura or DozerDB) + tree-sitter + APOC. Semantic extraction via Claude (Claude Code) or your platform's model. The graph database is the intelligence layer — traversal, path-finding, and community detection run natively in Cypher via Neo4j GDS (Graph Data Science library).
255
+
256
+ ---
257
+
258
+ <details>
259
+ <summary>Contributing</summary>
260
+
261
+ **Worked examples** are the highest-trust contribution. Run `/wisdom` on a real multi-project corpus, let it reflect a few times, document what Wisdom nodes emerged and whether they match your intuition. Submit to `worked/{slug}/`.
262
+
263
+ **Schema proposals** — have a relationship type that captures something the current schema misses? Open an issue with the Cypher pattern and a worked example.
264
+
265
+ **DIKW promotion heuristics** — better prompts or rules for when to promote Knowledge → Experience → Insight → Wisdom. The promotion logic is the heart of the system.
266
+
267
+ See [ARCHITECTURE.md](ARCHITECTURE.md) for the full pipeline design, Cypher schemas, and how to extend the tiers.
268
+
269
+ </details>