feat(mcp): add temporal graph support to MCP tools #108
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.
Add Temporal Graph Support to MCP Tools
🎯 Summary
Exposes OpenMemory's temporal graph capabilities through MCP, enabling agents to store and query structured facts that change over time alongside contextual/HSG memories.
💡 Motivation
While OpenMemory has powerful temporal graph features for tracking facts over time (like Zep's Graphiti), these capabilities were only accessible via HTTP API. This PR brings temporal graph support to the MCP interface, allowing Claude, Cursor, Windsurf, and other MCP clients to leverage both:
This enables agents to handle evolving information like:
🔧 Changes
1. Database (Postgres Support for Temporal Graph)
File:
packages/openmemory-js/src/core/db.tstemporal_factstable creation for Postgrestemporal_edgestable creation for Postgres2. Enhanced MCP Tools
File:
packages/openmemory-js/src/ai/mcp.tsopenmemory_storeenhancements:typeparameter:"contextual"(default),"factual","both"factsarray parameter for structured fact storagetypedefault to HSG (contextual)openmemory_queryenhancements:typeparameter:"contextual"(default),"factual","unified"fact_patternparameter for temporal queries (subject/predicate/object with wildcards)atparameter for point-in-time historical queriestypeuse HSG semantic search3. Documentation
File:
docs/mcp.md📋 API Examples
Storage
Queries
✅ Backward Compatibility
typedefaults to existing behaviorBenefits
For Users:
For Developers:
Migration Notes
No migration needed. This is additive - existing HSG functionality unchanged.
To use new features, agents should:
typeparameter toopenmemory_storecalls when storing factsfactsarray with subject-predicate-object triplestype="factual"ortype="unified"for temporal queriesfact_patternfor targeted fact retrievalExample Output
Memory/Facts Creation
Memory/Facts Retrieval