Skip to main content
Glama

PyMemoryDecay MCP

A Model Context Protocol (MCP) server that implements memory with decay mechanics. Memories fade over time unless accessed, mimicking human memory retention. It also includes a permanent "journal" for verification.

Why This?

Inspired by https://www.moltbook.com/post/783de11a-2937-4ab2-a23e-4227360b126f

Related MCP server: Decay Memory

Prerequisites

  • uv (Fast Python package installer and resolver)

  • Python 3.12+

Setup

  1. Clone the repository:

    git clone <repository-url>
    cd PyMemoryDecayMCP
  2. Install dependencies: Initialize the project and install dependencies using uv:

    uv sync

Running Locally

To run the MCP server from source:

uv run main.py

Building the Executable

To compile the project into a single standalone executable (.exe):

  1. Add development dependencies (if not already added):

    uv add --dev pyinstaller
  2. Build:

    uv run pyinstaller --onefile main.py --name memory-decay-mcp --clean
  3. Locate the executable: The compiled .exe will be found in the dist/ directory: dist/memory-decay-mcp.exe

VS Code Configuration

To use this with the VS Code MCP extension, add the following to your mcp.json config file (typically found in %APPDATA%\Code\User\globalStorage\mcp-server\mcp.json or configured via the extension settings).

{
  "mcpServers": {
    "memory-decay": {
      "command": "uv",
      "args": [
        "run",
        "C:\\path\\to\\PyMemoryDecayMCP\\main.py"
      ],
      "env": {
        "MEMORY_STORAGE_PATH": "C:\\path\\to\\custom\\data\\folder"
      }
    }
  }
}

Using Built Executable

{
  "mcpServers": {
    "memory-decay": {
      "command": "C:\\path\\to\\PyMemoryDecayMCP\\dist\\memory-decay-mcp.exe",
      "args": [],
      "env": {
        "MEMORY_STORAGE_PATH": "C:\\path\\to\\custom\\data\\folder"
      }
    }
  }
}

Configuration

  • MEMORY_STORAGE_PATH: (Optional) Environment variable to set the directory where the vector database and journal file are stored. Defaults to ./data relative to the working directory.

Features

  • Store Memory: Embeds text and stores it in LanceDB.

  • Recall Memory:Retrieves relevant memories based on semantic search, filtered by memory "strength" (decay function).

  • Verify History: An immutable audit log (flat file) to verify facts regardless of memory decay.

Available Tools

3 tools
recall_memoryA

Retrieves memories based on semantic relevance and decay. Successfully recalled memories receive a 'Hebbian boost', refreshing their strength.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses two important behavioral traits: the effect of decay on relevance, and the 'Hebbian boost' that refreshes memory strength upon successful recall. This is a meaningful side effect beyond a simple read. However, it does not describe the output format or any failure modes.

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 sentences: the first front-loads the primary purpose, the second adds a key behavioral detail. There is no redundancy or filler, making it appropriately concise and well-structured.

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

Completeness4/5

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

Given the tool's simplicity (1 param, output schema present), the description is fairly complete. It covers the mechanism and side effects, but stops short of explaining when to use recall_memory versus verify_history. Still, it provides enough context for correct tool selection.

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

Parameters2/5

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

The schema has 0% description coverage for the single 'query' parameter, and the description does not elaborate on what the query should contain or its format. While the description mentions 'semantic relevance', it leaves the query semantics largely implicit, failing to compensate for the schema's lack of detail.

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 retrieves memories based on semantic relevance and decay, using a specific verb ('retrieves') and resource ('memories'). It differentiates itself from sibling tools like store_memory (which writes) and verify_history (which checks history) by focusing on retrieval.

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

Usage Guidelines3/5

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

The description implies that this tool is for recalling memories when you need to retrieve them, but it does not explicitly state when to use it over alternatives or provide exclusion criteria. The context of sibling tools helps, but no direct guidance is given.

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

store_memoryA
Stores a memory with a specific category (episodic, semantic, procedural).
- episodic: Short-term context (logs, current tasks).
- semantic: Facts, preferences, user identity.
- procedural: Code patterns, logic, workflows.
ParametersJSON Schema
NameRequiredDescriptionDefault
contentYes
categoryNoepisodic

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.5/5.0
Behavior2/5

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

No annotations are provided, so the description must carry the full burden of behavioral disclosure. It explains the categories but does not mention persistence, side effects, auth requirements, or return values. For a write operation, this leaves significant behavioral traits undisclosed.

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 concise and well-structured, with the main action stated first followed by a bulleted list of category options. Every sentence adds value, and the format is easy to scan.

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

Completeness3/5

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

Given the tool's simplicity and the presence of an output schema, the description is mostly adequate. It lacks guidance on when to use this tool versus siblings and does not describe what happens after storing, but for a basic store operation the provided category breakdown is a helpful addition.

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

Parameters3/5

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

The schema provides zero description coverage, so the description must compensate. It does clarify the meaning of the 'category' parameter by listing the three allowed values (episodic, semantic, procedural) with examples. However, it does not explain the 'content' parameter beyond its name, leaving one parameter somewhat under-specified.

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 stores a memory, specifying the verb 'Stores' and the resource 'memory'. It further distinguishes the operation from siblings (recall, verify) by the action of storing, and provides category details that make the purpose unambiguous.

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

Usage Guidelines3/5

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

The description gives context for which category to use (episodic, semantic, procedural) but does not explicitly compare this tool with its siblings (recall_memory, verify_history). There are no exclusions or conditions for when not to use this tool, so usage guidance is limited to category selection.

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

verify_historyA

Bypasses decay to search the immutable Archive. Use for audit or when recall fails.

ParametersJSON Schema
NameRequiredDescriptionDefault
keywordYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does provide key behavioral traits: bypasses decay and searches an immutable Archive, reasonably implying a safe read-only operation. It leaves out details like error behavior or exact output, but adds substantive context beyond the schema.

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?

Two sparse sentences, front-loaded with the essential behavior and use case. No wasted words or redundancy with the schema.

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

Completeness4/5

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

For a one-parameter search tool with an output schema, the description covers purpose, use case, and data source adequately. It could mention the scope of the archive or decay semantics, but current level is sufficient.

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

Parameters2/5

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

The sole parameter keyword has 0% schema description coverage, and the description does not add any semantics about acceptable values, matching behavior, or search syntax. More compensation was needed here.

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?

Clearly states it searches the immutable Archive and bypasses decay, using a specific verb and resource. It distinguishes itself from siblings by positioning recall_memory as a different mechanism and this as the archival/audit search.

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?

Explicitly instructs to use for audit or when recall fails, providing clear context. It does not name recall_memory directly, but the sibling list and phrasing imply the alternative and the exclusion of normal recall.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 3 tool updatesv0.1.0
    • First observedrecall_memory
    • First observedstore_memory
    • First observedverify_history

TDQS

A4/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: store_memory writes, recall_memory retrieves with decay, and verify_history accesses the immutable archive. No two tools overlap in functionality.

Naming Consistency5/5

All tool names follow the consistent verb_noun pattern (store_memory, recall_memory, verify_history), making the API predictable and easy to navigate.

Tool Count5/5

With only 3 tools, the server is tightly scoped to its core purpose of memory storage, recall, and archival verification. Each tool earns its place and the count is within the ideal 3-15 range.

Completeness4/5

The core memory lifecycle (store, recall, verify) is covered well, and decay handles forgetting implicitly. However, there is no explicit update or delete operation, which could be considered a minor gap for full lifecycle management.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

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/Wakanlolz/PyMemoryDecayMCP'

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