Implemented two new MCP tools and enhanced workflow instructions to enable
effective Personal Knowledge Management across all use cases (architecture
decisions, projects, coaching, research, etc.).
## New Tools
1. **get_entity_connections** - Direct graph traversal showing ALL relationships
- Returns complete connection data for an entity
- Guarantees completeness vs semantic search
- Essential for pattern detection and exploration
- Leverages EntityEdge.get_by_node_uuid()
2. **get_entity_timeline** - Chronological episode history
- Shows ALL episodes mentioning an entity
- Enables temporal tracking and evolution analysis
- Critical for understanding how concepts evolved
- Leverages EpisodicNode.get_by_entity_node_uuid()
## Enhanced Workflow Instructions
Updated GRAPHITI_MCP_INSTRUCTIONS with:
- Clear "SEARCH FIRST, THEN ADD" workflow with decision flowcharts
- Tool selection guide (when to use each tool)
- Distinction between graph traversal vs semantic search
- Multiple concrete examples across different domains
- Key principles for effective PKM usage
## Updated add_memory Docstring
Added prominent warning to search before adding:
- Step-by-step workflow guidance
- Emphasizes creating connections vs isolated nodes
- References new exploration tools
## Benefits
- Prevents disconnected/duplicate entities
- Enables reliable pattern recognition with complete data
- Cost-effective (single graph query vs multiple semantic searches)
- Temporal tracking for evolution analysis
- Works equally well for technical and personal knowledge
## Implementation Details
- 0 changes to graphiti_core (uses existing features only)
- All new code in mcp_server/src/graphiti_mcp_server.py
- Backward compatible (adds tools, doesn't modify existing)
- Follows existing MCP tool patterns and conventions
- Passes all lint and syntax checks
Related: DOCS/IMPLEMENTATION-Graph-Exploration-Tools.md
The MCP server was reading NEO4J_DATABASE from environment config but not
passing it to the Neo4jDriver during initialization. This caused data to be
stored in the default 'neo4j' database instead of the configured database.
Changes:
- factories.py: Added database parameter to Neo4j config dictionary
- graphiti_mcp_server.py: Use graph_driver pattern with Neo4jDriver
- Added Neo4jDriver import and pass database parameter during initialization
- test_database_param.py: Added comprehensive test for database configuration
Implementation uses the graph_driver pattern (matching FalkorDB) instead of
direct parameter passing, as the Graphiti constructor does not accept a
database parameter directly.
This fix enables property-based multi-tenancy with a single configured
database (e.g., 'graphiti') instead of the hardcoded default ('neo4j').
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>