ContextualMemoryPruningImportanceAttributor
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., "@ContextualMemoryPruningImportanceAttributorPrune my agent's memory to a 4k token budget, keeping pinned and emotionally important items."
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.
genpark-contextual-memory-pruning-importance-attributor-skill
Autonomous Long-Horizon Agentic Memory Pruning & Importance Attributor. Evaluates multi-turn episodic memory buffers, calculates multi-factor salience scores (recency decay, user priority pinning, emotional valence, and entity graph connectivity), and deterministically prunes low-utility noise to respect model context limits.
🌟 Key Features
100% Zero External Dependencies: Runs entirely on the Python 3.9+ standard library.
Model Context Protocol (MCP) Standard: Native support for JSON-RPC 2.0
initialize,tools/list, andtools/call.Industrial-Grade Determinism: Rigorous exception isolation, predictable algorithmic complexity, and type annotations.
Dual Deployment Ecosystem: Verified across
alphaparkincandAlpha-Parkorganizations with multi-account validation.
Related MCP server: recall-memory-mcp
🚀 Quick Start
1. Direct Python SDK Usage
"""Example usage for ContextualMemoryPruningImportanceAttributor."""
import sys
import json
import time
from client import ContextualMemoryPruningImportanceAttributor
sys.stdout.reconfigure(encoding='utf-8')
def main():
print("=== Long-Horizon Contextual Memory Pruning Demo ===")
attributor = ContextualMemoryPruningImportanceAttributor()
now = time.time()
memory_pool = [
{
"id": "mem_01",
"content": "User account ID: ACC-99412, Stripe Customer ID: CUST-STRIPE-7788",
"timestamp": now - 7200,
"access_count": 28,
"is_pinned": True
},
{
"id": "mem_02",
"content": "User mentioned liking black coffee with oat milk on Monday morning.",
"timestamp": now - 86400 * 5,
"access_count": 2,
"is_pinned": False
},
{
"id": "mem_03",
"content": "Autonomous deployment target: Tencent Cloud CVM cluster cvm-sh-prod-02.",
"timestamp": now - 1800,
"access_count": 14,
"is_pinned": False
},
{
"id": "mem_04",
"content": "Random greeting: 'Hey agent how are you today doing fine'.",
"timestamp": now - 86400 * 10,
"access_count": 1,
"is_pinned": False
}
]
print("\n--- 1. Evaluating Multi-Factor Importance Attribution ---")
for m in memory_pool:
score = attributor.attribute_memory_importance(m)
print(f"[{m['id']}] Score: {score:.3f} | Pinned: {m.get('is_pinned', False)} | Text: '{m['content'][:45]}...'")
print("\n--- 2. Pruning Memories to Strict Token Budget (40 Tokens) ---")
pruned_res = attributor.prune_contextual_memories(memory_pool, target_token_budget=40)
print(f"Initial Tokens: {pruned_res['initial_tokens']} -> Retained Tokens: {pruned_res['retained_tokens']}")
print(f"Savings: {pruned_res['token_savings_pct']}% | Retained Nodes: {pruned_res['retained_memory_count']}/{pruned_res['initial_memory_count']}")
print("Retained Memory IDs:", [m["id"] for m in pruned_res["retained_memories"]])
print("Pruned Memory IDs:", pruned_res["pruned_memory_ids"])
if __name__ == "__main__":
main()
2. Run as Model Context Protocol (MCP) Server
Start standard JSON-RPC 2.0 server over stdio:
python mcp_server.pyExecute embedded test harness:
python mcp_server.py --test🛠️ MCP Tool Specification
Inspect skill.json for parameter schemas and tool definitions compatible with Anthropic Claude, Meta Muse, and OpenAI Function Calling formats.
📜 License
Licensed under the MIT License. Copyright © 2026 GenPark AI.
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent memory for AI agents, for code, research and everyday life. Stale facts retire.
Persistent working memory for AI agents: a knowledge graph with semantic search and decay.
Persistent memory for AI agents: keyed facts, a wake bundle each session, one memory in every model.
Persistent memory and knowledge graphs for AI agents. Hybrid search, context checkpoints, and more.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenancePersistent memory system for AI agents that records episodic memories with care-weighting and emotional valence, and provides full-text search with temporal chaining and automatic consolidation.42 PyPIMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to store, retrieve, and self-improve procedural memories (lessons learned) based on relevance to the current task, pruning unused memories to reduce context load and prevent repetition of past mistakes.MIT
- AlicenseNot gradedqualityBmaintenanceEnables agents to maintain multi-tier memory across working scratchpad, dialogue buffer, and episodic stores with recency decay. Supports hybrid BM25/vector retrieval, rank fusion, graph expansion, and context reordering for optimized MCP-based memory and RAG workflows.7MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to record episodic events, decay stale transient interactions using an Ebbinghaus forgetting curve, and consolidate frequent episodes into enduring semantic user persona traits for long-term personalization.7MIT