Skip to content

Conversation

@themavik
Copy link

@themavik themavik commented Feb 9, 2026

Summary

Fixes #3906.

Root cause: Neo4jGraph.__init__ parameter order is (url, username, password, token, database, ...) but the code passed database as the 4th positional argument, which maps to token. This caused the database value to be silently used as token, while the actual database parameter defaulted to 'neo4j'. Users configuring a non-default database name had it silently ignored.

Fix: Use explicit keyword arguments for all parameters to ensure correct mapping regardless of positional order.

Changes

  • mem0/memory/graph_memory.py: Changed Neo4jGraph() call from positional to keyword arguments

Testing

  • Keyword args ensure correct parameter mapping
  • No behavioral change for users using default neo4j database
  • Fixes incorrect database selection for non-default database names

Root cause: Neo4jGraph.__init__ parameter order is (url, username,
password, token, database, ...) but the code passed database as the
4th positional argument, which maps to the token parameter. This
caused the database value to be silently used as token, while the
actual database defaulted to 'neo4j'.

Fix: Use explicit keyword arguments to ensure each value maps to
the correct parameter regardless of positional order.
@CLAassistant
Copy link

CLAassistant commented Feb 9, 2026

CLA assistant check
All committers have signed the CLA.

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.

Bug:Fix incorrect parameter order in Neo4jGraph initialization in MemoryGraph

2 participants