feat(db): add NeuG graph database as optional backend with native Cypher support#698
Open
BingqingLyu wants to merge 7 commits into
Open
feat(db): add NeuG graph database as optional backend with native Cypher support#698BingqingLyu wants to merge 7 commits into
BingqingLyu wants to merge 7 commits into
Conversation
NeuG (embedded graph DB with Cypher) can now be used instead of SQLite: codegraph init --backend neug Implements NeuGQueryBuilder with the same public API as QueryBuilder (duck typing), so GraphTraverser, MCP tools, and CLI work unchanged. Key details: - MERGE-based upserts preserve edges (no DETACH DELETE+CREATE) - Literal interpolation for CONTAINS and IN (NeuG 0.1.2 $param limitation) - Standalone test suite (npm run test:neug) — vitest excluded due to glog double-init abort in worker threads (see neug-segv-repro.js) - 32 integration tests against real NeuG binary, all passing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implement 6 missing QueryBuilder methods (getNodeAndEdgeCount, getDominantFile, getTopRouteFile, getRoutingManifest, findNodesByExactName, findNodesByNameSubstring) so all existing CLI/MCP features work on the NeuG backend. Add executeCypher() for raw Cypher queries and expose it via `codegraph cypher <query>`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cover batch operations (insertNodes, insertEdges, updateNode), node query methods (getNodesByName, getNodesByQualifiedNameExact, getNodesByLowerName, getAllNodes, getAllNodeNames), file operations (getStaleFiles), unresolved reference lifecycle (deleteUnresolvedByNode, getUnresolvedByName, getUnresolvedReferencesBatch, getUnresolvedReferencesByFiles, deleteResolvedReferences, deleteSpecificResolvedReferences), status/routing methods (getDominantFile, getTopRouteFile, getRoutingManifest), and graph traversal (getCallees, getImpactRadius). 61 tests total. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update README with architecture diagram, CLI reference, and a new Graph Database Backend section covering NeuG advantages over SQLite for graph operations. Remove SQLite hard-coding from MCP server instructions. Add design doc recording motivation, architecture, and implementation details. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Verify that all 3 Cypher examples from the upstream issue draft actually run on NeuG 0.1.2: variable-length paths, multi-hop pattern matching, and aggregation queries. Total test count: 61 → 67. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…e-neug/neug Replace `neug: file:neug-nodejs-0.1.2-osx_arm64.tgz` with the published `@graphscope-neug/neug@^0.1.2` package. Update all import references from `'neug'` to `'@graphscope-neug/neug'` in source and tests. Also fix NeuG link in design doc, refine README architecture diagram and platform support text. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Expose NeuG Cypher query capability through the MCP server so agents can execute arbitrary graph pattern matching. Returns tabular results, errors gracefully on SQLite backend. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
21 tasks
|
Fix |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
codegraph init --backend neug) as a drop-in alternative to SQLitecodegraph cypher <query>CLI command andcodegraph_cypherMCP tool expose native Cypher queries (NeuG only)@graphscope-neug/neugpackage (platform binaries: macOS ARM64, Linux x64)Motivation
Addresses #681.
CodeGraph currently stores its code knowledge graph in SQLite. While SQLite is proven and portable, using a relational database to simulate graph operations has inherent limitations:
NeuG addresses both with 4 key advantages:
codegraph cypherCLI,codegraph_cypherMCP tool, andexecuteCypher()API.Test plan
We're the NeuG team and happy to own this integration end-to-end — implementation, tests, and ongoing maintenance. Happy to discuss the approach.