wisdomgraph 0.3.2__tar.gz → 0.3.4__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.
- {wisdomgraph-0.3.2/wisdomgraph.egg-info → wisdomgraph-0.3.4}/PKG-INFO +44 -27
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/README.md +40 -24
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/pyproject.toml +4 -3
- wisdomgraph-0.3.4/tests/test_embedded.py +138 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/tests/test_mcp.py +68 -58
- wisdomgraph-0.3.4/tests/test_mcp_protocol.py +39 -0
- wisdomgraph-0.3.4/tests/test_storage.py +100 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/wisdom/__main__.py +75 -14
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/wisdom/connect.py +53 -8
- wisdomgraph-0.3.4/wisdom/embedded.py +66 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/wisdom/local.py +1 -1
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/wisdom/mcp.py +44 -35
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/wisdom/skill.md +6 -1
- wisdomgraph-0.3.4/wisdom/storage.py +83 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/wisdom/traverse.py +3 -3
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4/wisdomgraph.egg-info}/PKG-INFO +44 -27
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/wisdomgraph.egg-info/SOURCES.txt +5 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/wisdomgraph.egg-info/requires.txt +3 -2
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/LICENSE +0 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/setup.cfg +0 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/tests/test_cache.py +0 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/tests/test_classify.py +0 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/tests/test_detect.py +0 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/tests/test_ingest.py +0 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/tests/test_reflect.py +0 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/tests/test_security.py +0 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/tests/test_validate.py +0 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/wisdom/__init__.py +0 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/wisdom/cache.py +0 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/wisdom/classify.py +0 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/wisdom/detect.py +0 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/wisdom/docker.py +0 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/wisdom/export.py +0 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/wisdom/ingest.py +0 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/wisdom/merge.py +0 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/wisdom/reflect.py +0 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/wisdom/report.py +0 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/wisdom/security.py +0 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/wisdom/skill-claw.md +0 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/wisdom/validate.py +0 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/wisdomgraph.egg-info/dependency_links.txt +0 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/wisdomgraph.egg-info/entry_points.txt +0 -0
- {wisdomgraph-0.3.2 → wisdomgraph-0.3.4}/wisdomgraph.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: wisdomgraph
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary: Graph-native persistent cognition for AI agents using Neo4j, DIKW, and MCP
|
|
5
5
|
License: MIT
|
|
6
6
|
Project-URL: Homepage, https://github.com/cklam12345/wisdomGraph
|
|
@@ -10,9 +10,10 @@ Keywords: claude,claude-code,openclaw,neo4j,knowledge-graph,graphrag,dikw,wisdom
|
|
|
10
10
|
Requires-Python: >=3.10
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
12
|
License-File: LICENSE
|
|
13
|
+
Requires-Dist: relate-db==1.2.0
|
|
13
14
|
Requires-Dist: neo4j>=5.0
|
|
14
15
|
Provides-Extra: mcp
|
|
15
|
-
Requires-Dist: mcp
|
|
16
|
+
Requires-Dist: mcp<2,>=1.0; extra == "mcp"
|
|
16
17
|
Provides-Extra: ast
|
|
17
18
|
Requires-Dist: tree-sitter; extra == "ast"
|
|
18
19
|
Requires-Dist: tree-sitter-python; extra == "ast"
|
|
@@ -41,7 +42,7 @@ Provides-Extra: office
|
|
|
41
42
|
Requires-Dist: python-docx; extra == "office"
|
|
42
43
|
Requires-Dist: openpyxl; extra == "office"
|
|
43
44
|
Provides-Extra: all
|
|
44
|
-
Requires-Dist: mcp
|
|
45
|
+
Requires-Dist: mcp<2,>=1.0; extra == "all"
|
|
45
46
|
Requires-Dist: tree-sitter; extra == "all"
|
|
46
47
|
Requires-Dist: tree-sitter-python; extra == "all"
|
|
47
48
|
Requires-Dist: tree-sitter-javascript; extra == "all"
|
|
@@ -82,7 +83,7 @@ Requires-Dist: openpyxl; extra == "all"
|
|
|
82
83
|
>
|
|
83
84
|
> **graphify gives you a snapshot. wisdomGraph gives you memory that compounds.**
|
|
84
85
|
|
|
85
|
-
Use wisdomGraph from Claude Code, Codex, OpenClaw, or any MCP host. Feed it your codebases, notes, papers, conversations — every run **merges** into a
|
|
86
|
+
Use wisdomGraph from Claude Code, Codex, OpenClaw, or any MCP host. Feed it your codebases, notes, papers, conversations — every run **merges** into a persistent graph — embedded Relate by Neo4j locally, or Neo4j Aura in the cloud. The graph doesn't reset. It accumulates. Facts become patterns. Patterns become insights. Insights become wisdom.
|
|
86
87
|
|
|
87
88
|
```
|
|
88
89
|
/wisdom . # absorb this project into the wisdom graph
|
|
@@ -100,14 +101,14 @@ wisdomGraph does something fundamentally different.
|
|
|
100
101
|
|
|
101
102
|
| | graphify | wisdomGraph |
|
|
102
103
|
|---|---|---|
|
|
103
|
-
| **Storage** | `graph.json` file (per-project) | Neo4j (persistent, all projects) |
|
|
104
|
+
| **Storage** | `graph.json` file (per-project) | Relate or Neo4j (persistent, all projects) |
|
|
104
105
|
| **Node types** | flat (code entities, concepts) | typed DIKW: Knowledge / Experience / Insight / Wisdom |
|
|
105
106
|
| **Runs** | snapshot, overwrites | MERGE — each run grows the graph |
|
|
106
107
|
| **Query** | read GRAPH_REPORT.md | live Cypher traversal at inference time |
|
|
107
108
|
| **Memory** | resets each session | accumulates across sessions, projects, months |
|
|
108
109
|
| **Reasoning** | community detection (topology) | graph path traversal + DIKW hierarchy |
|
|
109
110
|
| **Feedback loop** | none | Wisdom → Knowledge (neuroplasticity) |
|
|
110
|
-
| **Database** | none required |
|
|
111
|
+
| **Database** | none required | Embedded Relate (no Docker) or Neo4j Aura |
|
|
111
112
|
|
|
112
113
|
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.
|
|
113
114
|
|
|
@@ -137,17 +138,17 @@ The feedback loop is critical: when a Wisdom node is queried and found useful, i
|
|
|
137
138
|
|
|
138
139
|
**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
|
|
139
140
|
|
|
140
|
-
**
|
|
141
|
+
**No Docker, Java, database server, or cloud account required.** The Python package includes [Relate by Neo4j](https://relatedb.ai), an embedded graph engine. Aura and existing Neo4j servers remain supported.
|
|
141
142
|
|
|
142
143
|
```bash
|
|
143
144
|
pip install 'wisdomgraph[mcp]'
|
|
144
145
|
wisdom quickstart
|
|
145
146
|
```
|
|
146
147
|
|
|
147
|
-
`wisdom quickstart` is the end-to-end first-time setup. It prepares storage, verifies
|
|
148
|
+
`wisdom quickstart` is the end-to-end first-time setup. It prepares storage, verifies graph storage, and registers wisdomGraph with detected MCP hosts.
|
|
148
149
|
|
|
149
150
|
```bash
|
|
150
|
-
#
|
|
151
|
+
# Embedded persistent graph + detected MCP hosts
|
|
151
152
|
wisdom quickstart
|
|
152
153
|
|
|
153
154
|
# Local backend + Codex only
|
|
@@ -160,25 +161,40 @@ wisdom quickstart --storage existing --uri bolt://localhost:7689 --user neo4j --
|
|
|
160
161
|
wisdom quickstart --storage aura --uri bolt+s://xxxxxxxx.databases.neo4j.io --user neo4j --password <password>
|
|
161
162
|
```
|
|
162
163
|
|
|
163
|
-
|
|
164
|
+
New installations default to `~/.wisdom/graph.rl`. Existing saved Neo4j/Aura connections remain selected until you explicitly run local quickstart or connect to another backend. Switching storage does **not** migrate existing data.
|
|
164
165
|
|
|
165
|
-
### Option A —
|
|
166
|
+
### Option A — Embedded Relate (default)
|
|
166
167
|
|
|
167
168
|
```bash
|
|
168
|
-
wisdom
|
|
169
|
+
wisdom quickstart --host codex
|
|
170
|
+
# Choose a different graph file, with no MCP registration:
|
|
171
|
+
wisdom quickstart --path ./my-memory.rl --host none
|
|
169
172
|
wisdom doctor
|
|
170
173
|
```
|
|
171
174
|
|
|
172
|
-
|
|
175
|
+
Relate runs inside Python and persists the graph locally. No credentials or background service are needed. Sessions release the store when finished, including on errors. The MCP server never starts Docker or replaces a failed Aura connection with a local graph.
|
|
173
176
|
|
|
174
|
-
|
|
177
|
+
The graph must fit in RAM, and only one process can open the store for writing at a time. Concurrent agent processes can encounter a storage-lock error; close the other writer and retry, or use Aura for shared access. Back up the graph file while no session has it open. See [Relate's documented limits](https://relatedb.ai/docs/reference/limitations/).
|
|
175
178
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
179
|
+
For an optional managed Docker server, use `wisdom quickstart --storage docker`; existing `wisdom local up|status|logs|down` commands still manage Docker.
|
|
180
|
+
|
|
181
|
+
### Switch storage through MCP (0.3.4)
|
|
182
|
+
|
|
183
|
+
Ask your agent: “Show my WisdomGraph storage”, “Switch WisdomGraph back to Docker”, or “Use embedded Relate again”. The `wisdom_storage` tool supports:
|
|
184
|
+
|
|
185
|
+
```json
|
|
186
|
+
{"action": "status"}
|
|
187
|
+
{"action": "switch", "backend": "relate"}
|
|
188
|
+
{"action": "switch", "backend": "docker", "engine": "neo4j"}
|
|
189
|
+
{"action": "switch", "backend": "docker", "engine": "dozerdb"}
|
|
190
|
+
{"action": "switch", "backend": "neo4j"}
|
|
191
|
+
{"action": "switch", "backend": "aura", "uri": "neo4j+s://YOUR-HOST", "password_env": "WISDOM_NEO4J_PASSWORD"}
|
|
180
192
|
```
|
|
181
193
|
|
|
194
|
+
For remote storage, set the password environment variable in the MCP server's environment before starting it. Do not send passwords in chat/tool arguments. Omitting the URI reuses the saved remote connection. Docker uses its managed password file and reuses an existing container; choosing an engine does not replace that container.
|
|
195
|
+
|
|
196
|
+
The target must pass connectivity and schema checks before the saved selection changes. Subsequent calls use the new backend without restarting MCP. Each backend retains its own data: switching does not migrate graphs, delete files, or stop containers. Legacy manually created DozerDB containers remain accessible through `backend: "neo4j"` and their URI. Managed Docker expects ports 7474/7687 to be available.
|
|
197
|
+
|
|
182
198
|
### Option B — Neo4j Aura (zero local database)
|
|
183
199
|
|
|
184
200
|
1. Create a free account at [neo4j.com/cloud/aura](https://neo4j.com/cloud/aura)
|
|
@@ -278,6 +294,7 @@ Start a new Codex session. Codex can now launch `wisdom mcp` and use the same Ne
|
|
|
278
294
|
| `wisdom_ingest` | Absorb a file, directory, or URL into Neo4j |
|
|
279
295
|
| `wisdom_remember` | Store a fact, decision, or insight explicitly |
|
|
280
296
|
| `wisdom_learn` | Record an attempt, outcome, and lesson learned |
|
|
297
|
+
| `wisdom_storage` | Inspect or switch embedded, Neo4j/Aura, and Docker storage |
|
|
281
298
|
| `wisdom_status` | Read DIKW tier counts and edge/source totals |
|
|
282
299
|
| `wisdom_list` | List nodes by DIKW tier, project, and connectivity |
|
|
283
300
|
| `wisdom_trace` | Trace why an insight or wisdom node exists |
|
|
@@ -423,20 +440,20 @@ Confidence flows through the graph. An Insight grounded in 8 Experiences has hig
|
|
|
423
440
|
|
|
424
441
|
## Deployment options
|
|
425
442
|
|
|
426
|
-
| |
|
|
427
|
-
|
|
428
|
-
| **Setup** |
|
|
429
|
-
| **
|
|
430
|
-
| **
|
|
431
|
-
| **
|
|
432
|
-
|
|
433
|
-
|
|
443
|
+
| | Embedded Relate | Neo4j Aura | Docker (optional) |
|
|
444
|
+
|---|---|---|---|
|
|
445
|
+
| **Setup** | `wisdom quickstart` | `wisdom connect <uri> ...` | `wisdom quickstart --storage docker` |
|
|
446
|
+
| **Data location** | Local graph file | Neo4j cloud | Local container volume |
|
|
447
|
+
| **Server required** | No | Managed by Neo4j | Yes |
|
|
448
|
+
| **Best for** | Personal agent memory, local development | Shared access and larger deployments | Existing server workflows |
|
|
449
|
+
|
|
450
|
+
Relate is a separate engine from Neo4j Server. WisdomGraph uses its Python API and Cypher; server-specific procedures and arbitrary user Cypher may differ. The integration is pinned to Relate 1.2.0 and tested against real persistent stores.
|
|
434
451
|
|
|
435
452
|
---
|
|
436
453
|
|
|
437
454
|
## Privacy
|
|
438
455
|
|
|
439
|
-
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
|
|
456
|
+
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 local Relate store or your selected Neo4j instance (Aura or Docker). No telemetry, no usage tracking, no analytics.
|
|
440
457
|
|
|
441
458
|
---
|
|
442
459
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
>
|
|
14
14
|
> **graphify gives you a snapshot. wisdomGraph gives you memory that compounds.**
|
|
15
15
|
|
|
16
|
-
Use wisdomGraph from Claude Code, Codex, OpenClaw, or any MCP host. Feed it your codebases, notes, papers, conversations — every run **merges** into a
|
|
16
|
+
Use wisdomGraph from Claude Code, Codex, OpenClaw, or any MCP host. Feed it your codebases, notes, papers, conversations — every run **merges** into a persistent graph — embedded Relate by Neo4j locally, or Neo4j Aura in the cloud. The graph doesn't reset. It accumulates. Facts become patterns. Patterns become insights. Insights become wisdom.
|
|
17
17
|
|
|
18
18
|
```
|
|
19
19
|
/wisdom . # absorb this project into the wisdom graph
|
|
@@ -31,14 +31,14 @@ wisdomGraph does something fundamentally different.
|
|
|
31
31
|
|
|
32
32
|
| | graphify | wisdomGraph |
|
|
33
33
|
|---|---|---|
|
|
34
|
-
| **Storage** | `graph.json` file (per-project) | Neo4j (persistent, all projects) |
|
|
34
|
+
| **Storage** | `graph.json` file (per-project) | Relate or Neo4j (persistent, all projects) |
|
|
35
35
|
| **Node types** | flat (code entities, concepts) | typed DIKW: Knowledge / Experience / Insight / Wisdom |
|
|
36
36
|
| **Runs** | snapshot, overwrites | MERGE — each run grows the graph |
|
|
37
37
|
| **Query** | read GRAPH_REPORT.md | live Cypher traversal at inference time |
|
|
38
38
|
| **Memory** | resets each session | accumulates across sessions, projects, months |
|
|
39
39
|
| **Reasoning** | community detection (topology) | graph path traversal + DIKW hierarchy |
|
|
40
40
|
| **Feedback loop** | none | Wisdom → Knowledge (neuroplasticity) |
|
|
41
|
-
| **Database** | none required |
|
|
41
|
+
| **Database** | none required | Embedded Relate (no Docker) or Neo4j Aura |
|
|
42
42
|
|
|
43
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.
|
|
44
44
|
|
|
@@ -68,17 +68,17 @@ The feedback loop is critical: when a Wisdom node is queried and found useful, i
|
|
|
68
68
|
|
|
69
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
|
|
70
70
|
|
|
71
|
-
**
|
|
71
|
+
**No Docker, Java, database server, or cloud account required.** The Python package includes [Relate by Neo4j](https://relatedb.ai), an embedded graph engine. Aura and existing Neo4j servers remain supported.
|
|
72
72
|
|
|
73
73
|
```bash
|
|
74
74
|
pip install 'wisdomgraph[mcp]'
|
|
75
75
|
wisdom quickstart
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
`wisdom quickstart` is the end-to-end first-time setup. It prepares storage, verifies
|
|
78
|
+
`wisdom quickstart` is the end-to-end first-time setup. It prepares storage, verifies graph storage, and registers wisdomGraph with detected MCP hosts.
|
|
79
79
|
|
|
80
80
|
```bash
|
|
81
|
-
#
|
|
81
|
+
# Embedded persistent graph + detected MCP hosts
|
|
82
82
|
wisdom quickstart
|
|
83
83
|
|
|
84
84
|
# Local backend + Codex only
|
|
@@ -91,25 +91,40 @@ wisdom quickstart --storage existing --uri bolt://localhost:7689 --user neo4j --
|
|
|
91
91
|
wisdom quickstart --storage aura --uri bolt+s://xxxxxxxx.databases.neo4j.io --user neo4j --password <password>
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
New installations default to `~/.wisdom/graph.rl`. Existing saved Neo4j/Aura connections remain selected until you explicitly run local quickstart or connect to another backend. Switching storage does **not** migrate existing data.
|
|
95
95
|
|
|
96
|
-
### Option A —
|
|
96
|
+
### Option A — Embedded Relate (default)
|
|
97
97
|
|
|
98
98
|
```bash
|
|
99
|
-
wisdom
|
|
99
|
+
wisdom quickstart --host codex
|
|
100
|
+
# Choose a different graph file, with no MCP registration:
|
|
101
|
+
wisdom quickstart --path ./my-memory.rl --host none
|
|
100
102
|
wisdom doctor
|
|
101
103
|
```
|
|
102
104
|
|
|
103
|
-
|
|
105
|
+
Relate runs inside Python and persists the graph locally. No credentials or background service are needed. Sessions release the store when finished, including on errors. The MCP server never starts Docker or replaces a failed Aura connection with a local graph.
|
|
104
106
|
|
|
105
|
-
|
|
107
|
+
The graph must fit in RAM, and only one process can open the store for writing at a time. Concurrent agent processes can encounter a storage-lock error; close the other writer and retry, or use Aura for shared access. Back up the graph file while no session has it open. See [Relate's documented limits](https://relatedb.ai/docs/reference/limitations/).
|
|
106
108
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
For an optional managed Docker server, use `wisdom quickstart --storage docker`; existing `wisdom local up|status|logs|down` commands still manage Docker.
|
|
110
|
+
|
|
111
|
+
### Switch storage through MCP (0.3.4)
|
|
112
|
+
|
|
113
|
+
Ask your agent: “Show my WisdomGraph storage”, “Switch WisdomGraph back to Docker”, or “Use embedded Relate again”. The `wisdom_storage` tool supports:
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{"action": "status"}
|
|
117
|
+
{"action": "switch", "backend": "relate"}
|
|
118
|
+
{"action": "switch", "backend": "docker", "engine": "neo4j"}
|
|
119
|
+
{"action": "switch", "backend": "docker", "engine": "dozerdb"}
|
|
120
|
+
{"action": "switch", "backend": "neo4j"}
|
|
121
|
+
{"action": "switch", "backend": "aura", "uri": "neo4j+s://YOUR-HOST", "password_env": "WISDOM_NEO4J_PASSWORD"}
|
|
111
122
|
```
|
|
112
123
|
|
|
124
|
+
For remote storage, set the password environment variable in the MCP server's environment before starting it. Do not send passwords in chat/tool arguments. Omitting the URI reuses the saved remote connection. Docker uses its managed password file and reuses an existing container; choosing an engine does not replace that container.
|
|
125
|
+
|
|
126
|
+
The target must pass connectivity and schema checks before the saved selection changes. Subsequent calls use the new backend without restarting MCP. Each backend retains its own data: switching does not migrate graphs, delete files, or stop containers. Legacy manually created DozerDB containers remain accessible through `backend: "neo4j"` and their URI. Managed Docker expects ports 7474/7687 to be available.
|
|
127
|
+
|
|
113
128
|
### Option B — Neo4j Aura (zero local database)
|
|
114
129
|
|
|
115
130
|
1. Create a free account at [neo4j.com/cloud/aura](https://neo4j.com/cloud/aura)
|
|
@@ -209,6 +224,7 @@ Start a new Codex session. Codex can now launch `wisdom mcp` and use the same Ne
|
|
|
209
224
|
| `wisdom_ingest` | Absorb a file, directory, or URL into Neo4j |
|
|
210
225
|
| `wisdom_remember` | Store a fact, decision, or insight explicitly |
|
|
211
226
|
| `wisdom_learn` | Record an attempt, outcome, and lesson learned |
|
|
227
|
+
| `wisdom_storage` | Inspect or switch embedded, Neo4j/Aura, and Docker storage |
|
|
212
228
|
| `wisdom_status` | Read DIKW tier counts and edge/source totals |
|
|
213
229
|
| `wisdom_list` | List nodes by DIKW tier, project, and connectivity |
|
|
214
230
|
| `wisdom_trace` | Trace why an insight or wisdom node exists |
|
|
@@ -354,20 +370,20 @@ Confidence flows through the graph. An Insight grounded in 8 Experiences has hig
|
|
|
354
370
|
|
|
355
371
|
## Deployment options
|
|
356
372
|
|
|
357
|
-
| |
|
|
358
|
-
|
|
359
|
-
| **Setup** |
|
|
360
|
-
| **
|
|
361
|
-
| **
|
|
362
|
-
| **
|
|
363
|
-
|
|
364
|
-
|
|
373
|
+
| | Embedded Relate | Neo4j Aura | Docker (optional) |
|
|
374
|
+
|---|---|---|---|
|
|
375
|
+
| **Setup** | `wisdom quickstart` | `wisdom connect <uri> ...` | `wisdom quickstart --storage docker` |
|
|
376
|
+
| **Data location** | Local graph file | Neo4j cloud | Local container volume |
|
|
377
|
+
| **Server required** | No | Managed by Neo4j | Yes |
|
|
378
|
+
| **Best for** | Personal agent memory, local development | Shared access and larger deployments | Existing server workflows |
|
|
379
|
+
|
|
380
|
+
Relate is a separate engine from Neo4j Server. WisdomGraph uses its Python API and Cypher; server-specific procedures and arbitrary user Cypher may differ. The integration is pinned to Relate 1.2.0 and tested against real persistent stores.
|
|
365
381
|
|
|
366
382
|
---
|
|
367
383
|
|
|
368
384
|
## Privacy
|
|
369
385
|
|
|
370
|
-
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
|
|
386
|
+
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 local Relate store or your selected Neo4j instance (Aura or Docker). No telemetry, no usage tracking, no analytics.
|
|
371
387
|
|
|
372
388
|
---
|
|
373
389
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "wisdomgraph"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.4"
|
|
8
8
|
description = "Graph-native persistent cognition for AI agents using Neo4j, DIKW, and MCP"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {text = "MIT"}
|
|
@@ -16,6 +16,7 @@ keywords = [
|
|
|
16
16
|
]
|
|
17
17
|
requires-python = ">=3.10"
|
|
18
18
|
dependencies = [
|
|
19
|
+
"relate-db==1.2.0",
|
|
19
20
|
"neo4j>=5.0",
|
|
20
21
|
]
|
|
21
22
|
|
|
@@ -26,7 +27,7 @@ Issues = "https://github.com/cklam12345/wisdomGraph/issues"
|
|
|
26
27
|
|
|
27
28
|
[project.optional-dependencies]
|
|
28
29
|
mcp = [
|
|
29
|
-
"mcp>=1.0",
|
|
30
|
+
"mcp>=1.0,<2",
|
|
30
31
|
]
|
|
31
32
|
ast = [
|
|
32
33
|
"tree-sitter",
|
|
@@ -53,7 +54,7 @@ ast = [
|
|
|
53
54
|
pdf = ["pypdf", "html2text"]
|
|
54
55
|
office = ["python-docx", "openpyxl"]
|
|
55
56
|
all = [
|
|
56
|
-
"mcp>=1.0",
|
|
57
|
+
"mcp>=1.0,<2",
|
|
57
58
|
"tree-sitter",
|
|
58
59
|
"tree-sitter-python",
|
|
59
60
|
"tree-sitter-javascript",
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"""Real Relate integration tests: no Docker or external database required."""
|
|
2
|
+
import json
|
|
3
|
+
import subprocess
|
|
4
|
+
import sys
|
|
5
|
+
from unittest.mock import patch, MagicMock
|
|
6
|
+
|
|
7
|
+
import pytest
|
|
8
|
+
|
|
9
|
+
from wisdom import connect
|
|
10
|
+
from wisdom.embedded import EmbeddedDriver
|
|
11
|
+
from wisdom.merge import merge_extraction, merge_nodes
|
|
12
|
+
from wisdom.reflect import run_reflect, write_wisdom
|
|
13
|
+
from wisdom.traverse import answer_question, full_text_search, _keyword_fallback
|
|
14
|
+
from wisdom.export import export_json, export_cypher, export_obsidian
|
|
15
|
+
from wisdom.report import render_report
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@pytest.fixture
|
|
19
|
+
def driver(tmp_path):
|
|
20
|
+
driver = EmbeddedDriver(str(tmp_path / 'graph.rl'))
|
|
21
|
+
connect.ensure_schema(driver)
|
|
22
|
+
yield driver
|
|
23
|
+
driver.close()
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def test_persistence_merge_search_provenance_and_exports(driver, tmp_path):
|
|
27
|
+
extraction = {'nodes': [
|
|
28
|
+
{'id': 'k1', 'label': 'Graph memory', 'content': "agent's graph", 'tier': 'knowledge'},
|
|
29
|
+
{'id': 'k2', 'label': 'Persistent memory', 'tier': 'knowledge'},
|
|
30
|
+
], 'edges': [{'source': 'k1', 'target': 'k2', 'relation': 'uses'}]}
|
|
31
|
+
with driver.session() as session:
|
|
32
|
+
for _ in range(2):
|
|
33
|
+
merge_extraction(session, extraction, source_uri='notes.md')
|
|
34
|
+
reopened = EmbeddedDriver(driver.path)
|
|
35
|
+
assert connect.status(reopened)['Knowledge'] == 2
|
|
36
|
+
with reopened.session() as session:
|
|
37
|
+
# Exercise the real fulltext procedure, without accepting fallback.
|
|
38
|
+
with patch('wisdom.traverse._keyword_fallback', side_effect=AssertionError('unexpected fallback')):
|
|
39
|
+
assert full_text_search(session, 'graph')[0]['id'] == 'k1'
|
|
40
|
+
assert _keyword_fallback(session, "agent's", 5)[0]['id'] == 'k1'
|
|
41
|
+
assert answer_question(session, 'graph')['nodes']
|
|
42
|
+
assert 'Knowledge' in render_report(session)
|
|
43
|
+
assert len(json.loads(export_json(session, tmp_path).read_text())['nodes']) == 2
|
|
44
|
+
assert 'Graph memory' in export_cypher(session, tmp_path).read_text()
|
|
45
|
+
assert (export_obsidian(session, tmp_path) / 'index.md').exists()
|
|
46
|
+
reopened.close()
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def test_reflection_promotes_real_graph(driver):
|
|
50
|
+
with driver.session() as session:
|
|
51
|
+
merge_nodes(session, [
|
|
52
|
+
dict(id='a', label='Recurring pattern', tier='knowledge', project='a'),
|
|
53
|
+
dict(id='b', label='Recurring pattern', tier='knowledge', project='b'),
|
|
54
|
+
dict(id='failure', label='Unsafe retry', tier='experience', outcome='FAILED', source_count=5),
|
|
55
|
+
])
|
|
56
|
+
stats = run_reflect(session)
|
|
57
|
+
assert stats['experience_promoted'] == 1
|
|
58
|
+
assert stats['failure_insight_promoted'] == 1
|
|
59
|
+
assert stats['wisdom_candidates'] >= 1
|
|
60
|
+
candidate = stats['wisdom_candidates_data'][0]
|
|
61
|
+
write_wisdom(session, [dict(id='w1', label='Safe retry', principle='Make retries idempotent',
|
|
62
|
+
insight_id=candidate['id'], is_antipattern=True)])
|
|
63
|
+
assert session.run('MATCH (:Insight)-[:CRYSTALLIZES_INTO]->(:Wisdom) RETURN count(*) AS c').single()['c'] == 1
|
|
64
|
+
assert connect.status(driver)['Wisdom'] == 1
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def test_missing_node_returns_none_instead_of_cursor_error(driver):
|
|
68
|
+
from wisdom.traverse import explain_node
|
|
69
|
+
with driver.session() as session:
|
|
70
|
+
assert session.run("MATCH (n:Knowledge {id: 'missing'}) RETURN n").single() is None
|
|
71
|
+
assert 'error' in explain_node(session, 'missing')
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def test_exception_releases_store(driver):
|
|
75
|
+
with pytest.raises(ValueError):
|
|
76
|
+
with driver.session() as session:
|
|
77
|
+
session.run("CREATE (:Knowledge {id: 'survives'})")
|
|
78
|
+
raise ValueError('caller failed after autocommit')
|
|
79
|
+
other = EmbeddedDriver(driver.path)
|
|
80
|
+
assert connect.status(other)['Knowledge'] == 1
|
|
81
|
+
other.close()
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def test_second_process_cannot_open_active_writer(driver):
|
|
85
|
+
with driver.session():
|
|
86
|
+
result = subprocess.run(
|
|
87
|
+
[sys.executable, '-c', 'import relate, sys; relate.connect(sys.argv[1])', driver.path],
|
|
88
|
+
capture_output=True, text=True, timeout=15,
|
|
89
|
+
)
|
|
90
|
+
assert result.returncode != 0
|
|
91
|
+
assert 'locked' in result.stderr.lower()
|
|
92
|
+
assert connect.status(driver)['Knowledge'] == 0
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def test_corrupt_config_does_not_silently_select_empty_graph(tmp_path, monkeypatch):
|
|
96
|
+
path = tmp_path / 'config.json'
|
|
97
|
+
path.write_text('{broken')
|
|
98
|
+
monkeypatch.setattr(connect, '_CONFIG_PATH', path)
|
|
99
|
+
with pytest.raises(ValueError, match='Repair the saved configuration'):
|
|
100
|
+
connect.get_driver()
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def test_default_and_legacy_config_routing(tmp_path, monkeypatch):
|
|
104
|
+
monkeypatch.setattr(connect, '_CONFIG_PATH', tmp_path / 'config.json')
|
|
105
|
+
assert connect.backend_name(connect._load_config()) == 'relate'
|
|
106
|
+
connect._save_config({'neo4j_uri': 'neo4j+s://example.databases.neo4j.io', 'neo4j_user': 'neo4j'})
|
|
107
|
+
monkeypatch.setenv('WISDOM_NEO4J_PASSWORD', 'test-password')
|
|
108
|
+
remote = MagicMock()
|
|
109
|
+
with patch('neo4j.GraphDatabase.driver', return_value=remote) as factory:
|
|
110
|
+
assert connect.get_driver() is remote
|
|
111
|
+
factory.assert_called_once_with('neo4j+s://example.databases.neo4j.io', auth=('neo4j', 'test-password'))
|
|
112
|
+
connect.save_embedded(str(tmp_path / 'local.rl'))
|
|
113
|
+
local = connect.get_driver()
|
|
114
|
+
assert local.backend == 'relate'
|
|
115
|
+
local.close()
|
|
116
|
+
with patch('wisdom.connect._write_env_password'):
|
|
117
|
+
connect.save_connection('neo4j+s://example.databases.neo4j.io', 'neo4j', 'secret')
|
|
118
|
+
assert connect.backend_name(connect._load_config()) == 'neo4j'
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def test_quickstart_without_docker(tmp_path, monkeypatch):
|
|
122
|
+
from wisdom.__main__ import _run_quickstart
|
|
123
|
+
monkeypatch.setattr(connect, '_CONFIG_PATH', tmp_path / 'config.json')
|
|
124
|
+
monkeypatch.setattr('sys.argv', ['wisdom', 'quickstart', '--path', str(tmp_path / 'quick.rl'), '--host', 'none'])
|
|
125
|
+
with patch('wisdom.local.up', side_effect=AssertionError('Docker invoked')):
|
|
126
|
+
_run_quickstart()
|
|
127
|
+
assert (tmp_path / 'quick.rl').exists()
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
def test_mcp_remember_and_query_real_engine(tmp_path, monkeypatch):
|
|
131
|
+
from wisdom import mcp
|
|
132
|
+
monkeypatch.setattr(connect, '_CONFIG_PATH', tmp_path / 'config.json')
|
|
133
|
+
connect.save_embedded(str(tmp_path / 'mcp.rl'))
|
|
134
|
+
result = mcp._handle_remember({'label': 'Embedded memory', 'content': 'No Docker needed'})
|
|
135
|
+
assert not result.is_error
|
|
136
|
+
result = mcp._handle_query({'cypher': 'MATCH (n:Knowledge) RETURN n.label AS label'})
|
|
137
|
+
assert not result.is_error
|
|
138
|
+
assert 'Embedded memory' in result.text
|