graphiti/.serena/memories
Lars Varming 341efd8c3d Fix: Critical database parameter bug + index creation error handling
CRITICAL FIX - Database Parameter (graphiti_core):
- Fixed graphiti_core/driver/neo4j_driver.py execute_query method
- database_ parameter was incorrectly added to params dict instead of kwargs
- Now correctly passed as keyword argument to Neo4j driver
- Impact: All queries now execute in configured database (not default 'neo4j')
- Root cause: Violated Neo4j Python driver API contract

Technical Details:
Previous code (BROKEN):
  params.setdefault('database_', self._database)  # Wrong - in params dict
  result = await self.client.execute_query(cypher_query_, parameters_=params, **kwargs)

Fixed code (CORRECT):
  kwargs.setdefault('database_', self._database)  # Correct - in kwargs
  result = await self.client.execute_query(cypher_query_, parameters_=params, **kwargs)

FIX - Index Creation Error Handling (MCP server):
- Added graceful handling for Neo4j IF NOT EXISTS bug
- Prevents MCP server crash when indices already exist
- Logs warning instead of failing initialization
- Handles EquivalentSchemaRuleAlreadyExists error gracefully

Files Modified:
- graphiti_core/driver/neo4j_driver.py (3 lines changed)
- mcp_server/src/graphiti_mcp_server.py (12 lines added error handling)
- mcp_server/pyproject.toml (version bump to 1.0.5)

Testing:
- Python syntax validation: PASSED
- Ruff formatting: PASSED
- Ruff linting: PASSED

Closes issues with:
- Data being stored in wrong Neo4j database
- MCP server crashing on startup with EquivalentSchemaRuleAlreadyExists
- NEO4J_DATABASE environment variable being ignored

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-10 11:37:16 +01:00
..
code_structure.md Use official Dockerfile.standalone for custom MCP server build 2025-11-08 21:07:28 +01:00
code_style_and_conventions.md Use official Dockerfile.standalone for custom MCP server build 2025-11-08 21:07:28 +01:00
database_parameter_fix_nov_2025.md Fix: Critical database parameter bug + index creation error handling 2025-11-10 11:37:16 +01:00
development_commands.md Use official Dockerfile.standalone for custom MCP server build 2025-11-08 21:07:28 +01:00
docker_build_setup.md Fix: Critical database parameter bug + index creation error handling 2025-11-10 11:37:16 +01:00
git_workflow.md Use official Dockerfile.standalone for custom MCP server build 2025-11-08 21:07:28 +01:00
librechat_integration_verification.md Fix: Critical database parameter bug + index creation error handling 2025-11-10 11:37:16 +01:00
mcp_server_fixes_nov_2025.md Fix: Critical database parameter bug + index creation error handling 2025-11-10 11:37:16 +01:00
mcp_server_tools.md Fix MCP server compatibility and upgrade to SDK 1.21.0 2025-11-09 10:05:26 +01:00
mcp_tool_annotations_implementation.md Fix: Critical database parameter bug + index creation error handling 2025-11-10 11:37:16 +01:00
mcp_tool_descriptions_final_revision.md Fix: Critical database parameter bug + index creation error handling 2025-11-10 11:37:16 +01:00
mcp_tool_descriptions_implementation_complete.md Improve MCP tool descriptions for better LLM tool selection 2025-11-09 15:05:54 +01:00
multi_user_security_analysis.md Fix: Critical database parameter bug + index creation error handling 2025-11-10 11:37:16 +01:00
neo4j_database_config_investigation.md Fix: Critical database parameter bug + index creation error handling 2025-11-10 11:37:16 +01:00
project_overview.md Fix: Critical database parameter bug + index creation error handling 2025-11-10 11:37:16 +01:00
pypi_publishing_setup.md Fix: Critical database parameter bug + index creation error handling 2025-11-10 11:37:16 +01:00
system_commands.md Use official Dockerfile.standalone for custom MCP server build 2025-11-08 21:07:28 +01:00
task_completion_checklist.md Use official Dockerfile.standalone for custom MCP server build 2025-11-08 21:07:28 +01:00