Provides integration for booking meetings and scheduling consultations through Calendly links.
Supports sending alerts and messages to Discord channels via webhooks as part of multi-platform broadcast automation.
Provides AI-powered entity extraction from natural language using GPT-4 to automatically identify entities and relationships from conversational text.
Enables sending notifications and messages to Slack channels through webhook integrations as part of custom automation tools.
Bi-Temporal Knowledge Graph MCP Server
A production-ready MCP (Model Context Protocol) server that gives your AI agents persistent memory with full temporal tracking. Save facts, extract entities using AI, and query historical data with time-travel capabilities.
Build intelligent AI agents with persistent memory that understands time and context
Architecture
This server uses a single-file "Database-Blind" architecture:
main.py - Everything in one file: FalkorDB driver, session management, entity extraction, memory tools, and your custom automation tools
Structure:
Configuration & Database Driver
Session Store & Entity Extractor
Graphiti Memory Core
Core MCP Memory Tools
CUSTOM AUTOMATION TOOLS section (add your webhook tools here!)
Server Startup
Note: This server focuses solely on memory operations. For advanced workflow orchestration, see the optional Automation Engine OS section.
โญ Star This Repo
If you find this project useful, please give it a star! It helps others discover the project and motivates continued development.

๐ Links
๐ Get Started - Ready in 5 minutes
๐ฅ Video Tutorial - Watch how to set it up
โ FAQs - Common questions answered
๐ Report Bugs - Found an issue?
๐ Request Features - Have an idea?
Resources
๐ฌ Community - High Ticket AI Builders community
๐ Full Documentation - Complete guide
๐ Deployment Guide - Deploy anywhere
๐งช Examples - Interactive scenarios
๐ Table of Contents
โจ Features
๐ง Bi-Temporal Knowledge Graph
Smart Memory: Automatically tracks when facts were created AND when they became true in reality
Conflict Resolution: When you move locations or change jobs, old facts are automatically invalidated
Time Travel Queries: Ask "Where did John live in March 2024?" and get accurate historical answers
Session Tracking: Maintains context across conversations with automatic cleanup
๐ค AI-Powered Entity Extraction
Natural Language Understanding: Just tell it in plain English - "Alice moved to San Francisco and started working at Google"
Automatic Relationship Discovery: AI extracts entities and relationships without manual input
OpenAI Integration: Uses GPT-4 for intelligent entity extraction
Graceful Degradation: Works without AI - just add facts manually
๐ ๏ธ Simple Tool Extension
Single-File Architecture: Everything in one
main.pyfile for easy customizationDirect @mcp.tool() Pattern: Add tools with a simple decorator - no config files needed
Single & Multi-Webhook: Execute one webhook or fire multiple in parallel
Clear Custom Section: Marked section in main.py shows exactly where to add your tools
๐ Production Ready
Docker Support: Complete docker-compose setup included
Replit Optimized: Built specifically for Replit Autoscale environments
Resource Management: Automatic session cleanup and connection pooling
Health Checks: Built-in monitoring and status endpoints
100% Privacy-Friendly: Your data stays in your database
๐ฌ How It Works
๐ธ Screenshots
Memory in Action

AI Entity Extraction

Dynamic Tool Generation

Temporal Queries

๐ฅ Video Tutorial
Watch the complete setup and usage guide:
![]()
Topics covered:
Installation & setup (0:00)
Adding your first facts (2:30)
Using AI entity extraction (5:15)
Creating automation tools (8:45)
Temporal queries (12:20)
Deployment to production (15:00)
๐ Quick Start
Option 1: Docker Compose (Recommended)
That's it! ๐ Your server is now running at http://localhost:8080/sse
Option 2: Python (Local Development)
Option 3: One-Click Deploy
๐ ๏ธ Adding Custom Automation Tools
Add your custom automation tools directly in main.py in the CUSTOM AUTOMATION TOOLS section.
Step 1: Find the Custom Tools Section
Open main.py and scroll to around line 800 - look for this clearly marked section:
This is where you'll add your webhook tools using the @mcp.tool() decorator.
Step 2: Add Your Tool
Add a decorated async function with @mcp.tool():
The function's docstring becomes the tool description that the AI sees.
Step 3: Restart the Server
Restart the MCP server to load your new tools.
Example: LinkedIn Poster Tools
The Automation Engine App generates tools like this:
Example: Multi-Webhook Broadcast
Fire multiple webhooks in parallel:
๐ API Reference - Memory Tools
All available MCP tools for managing your knowledge graph:
Core Memory Operations
add_fact
Add a new fact to the knowledge graph with bi-temporal tracking.
Smart Conflict Resolution: When adding location or employment facts, previous facts of the same type are automatically invalidated.
add_message
Add a natural language message and automatically extract entities using AI.
Returns: Extracted entities and relationships as facts.
query_facts
Query facts from the knowledge graph.
query_at_time
Time-travel query - get facts valid at a specific point in time.
Use Case: "Where did John work in January 2024?"
get_episodes
Get recent conversation sessions/episodes.
clear_graph
Clear all data for specified groups. Warning: Permanent deletion!
Server Management
get_status
Get comprehensive server status and statistics.
force_cleanup
Manually trigger cleanup of expired sessions and idle connections.
๐ก Use Cases
Personal Knowledge Management
Track your life events, relationships, and locations with full history:
Customer Relationship Management
Monitor customer interactions with automatic conflict resolution:
AI Agent Memory
Give your AI agents persistent, queryable memory:
Workflow Automation
Combine knowledge with actions:
โ Frequently Asked Questions
Q: Does this require OpenAI?
A: No! OpenAI is optional for AI entity extraction. You can add facts manually without it.
Q: Can I use this with Claude Desktop?
A: Yes! Add the server URL to your claude_desktop_config.json:
Q: How do I query historical data?
A: Use the query_at_time tool:
Q: Can I deploy this to production?
A: Absolutely! See DEPLOYMENT.md for guides on:
Replit Autoscale
Railway
Render
Fly.io
Docker
VPS
Q: How does fact invalidation work?
A: When you add a fact about location or employment, the system automatically finds previous facts of the same type and marks them as invalid_at: current_time. Your query results only show current facts unless you specifically request historical data.
Q: Can I create multi-webhook tools?
A: Yes! Add a tool to the Custom Tools section in main.py using asyncio.gather() to fire multiple webhooks simultaneously. See the Adding Custom Tools section for examples.
Q: Is my data secure?
A: Yes! Everything runs in your infrastructure. No data is sent anywhere except:
OpenAI (only if you use entity extraction)
Your configured webhooks (only when you call them)
Q: How much does it cost to run?
A: Free for self-hosting! Only costs:
FalkorDB hosting (free tier available)
OpenAI API usage (optional, ~$0.001 per extraction)
๐ Changelog
[1.0.0] - 2024-12-19
Added
โ Full bi-temporal tracking (created_at, valid_at, invalid_at, expired_at)
โ Smart conflict resolution for location and employment changes
โ Session-aware episodic memory with 30-minute TTL
โ OpenAI-powered entity extraction from natural language
โ Dynamic tool generator for automation workflows
โ Single webhook tool template
โ Multi-webhook parallel execution template
โ Docker and Docker Compose support
โ Replit Autoscale optimization
โ Background cleanup manager
โ Comprehensive documentation and examples
Supported Features
Feature | Status | Notes |
Bi-Temporal Tracking | โ | Full implementation |
AI Entity Extraction | โ | OpenAI GPT-4 |
Smart Invalidation | โ | Location, employment, relationships |
Session Management | โ | Auto-cleanup after 30 min |
Custom Tools | โ | Single & multi-webhook via @mcp.tool() |
Parallel Webhooks | โ | asyncio.gather |
Docker Support | โ | Complete stack included |
Health Checks | โ | Built-in monitoring |
๐ Support
Need Help?
Check Documentation: Start with QUICKSTART.md
Join Community: High Ticket AI Builders - Free access!
Watch Tutorial: Video Guide
Report Bugs: GitHub Issues
๐ง Optional: Automation Engine OS
Need a visual tool to orchestrate your workflows?
If you want to manage webhook configurations, generate tools automatically, and orchestrate complex workflows without writing code, check out Automation Engine OS - it's free when you join our community!
What Automation Engine OS provides:
Visual webhook configuration builder
Automatic MCP tool code generation
Workflow orchestration dashboard
Multi-webhook template management
One-click tool deployment to your MCP server
Get free access: Join High Ticket AI Builders
Note: Automation Engine OS is completely optional. This MCP server works standalone - you can manually add tools to the Custom Tools section in main.py as shown in the Adding Custom Automation Tools section.
๐ค Contributing
Contributions are welcome! Areas for improvement:
๐ Additional temporal query operators
๐ง Enhanced entity extraction prompts
๐ง More webhook authentication methods
๐ Performance optimizations
๐ Additional deployment platforms
๐ More examples and tutorials
To contribute:
Fork the repository
Create your feature branch (
git checkout -b feature/AmazingFeature)Commit your changes (
git commit -m 'Add some AmazingFeature')Push to the branch (
git push origin feature/AmazingFeature)Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
TL;DR: You can use this commercially, modify it, distribute it. Just keep the license notice.
๐ Acknowledgments
Built with FastMCP
Powered by FalkorDB
AI features via OpenAI
Inspired by the High Ticket AI Builders community
โญ Star History
๐ Connect
๐ฌ Community: High Ticket AI Builders
๐ Want this implemented for your business? Book a Meeting
Built with โค๏ธ for the High Ticket AI Builders ecosystem
If this project helps you, please consider giving it a โญ!