wisdomgraph 0.2.0__tar.gz → 0.3.1__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 (38) hide show
  1. {wisdomgraph-0.2.0/wisdomgraph.egg-info → wisdomgraph-0.3.1}/PKG-INFO +80 -18
  2. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/README.md +75 -12
  3. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/pyproject.toml +6 -6
  4. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/tests/test_mcp.py +261 -4
  5. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/wisdom/__init__.py +1 -1
  6. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/wisdom/__main__.py +199 -7
  7. wisdomgraph-0.3.1/wisdom/local.py +236 -0
  8. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/wisdom/mcp.py +290 -2
  9. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1/wisdomgraph.egg-info}/PKG-INFO +80 -18
  10. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/wisdomgraph.egg-info/SOURCES.txt +1 -0
  11. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/LICENSE +0 -0
  12. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/setup.cfg +0 -0
  13. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/tests/test_cache.py +0 -0
  14. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/tests/test_classify.py +0 -0
  15. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/tests/test_detect.py +0 -0
  16. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/tests/test_ingest.py +0 -0
  17. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/tests/test_reflect.py +0 -0
  18. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/tests/test_security.py +0 -0
  19. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/tests/test_validate.py +0 -0
  20. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/wisdom/cache.py +0 -0
  21. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/wisdom/classify.py +0 -0
  22. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/wisdom/connect.py +0 -0
  23. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/wisdom/detect.py +0 -0
  24. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/wisdom/docker.py +0 -0
  25. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/wisdom/export.py +0 -0
  26. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/wisdom/ingest.py +0 -0
  27. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/wisdom/merge.py +0 -0
  28. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/wisdom/reflect.py +0 -0
  29. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/wisdom/report.py +0 -0
  30. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/wisdom/security.py +0 -0
  31. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/wisdom/skill-claw.md +0 -0
  32. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/wisdom/skill.md +0 -0
  33. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/wisdom/traverse.py +0 -0
  34. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/wisdom/validate.py +0 -0
  35. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/wisdomgraph.egg-info/dependency_links.txt +0 -0
  36. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/wisdomgraph.egg-info/entry_points.txt +0 -0
  37. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/wisdomgraph.egg-info/requires.txt +0 -0
  38. {wisdomgraph-0.2.0 → wisdomgraph-0.3.1}/wisdomgraph.egg-info/top_level.txt +0 -0
@@ -1,12 +1,12 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.2
2
2
  Name: wisdomgraph
3
- Version: 0.2.0
4
- Summary: Accumulative Neo4j-native DIKW wisdom memory for AI coding assistants (Claude Code, OpenClaw)
5
- License-Expression: MIT
3
+ Version: 0.3.1
4
+ Summary: Graph-native persistent cognition for AI agents using Neo4j, DIKW, and MCP
5
+ License: MIT
6
6
  Project-URL: Homepage, https://github.com/cklam12345/wisdomGraph
7
7
  Project-URL: Repository, https://github.com/cklam12345/wisdomGraph
8
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,mcp,model-context-protocol
9
+ Keywords: claude,claude-code,openclaw,neo4j,knowledge-graph,graphrag,dikw,wisdom,memory,accumulative,llm,skill,agent-memory,agentic-memory,multi-agent,dozerdb,mcp,model-context-protocol,codex
10
10
  Requires-Python: >=3.10
11
11
  Description-Content-Type: text/markdown
12
12
  License-File: LICENSE
@@ -66,7 +66,6 @@ Requires-Dist: pypdf; extra == "all"
66
66
  Requires-Dist: html2text; extra == "all"
67
67
  Requires-Dist: python-docx; extra == "all"
68
68
  Requires-Dist: openpyxl; extra == "all"
69
- Dynamic: license-file
70
69
 
71
70
  # wisdomGraph
72
71
 
@@ -76,11 +75,14 @@ Dynamic: license-file
76
75
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
77
76
  [![Neo4j](https://img.shields.io/badge/Neo4j-native-008CC1?logo=neo4j)](https://neo4j.com)
78
77
  [![Claude Code](https://img.shields.io/badge/Claude%20Code-MCP-blueviolet)](https://claude.ai/code)
78
+ [![Codex](https://img.shields.io/badge/Codex-MCP-black)](https://openai.com/codex)
79
79
  [![OpenClaw](https://img.shields.io/badge/OpenClaw-skill-orange)](https://openclaw.ai)
80
80
 
81
+ > **Graph-native persistent cognition for AI agents.**
82
+ >
81
83
  > **graphify gives you a snapshot. wisdomGraph gives you memory that compounds.**
82
84
 
83
- 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.
85
+ Use wisdomGraph from Claude Code, Codex, OpenClaw, or any MCP host. 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.
84
86
 
85
87
  ```
86
88
  /wisdom . # absorb this project into the wisdom graph
@@ -105,7 +107,7 @@ wisdomGraph does something fundamentally different.
105
107
  | **Memory** | resets each session | accumulates across sessions, projects, months |
106
108
  | **Reasoning** | community detection (topology) | graph path traversal + DIKW hierarchy |
107
109
  | **Feedback loop** | none | Wisdom → Knowledge (neuroplasticity) |
108
- | **Database** | none required | Neo4j Aura (free) or DozerDB Docker |
110
+ | **Database** | none required | Neo4j Aura (free) or local Neo4j Docker |
109
111
 
110
112
  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.
111
113
 
@@ -133,15 +135,51 @@ The feedback loop is critical: when a Wisdom node is queried and found useful, i
133
135
 
134
136
  ## Install
135
137
 
136
- **Requires:** Python 3.10+ and one of: [Claude Code](https://claude.ai/code), [OpenClaw](https://openclaw.ai)
138
+ **Requires:** Python 3.10+ and one of: [Claude Code](https://claude.ai/code), [Codex](https://openai.com/codex), [OpenClaw](https://openclaw.ai), or another MCP host
137
139
 
138
- **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)
140
+ **And one of:** [Neo4j Aura Free](https://neo4j.com/cloud/platform/aura-graph-database/) (cloud, no install) or Docker Desktop/Engine for a managed local Neo4j container
139
141
 
140
142
  ```bash
141
- pip install 'wisdomgraph[mcp]' && wisdom install
143
+ pip install 'wisdomgraph[mcp]'
144
+ wisdom quickstart
142
145
  ```
143
146
 
144
- ### Option A — Neo4j Aura (zero infra, recommended for individuals)
147
+ `wisdom quickstart` is the end-to-end first-time setup. It prepares storage, verifies the Neo4j connection, and registers wisdomGraph with detected MCP hosts.
148
+
149
+ ```bash
150
+ # Local managed Neo4j backend + detected MCP hosts
151
+ wisdom quickstart
152
+
153
+ # Local backend + Codex only
154
+ wisdom quickstart --host codex
155
+
156
+ # Existing Neo4j or DozerDB instance
157
+ wisdom quickstart --storage existing --uri bolt://localhost:7689 --user neo4j --password <password>
158
+
159
+ # Neo4j Aura
160
+ wisdom quickstart --storage aura --uri bolt+s://xxxxxxxx.databases.neo4j.io --user neo4j --password <password>
161
+ ```
162
+
163
+ The MCP server itself never starts Docker or creates databases. Storage setup is explicit through `quickstart`, `local`, `docker`, or `connect`.
164
+
165
+ ### Option A — Managed local backend (recommended first run)
166
+
167
+ ```bash
168
+ wisdom local up
169
+ wisdom doctor
170
+ ```
171
+
172
+ This starts a managed `neo4j:latest` container named `wisdomgraph-neo4j`, stores data under `~/.wisdom/neo4j`, uses the documented local login `neo4j/password`, saves the connection, and leaves MCP startup cleanly separate. The implementation uses the Docker CLI directly, so the same `wisdom local up` command works from Windows PowerShell, Windows cmd.exe, macOS Terminal, and Ubuntu Terminal after Docker is installed.
173
+
174
+ Useful commands:
175
+
176
+ ```bash
177
+ wisdom local status
178
+ wisdom local logs
179
+ wisdom local down
180
+ ```
181
+
182
+ ### Option B — Neo4j Aura (zero local database)
145
183
 
146
184
  1. Create a free account at [neo4j.com/cloud/aura](https://neo4j.com/cloud/aura)
147
185
  2. Create a free AuraDB instance — copy the connection URI and password
@@ -153,7 +191,7 @@ wisdom connect bolt+s://xxxxxxxx.databases.neo4j.io --user neo4j --password <you
153
191
 
154
192
  Free tier: 200,000 nodes. Enough for years of accumulated wisdom.
155
193
 
156
- ### Option B — DozerDB local Docker (full control, APOC included)
194
+ ### Option C — Optional/manual DozerDB Docker (full control, APOC included)
157
195
 
158
196
  ```bash
159
197
  wisdom docker up # pulls graphstack/dozerdb:5.26.3.0 and starts it
@@ -181,6 +219,8 @@ Open [localhost:7474](http://localhost:7474) — Neo4j Browser is your visual wi
181
219
  | Platform | Install command |
182
220
  |----------|----------------|
183
221
  | Claude Code (Linux/Mac) | `wisdom install` |
222
+ | Claude Code MCP | `wisdom mcp-install` |
223
+ | Codex MCP | `wisdom mcp-install --host codex` |
184
224
  | Claude Code (Windows) | `wisdom install --platform windows` |
185
225
  | OpenClaw | `wisdom install --platform claw` |
186
226
 
@@ -192,11 +232,11 @@ Then open your AI coding assistant and type:
192
232
 
193
233
  ---
194
234
 
195
- ## Claude Code MCP integration (v0.2.0+)
235
+ ## MCP integration (v0.2.0+)
196
236
 
197
- wisdomGraph ships as a native **Model Context Protocol (MCP) server** for Claude Code. Once registered, Claude calls `wisdom_ingest`, `wisdom_remember`, `wisdom_query`, `wisdom_reflect`, and `wisdom_report` as first-class tools — no `/wisdom` slash command needed.
237
+ wisdomGraph ships as a native **Model Context Protocol (MCP) server**. Once registered, Claude, Codex, or another MCP host can call wisdomGraph tools directly — no `/wisdom` slash command needed.
198
238
 
199
- ### Setup (one command)
239
+ ### Claude Code setup
200
240
 
201
241
  ```bash
202
242
  wisdom mcp-install
@@ -215,14 +255,33 @@ This writes the MCP server entry to `.claude/settings.json` in your current proj
215
255
  }
216
256
  ```
217
257
 
218
- Restart Claude Code. wisdomGraph is now live in every session.
258
+ Restart Claude Code. wisdomGraph is now live in that project.
259
+
260
+ ### Codex setup (v0.3.0+)
261
+
262
+ ```bash
263
+ wisdom mcp-install --host codex
264
+ ```
265
+
266
+ This runs the Codex MCP registration:
267
+
268
+ ```bash
269
+ codex mcp add wisdomGraph -- wisdom mcp
270
+ ```
271
+
272
+ Start a new Codex session. Codex can now launch `wisdom mcp` and use the same Neo4j-backed DIKW graph as Claude Code.
219
273
 
220
274
  ### MCP tools
221
275
 
222
- | Tool | What Claude uses it for |
276
+ | Tool | What agents use it for |
223
277
  |---|---|
224
278
  | `wisdom_ingest` | Absorb a file, directory, or URL into Neo4j |
225
279
  | `wisdom_remember` | Store a fact, decision, or insight explicitly |
280
+ | `wisdom_learn` | Record an attempt, outcome, and lesson learned |
281
+ | `wisdom_status` | Read DIKW tier counts and edge/source totals |
282
+ | `wisdom_list` | List nodes by DIKW tier, project, and connectivity |
283
+ | `wisdom_trace` | Trace why an insight or wisdom node exists |
284
+ | `wisdom_explain` | Explain a node with its DIKW chain and sources |
226
285
  | `wisdom_query` | Run a read-only Cypher traversal |
227
286
  | `wisdom_reflect` | Trigger DIKW promotion pipeline |
228
287
  | `wisdom_report` | Get tier counts + top Wisdom nodes as markdown |
@@ -246,6 +305,9 @@ wisdom mcp-install
246
305
 
247
306
  # Register globally (all projects on this machine)
248
307
  wisdom mcp-install --project ~
308
+
309
+ # Register globally with Codex
310
+ wisdom mcp-install --host codex
249
311
  ```
250
312
 
251
313
  ---
@@ -6,11 +6,14 @@
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
7
7
  [![Neo4j](https://img.shields.io/badge/Neo4j-native-008CC1?logo=neo4j)](https://neo4j.com)
8
8
  [![Claude Code](https://img.shields.io/badge/Claude%20Code-MCP-blueviolet)](https://claude.ai/code)
9
+ [![Codex](https://img.shields.io/badge/Codex-MCP-black)](https://openai.com/codex)
9
10
  [![OpenClaw](https://img.shields.io/badge/OpenClaw-skill-orange)](https://openclaw.ai)
10
11
 
12
+ > **Graph-native persistent cognition for AI agents.**
13
+ >
11
14
  > **graphify gives you a snapshot. wisdomGraph gives you memory that compounds.**
12
15
 
13
- 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.
16
+ Use wisdomGraph from Claude Code, Codex, OpenClaw, or any MCP host. 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.
14
17
 
15
18
  ```
16
19
  /wisdom . # absorb this project into the wisdom graph
@@ -35,7 +38,7 @@ wisdomGraph does something fundamentally different.
35
38
  | **Memory** | resets each session | accumulates across sessions, projects, months |
36
39
  | **Reasoning** | community detection (topology) | graph path traversal + DIKW hierarchy |
37
40
  | **Feedback loop** | none | Wisdom → Knowledge (neuroplasticity) |
38
- | **Database** | none required | Neo4j Aura (free) or DozerDB Docker |
41
+ | **Database** | none required | Neo4j Aura (free) or local Neo4j Docker |
39
42
 
40
43
  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.
41
44
 
@@ -63,15 +66,51 @@ The feedback loop is critical: when a Wisdom node is queried and found useful, i
63
66
 
64
67
  ## Install
65
68
 
66
- **Requires:** Python 3.10+ and one of: [Claude Code](https://claude.ai/code), [OpenClaw](https://openclaw.ai)
69
+ **Requires:** Python 3.10+ and one of: [Claude Code](https://claude.ai/code), [Codex](https://openai.com/codex), [OpenClaw](https://openclaw.ai), or another MCP host
67
70
 
68
- **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)
71
+ **And one of:** [Neo4j Aura Free](https://neo4j.com/cloud/platform/aura-graph-database/) (cloud, no install) or Docker Desktop/Engine for a managed local Neo4j container
69
72
 
70
73
  ```bash
71
- pip install 'wisdomgraph[mcp]' && wisdom install
74
+ pip install 'wisdomgraph[mcp]'
75
+ wisdom quickstart
72
76
  ```
73
77
 
74
- ### Option A — Neo4j Aura (zero infra, recommended for individuals)
78
+ `wisdom quickstart` is the end-to-end first-time setup. It prepares storage, verifies the Neo4j connection, and registers wisdomGraph with detected MCP hosts.
79
+
80
+ ```bash
81
+ # Local managed Neo4j backend + detected MCP hosts
82
+ wisdom quickstart
83
+
84
+ # Local backend + Codex only
85
+ wisdom quickstart --host codex
86
+
87
+ # Existing Neo4j or DozerDB instance
88
+ wisdom quickstart --storage existing --uri bolt://localhost:7689 --user neo4j --password <password>
89
+
90
+ # Neo4j Aura
91
+ wisdom quickstart --storage aura --uri bolt+s://xxxxxxxx.databases.neo4j.io --user neo4j --password <password>
92
+ ```
93
+
94
+ The MCP server itself never starts Docker or creates databases. Storage setup is explicit through `quickstart`, `local`, `docker`, or `connect`.
95
+
96
+ ### Option A — Managed local backend (recommended first run)
97
+
98
+ ```bash
99
+ wisdom local up
100
+ wisdom doctor
101
+ ```
102
+
103
+ This starts a managed `neo4j:latest` container named `wisdomgraph-neo4j`, stores data under `~/.wisdom/neo4j`, uses the documented local login `neo4j/password`, saves the connection, and leaves MCP startup cleanly separate. The implementation uses the Docker CLI directly, so the same `wisdom local up` command works from Windows PowerShell, Windows cmd.exe, macOS Terminal, and Ubuntu Terminal after Docker is installed.
104
+
105
+ Useful commands:
106
+
107
+ ```bash
108
+ wisdom local status
109
+ wisdom local logs
110
+ wisdom local down
111
+ ```
112
+
113
+ ### Option B — Neo4j Aura (zero local database)
75
114
 
76
115
  1. Create a free account at [neo4j.com/cloud/aura](https://neo4j.com/cloud/aura)
77
116
  2. Create a free AuraDB instance — copy the connection URI and password
@@ -83,7 +122,7 @@ wisdom connect bolt+s://xxxxxxxx.databases.neo4j.io --user neo4j --password <you
83
122
 
84
123
  Free tier: 200,000 nodes. Enough for years of accumulated wisdom.
85
124
 
86
- ### Option B — DozerDB local Docker (full control, APOC included)
125
+ ### Option C — Optional/manual DozerDB Docker (full control, APOC included)
87
126
 
88
127
  ```bash
89
128
  wisdom docker up # pulls graphstack/dozerdb:5.26.3.0 and starts it
@@ -111,6 +150,8 @@ Open [localhost:7474](http://localhost:7474) — Neo4j Browser is your visual wi
111
150
  | Platform | Install command |
112
151
  |----------|----------------|
113
152
  | Claude Code (Linux/Mac) | `wisdom install` |
153
+ | Claude Code MCP | `wisdom mcp-install` |
154
+ | Codex MCP | `wisdom mcp-install --host codex` |
114
155
  | Claude Code (Windows) | `wisdom install --platform windows` |
115
156
  | OpenClaw | `wisdom install --platform claw` |
116
157
 
@@ -122,11 +163,11 @@ Then open your AI coding assistant and type:
122
163
 
123
164
  ---
124
165
 
125
- ## Claude Code MCP integration (v0.2.0+)
166
+ ## MCP integration (v0.2.0+)
126
167
 
127
- wisdomGraph ships as a native **Model Context Protocol (MCP) server** for Claude Code. Once registered, Claude calls `wisdom_ingest`, `wisdom_remember`, `wisdom_query`, `wisdom_reflect`, and `wisdom_report` as first-class tools — no `/wisdom` slash command needed.
168
+ wisdomGraph ships as a native **Model Context Protocol (MCP) server**. Once registered, Claude, Codex, or another MCP host can call wisdomGraph tools directly — no `/wisdom` slash command needed.
128
169
 
129
- ### Setup (one command)
170
+ ### Claude Code setup
130
171
 
131
172
  ```bash
132
173
  wisdom mcp-install
@@ -145,14 +186,33 @@ This writes the MCP server entry to `.claude/settings.json` in your current proj
145
186
  }
146
187
  ```
147
188
 
148
- Restart Claude Code. wisdomGraph is now live in every session.
189
+ Restart Claude Code. wisdomGraph is now live in that project.
190
+
191
+ ### Codex setup (v0.3.0+)
192
+
193
+ ```bash
194
+ wisdom mcp-install --host codex
195
+ ```
196
+
197
+ This runs the Codex MCP registration:
198
+
199
+ ```bash
200
+ codex mcp add wisdomGraph -- wisdom mcp
201
+ ```
202
+
203
+ Start a new Codex session. Codex can now launch `wisdom mcp` and use the same Neo4j-backed DIKW graph as Claude Code.
149
204
 
150
205
  ### MCP tools
151
206
 
152
- | Tool | What Claude uses it for |
207
+ | Tool | What agents use it for |
153
208
  |---|---|
154
209
  | `wisdom_ingest` | Absorb a file, directory, or URL into Neo4j |
155
210
  | `wisdom_remember` | Store a fact, decision, or insight explicitly |
211
+ | `wisdom_learn` | Record an attempt, outcome, and lesson learned |
212
+ | `wisdom_status` | Read DIKW tier counts and edge/source totals |
213
+ | `wisdom_list` | List nodes by DIKW tier, project, and connectivity |
214
+ | `wisdom_trace` | Trace why an insight or wisdom node exists |
215
+ | `wisdom_explain` | Explain a node with its DIKW chain and sources |
156
216
  | `wisdom_query` | Run a read-only Cypher traversal |
157
217
  | `wisdom_reflect` | Trigger DIKW promotion pipeline |
158
218
  | `wisdom_report` | Get tier counts + top Wisdom nodes as markdown |
@@ -176,6 +236,9 @@ wisdom mcp-install
176
236
 
177
237
  # Register globally (all projects on this machine)
178
238
  wisdom mcp-install --project ~
239
+
240
+ # Register globally with Codex
241
+ wisdom mcp-install --host codex
179
242
  ```
180
243
 
181
244
  ---
@@ -1,18 +1,18 @@
1
1
  [build-system]
2
- requires = ["setuptools>=68"]
2
+ requires = ["setuptools>=68,<77"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "wisdomgraph"
7
- version = "0.2.0"
8
- description = "Accumulative Neo4j-native DIKW wisdom memory for AI coding assistants (Claude Code, OpenClaw)"
7
+ version = "0.3.1"
8
+ description = "Graph-native persistent cognition for AI agents using Neo4j, DIKW, and MCP"
9
9
  readme = "README.md"
10
- license = "MIT"
11
- license-files = ["LICENSE"]
10
+ license = {text = "MIT"}
12
11
  keywords = [
13
12
  "claude", "claude-code", "openclaw", "neo4j", "knowledge-graph",
14
13
  "graphrag", "dikw", "wisdom", "memory", "accumulative", "llm",
15
- "skill", "agent-memory", "dozerdb", "mcp", "model-context-protocol",
14
+ "skill", "agent-memory", "agentic-memory", "multi-agent", "dozerdb",
15
+ "mcp", "model-context-protocol", "codex",
16
16
  ]
17
17
  requires-python = ">=3.10"
18
18
  dependencies = [
@@ -448,13 +448,145 @@ def test_learn_failure_defaults_to_high_confidence():
448
448
 
449
449
  # ── Tool list ─────────────────────────────────────────────────────────────────
450
450
 
451
- def test_tool_list_has_six_tools():
451
+ def test_status_returns_counts():
452
+ from wisdom.mcp import _handle_status
453
+
454
+ fake_stats = {
455
+ "Knowledge": 74,
456
+ "Experience": 16,
457
+ "Insight": 11,
458
+ "Wisdom": 6,
459
+ "Source": 30,
460
+ "edges": 215,
461
+ }
462
+
463
+ with patch("wisdom.mcp._get_driver", return_value=MagicMock()), \
464
+ patch("wisdom.connect.status", return_value=fake_stats):
465
+ result = _handle_status({})
466
+
467
+ assert not result.isError
468
+ text = result.content[0].text
469
+ assert "Knowledge" in text
470
+ assert "Insight" in text
471
+ assert "215" in text
472
+
473
+
474
+ def test_list_defaults_to_insight_nodes():
475
+ from wisdom.mcp import _handle_list
476
+
477
+ session = MagicMock()
478
+ session.run.return_value = iter([
479
+ {
480
+ "id": "insight:abc",
481
+ "label": "Agent infrastructure positioning",
482
+ "tier": "insight",
483
+ "project": "wisdomGraph",
484
+ "confidence": 0.95,
485
+ "degree": 3,
486
+ }
487
+ ])
488
+ driver = _make_driver(session)
489
+
490
+ with patch("wisdom.mcp._get_driver", return_value=driver):
491
+ result = _handle_list({})
492
+
493
+ assert not result.isError
494
+ text = result.content[0].text
495
+ assert "Insight nodes" in text
496
+ assert "Agent infrastructure" in text
497
+
498
+
499
+ def test_list_rejects_invalid_tier():
500
+ from wisdom.mcp import _handle_list
501
+ result = _handle_list({"tier": "source"})
502
+ assert result.isError
503
+ assert "tier" in result.content[0].text
504
+
505
+
506
+ def test_trace_requires_id_or_label():
507
+ from wisdom.mcp import _handle_trace
508
+ result = _handle_trace({})
509
+ assert result.isError
510
+ assert "id" in result.content[0].text
511
+
512
+
513
+ def test_trace_returns_node_neighborhood():
514
+ from wisdom.mcp import _handle_trace
515
+
516
+ node_record = {
517
+ "id": "insight:abc",
518
+ "label": "Agent infrastructure positioning",
519
+ "tier": "insight",
520
+ "content": "Persistent cognition for agents.",
521
+ "principle": None,
522
+ "confidence": 0.95,
523
+ }
524
+ edge_record = {
525
+ "source": "Repo visit",
526
+ "relation": "REVEALS",
527
+ "target": "Agent infrastructure positioning",
528
+ }
529
+
530
+ session = MagicMock()
531
+ session.run.side_effect = [
532
+ SimpleNamespace(single=lambda: node_record),
533
+ iter([edge_record]),
534
+ ]
535
+ driver = _make_driver(session)
536
+
537
+ with patch("wisdom.mcp._get_driver", return_value=driver), \
538
+ patch("wisdom.traverse.walk_dikw_path", return_value=[]), \
539
+ patch("wisdom.traverse.get_provenance", return_value=[]):
540
+ result = _handle_trace({"label": "Agent infrastructure"})
541
+
542
+ assert not result.isError
543
+ text = result.content[0].text
544
+ assert "Trace" in text
545
+ assert "Agent infrastructure positioning" in text
546
+ assert "REVEALS" in text
547
+
548
+
549
+ def test_explain_requires_label():
550
+ from wisdom.mcp import _handle_explain
551
+ result = _handle_explain({})
552
+ assert result.isError
553
+ assert "label" in result.content[0].text
554
+
555
+
556
+ def test_explain_formats_dikw_chain():
557
+ from wisdom.mcp import _handle_explain
558
+
559
+ explanation = {
560
+ "id": "insight:abc",
561
+ "label": "Agent infrastructure positioning",
562
+ "tier": "insight",
563
+ "content": "Persistent cognition for agents.",
564
+ "confidence": 0.95,
565
+ "dikw_chain": [{"label": "WisdomGraph", "tier": "knowledge"}],
566
+ "sources": [{"uri": "README.md"}],
567
+ }
568
+
569
+ with patch("wisdom.mcp._get_driver", return_value=_make_driver()), \
570
+ patch("wisdom.traverse.explain_node", return_value=explanation):
571
+ result = _handle_explain({"label": "Agent infrastructure"})
572
+
573
+ assert not result.isError
574
+ text = result.content[0].text
575
+ assert "DIKW chain" in text
576
+ assert "README.md" in text
577
+
578
+
579
+ def test_tool_list_has_ten_tools():
452
580
  from wisdom.mcp import _TOOL_DEFS
453
581
  names = {t["name"] for t in _TOOL_DEFS}
454
582
  assert names == {
455
583
  "wisdom_ingest",
456
584
  "wisdom_remember",
457
585
  "wisdom_learn",
586
+ "wisdom_status",
587
+ "wisdom_list",
588
+ "wisdom_trace",
589
+ "wisdom_explain",
458
590
  "wisdom_query",
459
591
  "wisdom_reflect",
460
592
  "wisdom_report",
@@ -482,7 +614,7 @@ def test_mcp_install_writes_settings(tmp_path):
482
614
  import sys
483
615
  from wisdom.__main__ import _install_mcp
484
616
 
485
- _install_mcp(project_dir=tmp_path)
617
+ _install_mcp(project_dir=tmp_path, host="claude")
486
618
 
487
619
  settings_path = tmp_path / ".claude" / "settings.json"
488
620
  assert settings_path.exists()
@@ -499,10 +631,135 @@ def test_mcp_install_idempotent(tmp_path):
499
631
  import json
500
632
  from wisdom.__main__ import _install_mcp
501
633
 
502
- _install_mcp(project_dir=tmp_path)
503
- _install_mcp(project_dir=tmp_path)
634
+ _install_mcp(project_dir=tmp_path, host="claude")
635
+ _install_mcp(project_dir=tmp_path, host="claude")
504
636
 
505
637
  settings_path = tmp_path / ".claude" / "settings.json"
506
638
  settings = json.loads(settings_path.read_text())
507
639
  # Should still be a single entry, not a list
508
640
  assert isinstance(settings["mcpServers"]["wisdomGraph"], dict)
641
+
642
+
643
+ def test_mcp_install_codex_noops_when_existing():
644
+ from wisdom.__main__ import _install_mcp
645
+
646
+ completed = SimpleNamespace(returncode=0, stdout="", stderr="")
647
+ with patch("shutil.which", return_value="/usr/bin/codex"), \
648
+ patch("subprocess.run", return_value=completed) as run:
649
+ _install_mcp(host="codex")
650
+
651
+ run.assert_called_once_with(
652
+ ["codex", "mcp", "get", "wisdomGraph"],
653
+ stdout=-3,
654
+ stderr=-3,
655
+ check=False,
656
+ )
657
+
658
+
659
+ def test_mcp_install_rejects_unknown_host():
660
+ from wisdom.__main__ import _install_mcp
661
+
662
+ with pytest.raises(SystemExit):
663
+ _install_mcp(host="unknown")
664
+
665
+
666
+ # ── local backend / quickstart CLI ────────────────────────────────────────────
667
+
668
+ def test_local_default_image_is_official_neo4j(monkeypatch):
669
+ import wisdom.local as local
670
+
671
+ monkeypatch.delenv("WISDOM_NEO4J_IMAGE", raising=False)
672
+ monkeypatch.delenv("WISDOM_NEO4J_ENGINE", raising=False)
673
+
674
+ assert local._select_image() == "neo4j:latest"
675
+
676
+
677
+ def test_local_dozerdb_engine_is_explicit():
678
+ import wisdom.local as local
679
+
680
+ assert local._select_image(engine="dozerdb") == "graphstack/dozerdb:5.26.3.0"
681
+
682
+
683
+ def test_local_docker_run_args_are_shell_independent(tmp_path, monkeypatch):
684
+ import wisdom.local as local
685
+
686
+ monkeypatch.setattr(local, "BASE_DIR", tmp_path / "neo4j")
687
+ args = local._docker_run_args("neo4j:latest", "password")
688
+
689
+ assert args[:3] == ["docker", "run", "-d"]
690
+ assert "neo4j:latest" == args[-1]
691
+ assert "NEO4J_AUTH=neo4j/password" in args
692
+ assert all(isinstance(part, str) for part in args)
693
+
694
+ def test_local_up_starts_managed_backend_without_existing_container(tmp_path, monkeypatch):
695
+ import wisdom.local as local
696
+
697
+ calls = []
698
+
699
+ def fake_run(cmd, capture=False):
700
+ calls.append(cmd)
701
+ if cmd[:2] == ["docker", "info"]:
702
+ return SimpleNamespace(returncode=0, stdout="", stderr="")
703
+ if cmd[:3] == ["docker", "ps", "-q"]:
704
+ return SimpleNamespace(returncode=0, stdout="", stderr="")
705
+ if cmd[:3] == ["docker", "ps", "-aq"]:
706
+ return SimpleNamespace(returncode=0, stdout="", stderr="")
707
+ return SimpleNamespace(returncode=0, stdout="ok", stderr="")
708
+
709
+ monkeypatch.setattr(local, "BASE_DIR", tmp_path / "neo4j")
710
+ monkeypatch.setattr(local, "PASSWORD_PATH", tmp_path / "local-password")
711
+
712
+ with patch("wisdom.local.shutil.which", return_value="/usr/bin/docker"), \
713
+ patch("wisdom.local._run", side_effect=fake_run), \
714
+ patch("wisdom.local._wait_for_port", return_value=True), \
715
+ patch("wisdom.local.save_connection") as save:
716
+ local.up(password="test-password")
717
+
718
+ assert any(cmd[:3] == ["docker", "run", "-d"] for cmd in calls)
719
+ save.assert_called_once_with(local.URI, local.USER, "test-password")
720
+
721
+
722
+ def test_local_up_reuses_existing_running_backend(tmp_path, monkeypatch):
723
+ import wisdom.local as local
724
+
725
+ def fake_run(cmd, capture=False):
726
+ if cmd[:2] == ["docker", "info"]:
727
+ return SimpleNamespace(returncode=0, stdout="", stderr="")
728
+ if cmd[:3] == ["docker", "ps", "-q"]:
729
+ return SimpleNamespace(returncode=0, stdout="abc123\n", stderr="")
730
+ return SimpleNamespace(returncode=0, stdout="", stderr="")
731
+
732
+ monkeypatch.setattr(local, "PASSWORD_PATH", tmp_path / "local-password")
733
+
734
+ with patch("wisdom.local.shutil.which", return_value="/usr/bin/docker"), \
735
+ patch("wisdom.local._run", side_effect=fake_run), \
736
+ patch("wisdom.local.save_connection") as save:
737
+ local.up(password="test-password")
738
+
739
+ save.assert_called_once_with(local.URI, local.USER, "test-password")
740
+
741
+
742
+ def test_quickstart_local_registers_requested_host(monkeypatch):
743
+ import sys
744
+ from wisdom.__main__ import _run_quickstart
745
+
746
+ monkeypatch.setattr(sys, "argv", ["wisdom", "quickstart", "--host", "codex"])
747
+
748
+ with patch("wisdom.local.up") as local_up, \
749
+ patch("wisdom.__main__._doctor") as doctor, \
750
+ patch("wisdom.__main__._install_mcp") as install_mcp:
751
+ _run_quickstart()
752
+
753
+ local_up.assert_called_once_with(password=None, image=None, engine=None)
754
+ doctor.assert_called_once_with(connect_only=True)
755
+ install_mcp.assert_called_once_with(host="codex")
756
+
757
+
758
+ def test_quickstart_existing_requires_uri(monkeypatch):
759
+ import sys
760
+ from wisdom.__main__ import _run_quickstart
761
+
762
+ monkeypatch.setattr(sys, "argv", ["wisdom", "quickstart", "--storage", "existing", "--host", "none"])
763
+
764
+ with pytest.raises(SystemExit):
765
+ _run_quickstart()
@@ -1,4 +1,4 @@
1
- """wisdomGraph — accumulative Neo4j-native wisdom memory for AI coding assistants."""
1
+ """wisdomGraph — graph-native persistent cognition for AI agents."""
2
2
  from __future__ import annotations
3
3
 
4
4
  try: