feat: add optional neo4j hybrid graph integration#77
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 191e9ec2b8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Full mirror refresh | ||
| await session.executeWrite((tx) => tx.run("MATCH (n:AilssNote) DETACH DELETE n")); | ||
| await session.executeWrite((tx) => tx.run("MATCH (t:AilssTarget) DETACH DELETE t")); | ||
|
|
||
| await runBatchWrites(session, UPSERT_NOTES_CYPHER, notes, batchSize); |
There was a problem hiding this comment.
Avoid destructive Neo4j refresh on sync failure
The sync routine deletes all AilssNote/AilssTarget nodes before any inserts, and each step runs outside a single transaction. If a later batch write fails (e.g., transient network/auth error or memory limit), the mirror is left empty or partially rebuilt. In non-strict mode the indexer logs and continues, so MCP will treat Neo4j as available but serve incomplete data. Consider staging writes in a transaction or swapping in temp labels to preserve the previous mirror on failure.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
@codex
Addressed this issue, re-check the code
There was a problem hiding this comment.
Codex Review: Didn't find any major issues. 🚀
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
What
@ailss/corewith env-driven settings, SQLite graph mirror sync, consistency status, and traversal helpers.@ailss/indexerwith strict/best-effort fallback behavior.neo4j_graph_statusandneo4j_graph_traversewith explicit SQLite fallback when Neo4j is disabled or unavailable.Why
How
AILSS_NEO4J_*configuration flags and a Neo4j mirror model (AilssNote,AilssTarget,AILSS_TYPED_LINK,AILSS_RESOLVES_TO).notesandtyped_linksto Neo4j in deterministic batches and validate note/link count consistency.pnpm buildandpnpm check.