Skip to content

Adopt graphify as the synthesis engine#9

Open
Lanzelot1 wants to merge 2 commits into
mainfrom
adopt-graphify-synthesis-engine
Open

Adopt graphify as the synthesis engine#9
Lanzelot1 wants to merge 2 commits into
mainfrom
adopt-graphify-synthesis-engine

Conversation

@Lanzelot1

Copy link
Copy Markdown
Owner

Summary

  • Delete the hand-rolled wiki pattern (type: wiki pages in knowledge/) and delegate synthesis to graphify, a separate MIT-licensed tool that builds a knowledge graph + wiki from a folder of mixed content.
  • knowledge/ keeps its role as the authored layer (source files with type: source). graphify-out/ is the new generated synthesis layer (wiki + graph + report), committed to git except cache/.
  • /synthesize becomes a thin wrapper around graphify . --update --wiki; /recall, /status, /sleep, /process-inbox updated accordingly.
  • Lock-in mitigations baked in: pinned version, committed portable outputs (markdown + NetworkX JSON), documented swap path (Microsoft GraphRAG or LightRAG).

Why

The /synthesize command was a smaller, manual version of what graphify does end-to-end (extraction → graph → per-community wiki → queryable JSON → MCP server → always-on PreToolUse hook). Keeping both duplicates effort and leaves the manual one weaker. Graphify also adds multi-modal ingest (code AST, PDFs, images, video transcription) and 71.5x token reduction on queries.

Install (one-time, per machine)

These are system-level actions and are not part of this PR. Run them after merging:

pipx install -r requirements.txt           # pins graphifyy==0.4.23
graphify install                            # registers /graphify slash command
graphify claude install                     # enables always-on PreToolUse hook
graphify hook install                       # rebuilds graph on commit
pipx inject graphifyy 'graphifyy[mcp]'      # MCP server deps

Files changed

  • .claude/commands/synthesize.md — rewrite as graphify wrapper
  • .claude/commands/process-inbox.md — drop wiki-update step
  • .claude/commands/recall.md — read graphify-out/GRAPH_REPORT.md first, then query graph
  • .claude/commands/status.md — Wiki Health → Graph Layer metrics
  • .claude/commands/sleep.md — drop wiki synthesis/staleness, rebuild graph at end; contradiction check against AMBIGUOUS edges
  • scripts/validate-frontmatter.sh — drop type: wiki## Sources check
  • CLAUDE.md — document new flow + swap path
  • README.md — rewrite Folders, Slash Commands, and Synthesis Layer sections
  • memory/_index.md — remove Wiki Pages section, link graphify-out/GRAPH_REPORT.md and wiki
  • .gitignore — ignore graphify-out/cache/ only
  • .mcp.json (new) — expose graphify as MCP server
  • requirements.txt (new) — pin graphifyy[mcp]==0.4.23

Test plan

  • After merge, run the install commands above.
  • graphify --version prints 0.4.23.
  • /graphify appears as a slash command in Claude Code.
  • On a populated knowledge/, /synthesize produces graphify-out/wiki/, graph.json, GRAPH_REPORT.md.
  • /status reports graph metrics (nodes, edges, communities, god nodes, AMBIGUOUS count) when graphify-out/ exists.
  • /recall "some topic" reads GRAPH_REPORT.md and queries the graph.
  • /mcp in a fresh session lists graphify; query_graph returns structured results.
  • Post-commit hook rebuilds graphify-out/ after a knowledge/ change.
  • scripts/validate-frontmatter.sh passes.
  • CI passes (no .mcp.schema.json exists, so .mcp.json is not schema-validated — confirmed intentional).

Swap path (lock-in mitigation)

If graphify stagnates, migration targets are Microsoft GraphRAG or LightRAG. Outputs are plain markdown + NetworkX JSON, so committed artifacts keep working; only incremental rebuilds are tied to graphify.

🤖 Generated with Claude Code

Lanzelot1 and others added 2 commits April 18, 2026 15:33
Replaces the hand-rolled wiki pattern with graphify as the synthesis
layer. knowledge/ keeps holding authored source files; graphify-out/
is the generated wiki + graph + report, rebuilt by /synthesize.

- /synthesize: thin wrapper around `graphify . --update --wiki`
- /process-inbox: drop wiki-update step
- /recall: read GRAPH_REPORT.md first, then query the graph
- /status: Wiki Health -> Graph Layer metrics
- /sleep: drop wiki-synthesis and wiki-staleness; graph rebuild at end
- validate-frontmatter.sh: drop type:wiki check
- CLAUDE.md + README.md: document new flow + swap path (GraphRAG/LightRAG)
- .mcp.json + requirements.txt: pin graphifyy and register MCP server
- .gitignore: ignore graphify-out/cache/ (regenerable)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Review caught two bugs in the initial commit:

1. `pipx install -r requirements.txt` is not a valid pipx command
   (-r is pip convention). Switch to a project-local `.venv/` so
   `pip install -r requirements.txt` works as documented.

2. `.mcp.json` used `command: "python"`, which can't find the graphify
   module when it's in a pipx-isolated venv. Point at `.venv/bin/python3`
   instead — stable across macOS, Linux, WSL.

Also update /synthesize, /sleep, /recall to invoke `.venv/bin/graphify`
with a note on swapping to plain `graphify` for global pipx installs.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant