fix: resolve graph adapter runtime crash and parameter bugs #100
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.
This PR addresses critical functional bugs in
GraphDatabaseAdapter.tsthat prevented the graph backend from initializing or performing semantic searches.1. ESM Compatibility Fix
require('fs')inside an ESM module, which causes aReferenceErrorin pure ESM environments.requirewith a standardimport * as fsat the top of the file.2. Cypher Parameter Support
query()method signature did not accept parameters, making it impossible to perform safe, parameterized queries.query()signature to acceptparams?: Record<string, any>and pass them to the underlying database engine.3. Functional Search Fix
searchSimilarEpisodes()used the `` placeholder in its Cypher string but failed to pass the actual embedding data. This caused a 100% failure rate for graph-based semantic memory recall.{ embedding }as a parameter map.4. Data Type Flexibility
stringonly toanyto better reflect the schema-less nature of the graph database while maintaining existing serialization for safety.Result: The RuVector Graph backend is now functional for initialization and episodic memory retrieval.