OpenKai
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@OpenKaisave that my name is John and I love hiking"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
OpenKai
An open-source personal memory system for AI agents via MCP
What is OpenKai?
OpenKai is a PostgreSQL + SQLite hybrid MCP (Model Context Protocol) server that gives AI agents persistent memory across conversations. It remembers who you are, what you've talked about, your goals, emotions, and more.
Built as an MCP server, it integrates directly with Claude Desktop and any MCP-compatible client.
Key Features
51 MCP tools for comprehensive memory management
5 memory types: Core, Long-term, Short-term, Episodic, Working
Goals & Projects tracking with milestones and progress
Emotional Intelligence - tag and query memories by emotion
Temporal Queries - "what did we discuss last week?"
Memory Consolidation - automatically promotes important short-term memories
Reflection Engine - finds contradictions and consolidation opportunities
Memory Reinforcement - tracks access patterns and strengthens connections
PostgreSQL for persistent storage, SQLite for fast in-memory caching
Bun runtime for 20x faster startup than Node.js
Quick Start
Prerequisites
Bun 1.2+ (JavaScript runtime)
Docker Desktop (for PostgreSQL)
Claude Desktop or any MCP-compatible client
Installation
# 1. Clone the repository
git clone https://github.com/yourusername/openkai.git
cd openkai
# 2. Install dependencies
bun install
# 3. Copy environment template and set your password
cp .env.example .env
# Edit .env and set POSTGRES_PASSWORD to a secure value
# 4. Start PostgreSQL
cd docker && POSTGRES_PASSWORD=yourpassword POSTGRES_PORT=5433 docker compose up -d postgres
cd ..
# 5. Start the MCP server
bun startDevelopment Commands
bun start # Start MCP server
bun run dev # Start with hot reload
bun run health # Health check
bun test # Run tests
bun run docker:up # Start Docker containers
bun run docker:down # Stop Docker containersClaude Desktop Configuration
Add to your Claude Desktop config file:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"openkai": {
"command": "bun",
"args": ["/path/to/openkai/src/server/index.js"],
"env": {
"POSTGRES_HOST": "localhost",
"POSTGRES_PORT": "5433",
"POSTGRES_DB": "kai",
"POSTGRES_USER": "postgres",
"POSTGRES_PASSWORD": "your-password-here",
"CACHE_BACKEND": "sqlite",
"REDIS_OPTIONAL": "true",
"NODE_ENV": "development",
"LOG_LEVEL": "info"
}
}
}
}Replace /path/to/openkai/ with your actual installation path.
Memory Types
Type | Description | Persistence |
Core | Permanent memories (name, identity, key facts) | Never expires |
Long-term | Categorized memories with importance & strength | Never expires |
Short-term | Temporary memories with configurable expiration | TTL-based |
Episodic | Conversation summaries with key points & decisions | Never expires |
Working | Session scratchpad for active work | Session-based |
MCP Tools (51 total)
Core Memory (3)
save_core_memory, update_core_memory, delete_core_memory
Long-term Memory (3)
save_long_term_memory, update_long_term_memory, delete_long_term_memory
Short-term Memory (2)
save_short_term_memory, delete_short_term_memory
Utility (5)
load_complete_memory, search_memories, get_memory_statistics, cleanup_expired_memories, apply_importance_decay
Episodic Memory (3)
save_episodic_memory, get_episodic_memories, search_episodes
Working Memory / Scratchpad (4)
save_to_scratchpad, get_from_scratchpad, get_full_scratchpad, clear_scratchpad
Reflection Engine (3)
reflect_on_memories, get_unresolved_findings, resolve_finding
Memory Reinforcement (3)
reinforce_memory, get_memory_health, apply_memory_maintenance
Goals & Projects (10)
create_goal, update_goal, update_goal_progress, get_active_goals, get_goal_details, add_goal_milestone, complete_milestone, log_goal_activity, get_neglected_goals, get_goal_stats
Temporal Queries (4)
get_memories_by_time, get_date_summary, get_weekly_summary, get_activity_timeline
Emotional Intelligence (5)
tag_memory_emotion, get_memories_by_emotion, get_emotional_distribution, get_emotional_trend, auto_tag_emotions
Memory Consolidation (5)
run_memory_consolidation, get_promotion_candidates, promote_memory, get_consolidation_stats, strengthen_connections
Architecture
┌─────────────────────────────────────────────┐
│ MCP Client (Claude Desktop) │
└──────────────────┬──────────────────────────┘
│ stdio
v
┌─────────────────────────────────────────────┐
│ OpenKai MCP Server (Bun) │
│ ┌────────────┐ ┌────────────────────────┐ │
│ │ MCP Tools │ │ Memory Modules │ │
│ │ (51 tools) │ │ core, longterm, short │ │
│ │ │ │ episodic, working │ │
│ │ │ │ goals, emotions │ │
│ │ │ │ temporal, consolidation│ │
│ │ │ │ reflection, reinforce │ │
│ └────────────┘ └────────────────────────┘ │
└──────────┬──────────────────┬───────────────┘
│ │
v v
┌──────────────────┐ ┌──────────────────┐
│ PostgreSQL 15 │ │ SQLite Cache │
│ (Persistent) │ │ (In-memory) │
│ Port 5433 │ │ Fast reads │
└──────────────────┘ └──────────────────┘Project Structure
openkai/
├── src/server/
│ ├── index.js # MCP server entry point
│ ├── config.js # Environment configuration
│ ├── database/
│ │ ├── postgres.js # PostgreSQL connection & queries
│ │ └── sqlite-cache.js # SQLite in-memory cache
│ ├── memory/
│ │ ├── core.js # Core memory CRUD
│ │ ├── longterm.js # Long-term memory CRUD
│ │ ├── shortterm.js # Short-term memory CRUD
│ │ ├── episodic.js # Conversation summaries
│ │ ├── working.js # Working memory scratchpad
│ │ ├── goals.js # Goals & projects tracking
│ │ ├── emotions.js # Emotional intelligence
│ │ ├── temporal.js # Temporal queries
│ │ ├── consolidation.js # Memory consolidation
│ │ ├── reflection.js # Reflection engine
│ │ └── reinforcement.js # Memory reinforcement
│ ├── tools/
│ │ ├── index.js # Base tool registry
│ │ └── v5-tools.js # Extended tool definitions
│ └── utils/
│ ├── logger.js # Logging
│ ├── errors.js # Custom errors
│ └── validation.js # Input validation
├── docker/
│ ├── docker-compose.yml # PostgreSQL container
│ └── postgres/init.sql # Database schema
├── scripts/ # Operational scripts
├── config/ # Configuration templates
├── .env.example # Environment template
└── package.json # Bun dependenciesConfiguration
All configuration is via environment variables (.env file). See .env.example for the full template.
Required Settings
POSTGRES_HOST=localhost
POSTGRES_PORT=5433
POSTGRES_DB=kai
POSTGRES_USER=postgres
POSTGRES_PASSWORD=your-secure-passwordOptional Settings
CACHE_BACKEND=sqlite # SQLite in-memory cache (default)
REDIS_OPTIONAL=true # Redis is optional/legacy
NODE_ENV=development
LOG_LEVEL=infoDatabase Schema
PostgreSQL tables:
kai_core_memories- Permanent memorieskai_long_term_memories- Categorized memories with strength ratingskai_short_term_memories- Temporary memories with expirationkai_episodic_memories- Conversation summarieskai_working_memory- Session scratchpadkai_goals- Goals and projectskai_goal_milestones- Goal checkpointskai_goal_activities- Goal activity logkai_reflection_log- Reflection findingskai_memory_access_log- Access analyticskai_memory_connections- Memory relationship graphkai_emergent_patterns- Pattern discoverykai_consolidation_log- Consolidation historykai_temporal_context- Daily context summarieskai_system_metadata- Schema version and system state
See docker/postgres/init.sql for the complete schema.
Troubleshooting
PostgreSQL won't start
# Check if port 5433 is in use
docker ps | grep 5433
# Start postgres only
cd docker && POSTGRES_PASSWORD=yourpassword POSTGRES_PORT=5433 docker compose up -d postgresMCP client can't connect
Make sure
kai-postgresis running:docker ps --filter "name=kai-postgres"Verify
bunis installed:bun --versionCheck the path in your MCP client config points to
src/server/index.jsRestart your MCP client after config changes
Health check
bun run healthContributing
See CONTRIBUTING.md for guidelines on how to contribute.
License
OpenKai v1.0.0 | Powered by Model Context Protocol | PostgreSQL | Bun
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/udithaMee/openkai'
If you have feedback or need assistance with the MCP directory API, please join our Discord server