Skip to main content
Glama

decay

Run a dry-run decay check to calculate Ebbinghaus decay for all memories and identify those that would be archived, without modifying any files.

Instructions

Run a dry-run decay check. Calculates Ebbinghaus decay for all memories and reports which would be archived. Does NOT modify any files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Tool definition (inputSchema) for the 'decay' tool — a dry-run decay check with no required parameters.
    {
        "name": "decay",
        "description": "Run a dry-run decay check. Calculates Ebbinghaus decay for all memories and reports which would be archived. Does NOT modify any files.",
        "inputSchema": {"type": "object", "properties": {}},
    },
  • Handler for the 'decay' tool call. Iterates all memory files, computes Ebbinghaus exponential decay based on days since creation and tier-specific decay constants, reports which would decay or be archived. Pure dry-run (no file modification).
    elif name == "decay":
        files = list_memory_files()
        today_epoch = datetime.now().timestamp()
        decay_map = {
            "semantic": 90, "episodic": 30, "procedural": 180,
            "reflection": 60, "working": 7, "core": 999999,
        }
        results_lines = ["Decay check (dry-run):", ""]
        for f in files:
            with open(os.path.join(MEMORY_DIR, f["path"]), encoding="utf-8") as fh:
                text = fh.read()
            created = parse_frontmatter(text, "created") or "2026-05-18"
            try:
                dt = datetime.strptime(created[:10], "%Y-%m-%d")
                days = max(1, (datetime.now() - dt).days)
            except ValueError:
                days = 1
            dc = decay_map.get(f["type"], 30)
            new_s = f["strength"] * math.exp(-days / dc)
            new_s = max(0.05, min(1.0, new_s))
            if abs(new_s - f["strength"]) > 0.01:
                status = ""
                if new_s < 0.2:
                    status = " [WOULD ARCHIVE]"
                elif new_s < 0.4:
                    status = " [DECAYING]"
                results_lines.append(f"  {f['name']}: {f['strength']:.2f} → {new_s:.2f} ({days}d){status}")
        if len(results_lines) == 2:
            results_lines.append("  All memories at expected strength.")
        return {"content": [{"type": "text", "text": "\n".join(results_lines)}]}, None
  • nexus_mcp.py:120-170 (registration)
    TOOL_DEFS list registering all tools including 'decay' (line 166-169). Also handle_tools_list at line 172-173 returns these definitions.
    TOOL_DEFS = [
        {
            "name": "search",
            "description": "Search across all memory files by keyword. Returns matching file names, titles, strengths, and context snippets.",
            "inputSchema": {
                "type": "object",
                "properties": {"query": {"type": "string", "description": "Keyword or phrase to search for"}},
                "required": ["query"],
            },
        },
        {
            "name": "stats",
            "description": "Show memory health statistics: file counts per tier, average strength, active/decaying/archived counts.",
            "inputSchema": {"type": "object", "properties": {}},
        },
        {
            "name": "save",
            "description": "Save a new memory to a specified tier. Creates a markdown file with frontmatter. Use for recording new information, preferences, or experiences.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "tier": {
                        "type": "string",
                        "enum": ["episodic", "semantic", "procedural", "reflection", "working"],
                        "description": "Memory tier: episodic (experiences), semantic (facts/preferences), procedural (workflows), reflection (meta), working (in-session)",
                    },
                    "name": {"type": "string", "description": "Filename slug (no extension, use dashes: my-memory-name)"},
                    "content": {"type": "string", "description": "Full markdown content of the memory (including title heading)"},
                    "tags": {"type": "string", "description": "Comma-separated tags (optional)"},
                },
                "required": ["tier", "name", "content"],
            },
        },
        {
            "name": "touch",
            "description": "Boost a memory's strength (simulate access, counteracts Ebbinghaus decay). Use this when a memory is referenced or found relevant.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "name": {"type": "string", "description": "Memory filename (with or without .md extension)"},
                    "boost": {"type": "number", "description": "Strength boost amount (default 0.15, max 1.0)"},
                },
                "required": ["name"],
            },
        },
        {
            "name": "decay",
            "description": "Run a dry-run decay check. Calculates Ebbinghaus decay for all memories and reports which would be archived. Does NOT modify any files.",
            "inputSchema": {"type": "object", "properties": {}},
        },
    ]
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It explicitly states 'Does NOT modify any files,' which is critical for behavioral transparency. However, it lacks details on performance or other potential side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two concise sentences, front-loaded with the verb 'Run a dry-run decay check,' and every word adds value. No redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description adequately explains the tool's action and result (reports which memories would be archived). For a zero-parameter tool, this is complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has no parameters, so baseline is 4. The description adds no parameter information, which is acceptable since none exist.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool runs a dry-run decay check, calculates Ebbinghaus decay for all memories, and reports which would be archived. It explicitly distinguishes itself from siblings by emphasizing it does not modify files.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The term 'dry-run' implies a preview before actual archiving, but no explicit guidance on when to use versus alternatives is given. Since sibling tools (save, search, stats, touch) serve different purposes, the context is clear enough.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

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/Y-Sky-bro/nexus-memory'

If you have feedback or need assistance with the MCP directory API, please join our Discord server