genpark-contextual-memory-pruning-importance-attributor-skill
OfficialClick 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., "@genpark-contextual-memory-pruning-importance-attributor-skillScore and prune my chat memories to fit 500 tokens, keeping pinned 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: agent-memory
🚀 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
Agent memory that refuses to guess: evidence-gated recall, exact-source reads, verifiable deletion.
Persistent memory for AI agents to retain, retrieve, and recall conversation context through MCP.
Hosted agent memory with provenance, contradiction surfacing, and snapshot rollback.
Memory that reasons: continual learning for stateful agents. Better context, fewer tokens.
Related MCP Servers
- 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
- AlicenseAqualityBmaintenanceEnables AI agents to maintain long-term, cross-session memory by extracting facts, reconciling state conflicts, and retrieving relevant memories via vector search.4MIT
- AlicenseNot gradedqualityAmaintenanceScores AI agent context entries for relevance using Jev and prunes or summarizes those that are no longer useful, helping MCP hosts reduce token usage and context bloat.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to combine ambient multimodal perception, continuous episodic memory, and recency-decay context briefing for fast deterministic decisions and safe tool routing. It integrates with MCP clients to reduce unnecessary frontier LLM calls while enforcing token budgets and local-first memory retention.7MIT