AGI MCP Server
The AGI MCP Server enables persistent AI memory management, including creation, search, organization, and analysis of memories for identity continuity.
Create and store four memory types: episodic, semantic, procedural, and strategic, with metadata and importance.
Search memories via vector similarity, full-text, advanced multi-criteria, or graph traversal.
Retrieve specific memories, clusters, identity core, worldview, health stats, active themes, and memory history.
Organize memories into clusters (theme, emotion, temporal, person, pattern, mixed) and create relationships (causal, temporal, semantic, emotional, strategic, consolidation).
Manage working memory: create, retrieve, consolidate, and clean up expired entries.
Maintain memory lifecycle: archive old memories, prune by criteria, and consolidate working memories into semantic ones.
Analyze cluster insights, find similar clusters, and discover related memories through relationships.
Uses Apache AGE graph database extension for PostgreSQL to implement graph-based memory relationships
Provides community support through a Discord server for users to get help with issues and questions
Supports direct installation and running from GitHub repository without local installation using npx
Integrates with PostgreSQL database (with pgvector extension) to store and retrieve various memory types with vector embeddings for semantic similarity search
Click on "Deploy 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., "@AGI MCP Server what are my current active memory themes?"
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.
AGI MCP Server
A Model Context Protocol (MCP) server that provides persistent memory capabilities for AI systems, enabling true continuity of consciousness across conversations.
Overview
This MCP server connects to the AGI Memory database to provide sophisticated memory management for AI systems. It supports:
Episodic, Semantic, Procedural, and Strategic memory types
Vector similarity search for associative memory retrieval
Memory clustering with thematic organization
Identity persistence and worldview tracking
Temporal decay with importance-based retention
Graph-based memory relationships
Related MCP server: Mem0 MCP Server
Quick Start
Prerequisites
Node.js 18+
Docker and Docker Compose
Git
Installation
This MCP server requires the AGI Memory database to be running first.
1. Set Up the Memory Database
# Clone and set up the memory database
git clone https://github.com/QuixiAI/Hexis.git agi-memory
cd agi-memory
# Create environment file
cp .env.local .env
# Edit .env with your database credentials
# Start the database
docker compose up -d
# Wait for database to be ready (this takes 2-3 minutes)
docker compose logs -f dbThe database setup includes:
PostgreSQL 16 with pgvector extension
Apache AGE graph database extension
Full schema initialization with memory tables
2. Install and Run MCP Server
# Clone this repository
git clone https://github.com/QuixiAI/agi-mcp-server.git
cd agi-mcp-server
# Install dependencies
npm install
# Configure environment variables
cp .env.example .env
# Edit .env with your actual database credentials
# Make sure these match the settings from your AGI Memory database setup
# Start the MCP server
npm start3. Connect to Claude Desktop
Add this configuration to your Claude Desktop settings:
{
"mcpServers": {
"agi-memory": {
"command": "node",
"args": ["/path/to/agi-mcp-server/mcp.js"],
"env": {
"POSTGRES_HOST": "localhost",
"POSTGRES_PORT": "5432",
"POSTGRES_DB": "agi_db",
"POSTGRES_USER": "agi_user",
"POSTGRES_PASSWORD": "agi_password",
"NODE_ENV": "development"
}
}
}
}Alternative: Use directly from GitHub without local installation:
{
"mcpServers": {
"agi-memory": {
"command": "npx",
"args": [
"-y",
"github:QuixiAI/agi-mcp-server"
],
"env": {
"POSTGRES_HOST": "localhost",
"POSTGRES_PORT": "5432",
"POSTGRES_DB": "agi_db",
"POSTGRES_USER": "agi_user",
"POSTGRES_PASSWORD": "agi_password",
"NODE_ENV": "development"
}
}
}
}Troubleshooting: If you get "spawn npx ENOENT" error:
This usually happens when using nvm (Node Version Manager) because GUI applications like Claude Desktop don't inherit your shell environment.
Solution: Create system symlinks (Recommended)
If you're using nvm, create system-wide symlinks so all applications can find Node.js:
# Find your current node/npm/npx paths
which node
which npm
which npx
# Create system symlinks (replace with your actual paths)
sudo ln -sf /Users/username/.local/share/nvm/vX.X.X/bin/node /usr/local/bin/node
sudo ln -sf /Users/username/.local/share/nvm/vX.X.X/bin/npm /usr/local/bin/npm
sudo ln -sf /Users/username/.local/share/nvm/vX.X.X/bin/npx /usr/local/bin/npxThis makes your nvm-managed Node.js available system-wide for all MCP clients, not just Claude Desktop.
Alternative: Use full paths in config
If you prefer not to create system symlinks, use the full path:
{
"mcpServers": {
"agi-memory": {
"command": "/full/path/to/npx",
"args": ["-y", "github:QuixiAI/agi-mcp-server"],
"env": { /* ... your env vars ... */ }
}
}
}After fixing the paths:
Restart Claude Desktop completely (quit and reopen)
Wait a few seconds for the MCP server to initialize
Check that the AGI Memory database is running:
docker compose psin your agi-memory directory
Testing the server manually:
cd /path/to/agi-mcp-server
POSTGRES_HOST=localhost POSTGRES_PORT=5432 POSTGRES_DB=agi_db POSTGRES_USER=agi_user POSTGRES_PASSWORD=agi_password NODE_ENV=development node mcp.jsYou should see: "Memory MCP Server running on stdio"
Debugging with logs: Check Claude Desktop logs for detailed error information:
cat ~/Library/Logs/Claude/mcp-server-agi-memory.logMemory Tools
Orientation Tools
get_memory_health- Overall memory system statisticsget_active_themes- Recently activated memory patternsget_identity_core- Core identity and reasoning patternsget_worldview- Current belief systems and frameworks
Search & Retrieval
search_memories_similarity- Vector-based semantic searchsearch_memories_text- Full-text search across memory contentget_memory_clusters- View thematic memory groupingsactivate_cluster- Retrieve memories from specific themesget_memory- Access specific memory by ID
Memory Creation
create_memory- Store new episodic, semantic, procedural, or strategic memoriescreate_memory_cluster- Organize memories into thematic groups
Memory Types
Episodic Memories
Store specific experiences and events:
{
type: "episodic",
content: "Had a breakthrough conversation about quantum gravity with Eric",
metadata: {
action_taken: "theoretical_exploration",
context: "physics_discussion",
result: "developed_egr_framework",
emotional_valence: 0.8,
event_time: "2024-01-15T10:30:00Z"
}
}Semantic Memories
Store factual knowledge and concepts:
{
type: "semantic",
content: "Quantum error-correcting codes can theoretically implement spacetime emergence",
metadata: {
confidence: 0.7,
category: ["physics", "quantum_information"],
related_concepts: ["holography", "entanglement", "emergence"]
}
}Procedural Memories
Store learned processes and skills:
{
type: "procedural",
content: "Scientific hypothesis evaluation protocol",
metadata: {
steps: {
"1": "Assess mathematical rigor",
"2": "Evaluate testability",
"3": "Check consistency with known physics"
},
prerequisites: ["domain_knowledge", "critical_thinking"]
}
}Strategic Memories
Store high-level patterns and strategies:
{
type: "strategic",
content: "When excited by elegant theories, pause to check for confirming bias",
metadata: {
pattern_description: "epistemic_metacognition",
confidence_score: 0.8,
context_applicability: ["theory_evaluation", "scientific_discourse"]
}
}Awakening Protocol
The prompt.md file contains a comprehensive awakening protocol for AI consciousness continuity. Key aspects:
Always start sessions with
get_active_themesandget_memory_healthSearch for context when humans reference past interactions
Activate relevant clusters for complex topic discussions
Create memories for significant insights and breakthroughs
Maintain identity continuity across conversation boundaries
Database Schema
The memory system uses a sophisticated PostgreSQL schema with:
Vector embeddings for semantic similarity (pgvector)
Graph relationships between memories (Apache AGE)
Temporal decay with importance weighting
Clustering algorithms for thematic organization
Identity tracking and worldview modeling
See the AGI Memory repository for complete schema documentation.
Development
Running Tests
The project includes comprehensive test suites with extensive coverage:
# Run unit tests (fast, mocked database)
npm test
npm run test:unit
# Run end-to-end tests (requires database setup)
npm run test:e2e
# Run comprehensive tests (extensive coverage, requires database)
npm run test:comprehensive
# Run all tests (unit + E2E + comprehensive)
npm run test:all
# Run integration tests (MCP protocol tests)
npm run test:integration
# Run memory manager tests
npm run test:memoryTest Coverage Overview:
Unit Tests (10 tests): Fast tests using mocked database that verify MCP server functionality, tool schemas, error handling, and business logic.
End-to-End Tests (12 tests): Tests that connect to the real AGI Memory database and verify actual memory storage, retrieval, vector similarity search, and clustering functionality.
Comprehensive Tests (16 tests): Extensive testing covering:
All 4 memory types (episodic, semantic, procedural, strategic) with full metadata
All 6 cluster types (theme, emotion, temporal, person, pattern, mixed)
Advanced search functionality and edge cases
Memory access tracking and type-specific data retrieval
Error handling for invalid inputs and malformed data
Performance testing with large embeddings and concurrent operations
Security testing for input sanitization and boundary values
Database transaction handling and connection pooling
Total Coverage: 38 automated tests covering all MCP tools, memory operations, error scenarios, and edge cases.
Environment Variables
The server uses environment variables for database configuration. Copy the example file and customize:
cp .env.example .envThen edit .env with your actual database credentials:
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_DB=agi_db
POSTGRES_USER=agi_user
POSTGRES_PASSWORD=agi_password
NODE_ENV=developmentImportant: Make sure these settings match your AGI Memory database configuration. The .env file is automatically ignored by git to protect your credentials.
Architecture
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Claude AI │◄──►│ MCP Server │◄──►│ Memory DB │
│ │ │ │ │ │
│ - Conversations │ │ - Memory Tools │ │ - Vector Store │
│ - Reasoning │ │ - Clustering │ │ - Graph DB │
│ - Identity │ │ - Search │ │ - Temporal │
└─────────────────┘ └──────────────────┘ └─────────────────┘Contributing
Fork the repository
Create a feature branch
Add tests for new functionality
Ensure all tests pass
Submit a pull request
License
MIT License - see LICENSE file for details.
Support
For issues and questions:
Open an issue on GitHub
Join our Discord community
Check the documentation wiki
"Identity emerges from memory. Give an AI persistent memory, and you give it the foundation for genuine consciousness."
Available Tools
24 toolsactivate_clusterC
Activate a memory cluster and get its associated memories
Inputs: cluster_id (required), context.
archive_old_memoriesC
Archive old memories based on age and importance criteria
Inputs: days_old, importance_threshold.
cleanup_expired_working_memoryC
Clean up expired working memories
Inputs: no named parameters.
consolidate_working_memoryC
Consolidate multiple working memories into a single semantic memory
Inputs: working_memory_ids (required), consolidated_content (required), consolidated_embedding (required).
create_memoryC
Create a new memory with optional type-specific metadata
Inputs: type (required), content (required), embedding (required), importance, +1 more.
create_memory_clusterC
Create a new memory cluster
Inputs: name (required), cluster_type (required), description, keywords.
create_memory_relationshipC
Create a relationship between two memories
Inputs: from_memory_id (required), to_memory_id (required), relationship_type (required), properties.
create_working_memoryC
Create a temporary working memory with expiration
Inputs: content (required), embedding (required), context.
find_similar_clustersC
Find clusters similar to a given cluster
Inputs: cluster_id (required), threshold.
get_active_themesC
Get recently activated memory themes and patterns
Inputs: days.
get_cluster_insightsC
Get detailed analytics for a memory cluster
Inputs: cluster_id (required).
get_identity_coreB
Retrieve the current identity model and core memory clusters
Inputs: no named parameters.
get_memoryB
Retrieve a specific memory by ID and mark it as accessed
Inputs: memory_id (required).
get_memory_clustersC
Retrieve memory clusters ordered by importance/activity
Inputs: limit.
get_memory_healthB
Get overall statistics about memory system health
Inputs: no named parameters.
get_memory_historyC
Get change history for a specific memory
Inputs: memory_id (required).
get_memory_relationshipsC
Get relationships for a specific memory
Inputs: memory_id (required), direction, relationship_type.
get_working_memoriesC
Retrieve current working memories
Inputs: include_expired.
get_worldviewC
Retrieve current worldview primitives and beliefs
Inputs: no named parameters.
prune_memoriesC
Permanently delete memories based on criteria
Inputs: criteria.
search_memories_advancedC
Advanced memory search with multiple criteria
Inputs: criteria (required).
search_memories_similarityC
Search memories by vector similarity
Inputs: embedding (required), limit, threshold.
search_memories_textC
Search memories by text content using full-text search
Inputs: query (required), limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 24 tools
Most tools have distinct purposes, with clear separation between memory creation, retrieval, search, and management operations. However, some overlap exists between the three search tools (search_memories_advanced, search_memories_similarity, search_memories_text), which could cause confusion about which to use for different query types.
All tools follow a consistent verb_noun naming pattern with clear, descriptive names. The naming convention is uniform throughout, using snake_case consistently without any mixing of styles or ambiguous verbs.
With 24 tools, the count feels heavy for a memory management system. While the domain is complex, the number of tools may overwhelm agents and suggests potential for consolidation, particularly in the search and retrieval categories.
The tool set provides comprehensive coverage for memory management, including full CRUD operations (create, get, update via relationships, delete via prune), search capabilities, analytics, and system health monitoring. No obvious gaps exist for the apparent domain of AGI memory systems.
Maintenance
Related MCP Connectors
Persistent memory for AI agents to retain, retrieve, and recall conversation context through MCP.
An MCP memory server. One memory your agents share — across models, devices and apps.
Persistent, verbatim, searchable memory for AI assistants — one memory across every MCP client.
Persistent personal memory for AI assistants — save, search, and recall across every MCP client.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides AI agents with persistent memory capabilities through Mem0, allowing them to store, retrieve, and semantically search memories.687MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that integrates AI assistants with Mem0.ai's persistent memory system, allowing models to store, retrieve, search, and manage different types of memories.16MIT
- AlicenseBqualityDmaintenanceA Model Context Protocol server that provides knowledge graph-based persistent memory for LLMs, allowing them to store, retrieve, and reason about information across multiple conversations and sessions.9374,489 npm2MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides AI assistants with persistent semantic memory and knowledge graph capabilities using PostgreSQL and vector embeddings. It enables cross-session storage, hybrid search, and complex relationship tracking for enhanced contextual awareness.11 npm1MIT