genpark-contextual-memory-pruning-importance-attributor-skill
OfficialThis server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
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: ctxjev-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.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
Related MCP Connectors
Agent memory that refuses to guess: evidence-gated recall, exact-source reads, verifiable deletion.
Long-term memory for AI agents. Pass one sentence, and it remembers, recalls, or forgets.
Persistent memory for AI agents to retain, retrieve, and recall conversation context through MCP.
Hosted agent memory with provenance, contradiction surfacing, and snapshot rollback.
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
- 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
- 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