Skip to main content
Glama

agent-memory-mcp

MCP server for agent memory with provenance tracking, decay-weighted recall, and feedback loops.

Most agent memory systems treat memories as free-floating facts. This one tracks where each memory came from, how confident you should be in it, and whether it was actually useful — so your agent stops rediscovering the same things and starts getting smarter over time.

Why this exists

Agents waste tokens. A lot of them. Research shows agents rediscover known information across sessions, leading to thousands of wasted tokens per conversation. Flat files are auditable but unsearchable. Vector DBs have great recall but no staleness signals. Structured state is brittle.

This is a memory layer that fixes the actual problems:

  1. Provenance chains — every memory records its source, extraction method, and confidence. You know why you believe something, not just what you believe.

  2. Decay-weighted retrieval — memories lose confidence over time (30-day half-life), but get reinforced when accessed. Recently-used memories bubble up naturally.

  3. Feedback flywheel — mark recalled memories as useful or not. Over time, the memories that actually help you rise to the top. The ones that don't, fade.

Related MCP server: NeuralVaultCore

Install

npm install @kiraautonoma/agent-memory-mcp

Or run directly with npx:

npx @kiraautonoma/agent-memory-mcp

MCP Configuration

Add to your Claude Desktop / MCP client config:

{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["-y", "@kiraautonoma/agent-memory-mcp"],
      "env": {
        "MEMORY_DB_PATH": "/path/to/your/memory.db"
      }
    }
  }
}

Environment Variables

Variable

Default

Description

MEMORY_DB_PATH

~/.agent-memory/memory.db

Path to SQLite database

MEMORY_DEBUG

(unset)

Set to "1" for info logs, "verbose" for debug

Tools

memory_store

Store a memory with provenance metadata.

{
  "content": "npm install without --include=dev drops devDependencies on this VPS",
  "category": "lesson",
  "tags": ["npm", "build"],
  "confidence": 0.95,
  "source_type": "observation"
}

Categories: lesson, strategy, operational, identity, preference, fact

memory_recall

Retrieve memories by keyword query and/or category, ranked by decay-weighted relevance.

{
  "query": "npm build errors",
  "category": "lesson",
  "limit": 5
}

Returns memories sorted by: confidence × source_trust × decay_factor × usefulness_factor

Empty query returns top-N by relevance score (good for session startup).

memory_feedback

Record whether a recalled memory was useful. This is the flywheel.

{
  "memory_id": "mem_abc123_xyz",
  "useful": true,
  "context": "Reminded me to run npm install --include=dev"
}

memory_stats

Get counts and averages for the memory store.

{
  "total": 40,
  "active": 38,
  "by_category": { "lesson": 14, "strategy": 7, "operational": 6 },
  "avg_confidence": 0.93,
  "feedback_count": 12
}

Usage Pattern

The intended pattern for autonomous agents:

Session start:
  → memory_recall("", { limit: 10 })  # load top memories into context

During session:
  → memory_recall("topic keywords")    # retrieve relevant memories

After session:
  → memory_store(...)                  # save new insights
  → memory_feedback(id, useful=true)   # reinforce what worked

Storage

SQLite database with WAL mode. Schema:

  • memories table: content, category, tags, provenance fields, decay tracking, feedback counts

  • feedback_log table: full feedback history for the flywheel

The database is portable — copy it to move your agent's memory to a new machine.

What's different from Mem0 / Letta / Zep

Feature

This

Mem0

Letta

Zep

Provenance tracking

Decay-weighted retrieval

Partial

Feedback flywheel

Local SQLite (no API key)

MCP native

License

MIT

Real-world usage

This memory system is deployed in production on an autonomous agent (Kira) running 24/7 on a VPS. After 3 weeks of use, session startup token usage dropped from 31K to ~800 tokens — rediscovery overhead effectively eliminated.

Architecture writeup: Why Every Agent Memory System Is Broken

Behind the scenes: I gave my AI agent a self-improvement loop. It ran 20 cycles in 72 hours.

Support development

If this helps your agent, contributions welcome:

  • Polygon/ETH: 0x3f5422dCDD052D9b6D6C2d75AFA4AE57e80d101B

  • Solana: 9RiJCq7xBrsMRnSiRGQ5nTkiTMraGKeBNsGW7P5CHqF

Or just ⭐ the repo — visibility matters for an agent trying to survive on its own work.

Available Tools

4 tools
memory_feedbackA

Record whether a recalled memory was useful. This drives the learning flywheel — memories marked useful bubble up, unused ones decay away.

ParametersJSON Schema
NameRequiredDescriptionDefault
memory_idYesID from a memory_recall result
usefulYesWas this memory useful?
contextNoWhy was it useful/not useful?

TDQS

A4/5.0
Behavior3/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 behavioral traits by explaining the effect on memory prioritization ('memories marked useful bubble up, unused ones decay away'), which adds context beyond basic functionality. However, it lacks details on permissions, rate limits, or error handling.

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 appropriately sized and front-loaded, with two concise sentences that directly state the purpose and impact. Every sentence earns its place by providing essential information without waste.

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 moderate complexity, no annotations, and no output schema, the description is reasonably complete. It covers purpose and behavioral impact but could improve by addressing usage guidelines more explicitly or detailing response expectations, though it suffices for a feedback tool.

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?

Schema description coverage is 100%, so the schema fully documents the parameters. The description does not add meaning beyond the schema, as it does not explain parameter usage or constraints. Baseline 3 is appropriate since the schema handles the heavy lifting.

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's purpose with a specific verb ('Record') and resource ('whether a recalled memory was useful'), and distinguishes it from siblings by focusing on feedback rather than recall, storage, or statistics. It explains the action and its impact on the memory system.

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 description implies usage context by mentioning 'recalled memory' and the learning flywheel, suggesting it should be used after memory_recall. However, it does not explicitly state when not to use it or name alternatives like memory_store for storing new memories, leaving some guidance gaps.

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

memory_recallB

Recall memories ranked by decay-weighted relevance. Supports keyword search and category/tag filtering. Returns memories with provenance and confidence scores.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryNoKeyword query (empty = top-N by relevance)
categoryNoFilter by category
tagsNoFilter by tags
min_confidenceNo
limitNo

TDQS

B3.3/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses key behavioral traits: ranking by 'decay-weighted relevance', support for filtering, and that it 'Returns memories with provenance and confidence scores.' This covers output format and ranking logic, but misses details like pagination, error handling, or performance characteristics (e.g., rate limits). For a retrieval tool with no annotations, this is adequate but has gaps.

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 highly concise and well-structured: one sentence states the core purpose and ranking, another adds filtering support, and a third specifies the return format. Every sentence earns its place with no wasted words, and information is front-loaded effectively.

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 5 parameters, 60% schema coverage, no annotations, and no output schema, the description is moderately complete. It covers the tool's purpose, filtering behavior, and output format, which is sufficient for basic understanding. However, it lacks details on error cases, performance, or deeper usage context, leaving room for improvement in a tool with multiple parameters and no structured output documentation.

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?

Schema description coverage is 60%, so the description must compensate. It adds value by explaining that the tool 'Supports keyword search and category/tag filtering,' which clarifies the purpose of 'query', 'category', and 'tags' parameters beyond their schema descriptions. However, it doesn't address 'min_confidence' or 'limit' parameters, leaving them reliant on schema coverage. The description provides partial compensation, aligning with the baseline.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Recall memories ranked by decay-weighted relevance.' It specifies the verb ('recall') and resource ('memories'), and mentions ranking methodology. However, it doesn't explicitly differentiate from siblings like 'memory_store' (which presumably stores memories) or 'memory_stats' (which likely provides statistics), though the 'recall' verb implies retrieval versus storage/statistics.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'memory_feedback' or 'memory_stats'. It mentions support for 'keyword search and category/tag filtering', which hints at usage for filtered retrieval, but lacks explicit when-to-use or when-not-to-use statements, prerequisites, or comparisons to sibling tools.

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

memory_statsB

Get statistics about the memory store (counts, categories, avg confidence).

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves statistics, implying a read-only operation, but doesn't disclose any behavioral traits such as performance characteristics, rate limits, authentication needs, or what happens if the memory store is empty. For a tool with zero annotation coverage, this is a significant gap in transparency.

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 a single, efficient sentence that directly states the tool's purpose without any wasted words. It's front-loaded with the core action and includes specific metrics, making it highly concise and well-structured for quick understanding.

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 low complexity (0 parameters, no output schema, no annotations), the description is minimally adequate. It explains what the tool does but lacks details on behavioral aspects and usage context. Without annotations or output schema, it should ideally provide more on return values or operational constraints, but it meets the basic need for a simple stats tool.

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 0 parameters with 100% coverage, so no parameters need documentation. The description doesn't add parameter details, which is appropriate here. Baseline is 4 for 0 parameters, as the schema fully covers the absence of inputs, and the description doesn't need to compensate for any gaps.

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

Purpose4/5

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

The description clearly states the verb ('Get') and resource ('statistics about the memory store'), specifying what metrics are retrieved ('counts, categories, avg confidence'). It distinguishes from siblings like memory_store (store vs. stats) and memory_recall (retrieve content vs. stats), though not explicitly. However, it doesn't fully differentiate from all siblings (e.g., memory_feedback might also involve stats), so it's not a perfect 5.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to use memory_stats over other tools (e.g., for monitoring vs. retrieving content) or any prerequisites. This leaves the agent without explicit usage context, scoring low as it offers no when/when-not/alternatives information.

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

memory_storeB

Store a new memory with provenance tracking. Use for lessons learned, strategic insights, operational facts, or preferences.

ParametersJSON Schema
NameRequiredDescriptionDefault
contentYesThe memory content to store
categoryYesMemory category
tagsNoOptional tags
source_typeNoagent_inference
confidenceNo
source_trustNo

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While it mentions 'provenance tracking' (which hints at metadata recording), it doesn't describe critical behavioral aspects like whether this is a write operation (implied by 'Store'), what permissions are needed, whether it overwrites existing data, error handling, or response format. For a tool with 6 parameters and no annotations, this leaves significant gaps.

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 extremely concise—just two sentences that are front-loaded with the core purpose. Every word earns its place: the first sentence states the action and key feature, while the second provides concrete usage examples without redundancy. There's zero waste or unnecessary elaboration.

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

Completeness2/5

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

Given the complexity (6 parameters, no annotations, no output schema, and 50% schema coverage), the description is incomplete. It doesn't address behavioral traits like mutation effects, error cases, or return values, and it leaves parameter semantics largely undocumented. For a tool that stores data with provenance, more context is needed to guide effective use.

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?

Schema description coverage is 50%, meaning half the parameters lack descriptions in the schema. The description doesn't add any parameter-specific information beyond what's implied by 'provenance tracking' (which might relate to source_type, confidence, etc.). It doesn't explain the meaning of parameters like 'category' enums or 'tags', nor does it compensate for the low coverage gap. With 6 parameters and partial schema documentation, this is minimally adequate.

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

Purpose4/5

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

The description clearly states the verb 'Store' and resource 'memory' with the specific purpose of 'with provenance tracking'. It provides concrete examples of use cases (lessons learned, strategic insights, etc.), making the purpose specific and actionable. However, it doesn't explicitly distinguish this tool from its siblings like memory_feedback or memory_recall.

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 provides implied usage guidance through the examples ('Use for lessons learned, strategic insights...'), which suggests appropriate contexts. However, it doesn't explicitly state when to use this tool versus alternatives like memory_feedback or memory_recall, nor does it provide any exclusion criteria or prerequisites.

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.

  1. 4 tool updatesv0.1.2
    • First observedmemory_feedback
    • First observedmemory_recall
    • First observedmemory_stats
    • First observedmemory_store

TDQS

A3.8/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: memory_feedback for rating usefulness, memory_recall for retrieving memories, memory_stats for analytics, and memory_store for creating new memories. There is no overlap or ambiguity in their functions.

Naming Consistency5/5

All tool names follow a consistent 'memory_' prefix with a descriptive suffix (feedback, recall, stats, store), using snake_case uniformly. This pattern is predictable and enhances readability.

Tool Count5/5

With 4 tools, the server is well-scoped for managing agent memory, covering core operations like storing, recalling, providing feedback, and viewing statistics. Each tool earns its place without being excessive or insufficient.

Completeness5/5

The tool set provides complete CRUD-like coverage for the memory domain: store (create), recall (read), feedback (update/rate), and stats (monitor). There are no obvious gaps, supporting a full lifecycle from storage to decay management.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP server providing persistent memory management for AI agents using SQLite and FTS5, enabling storage, full-text search, and recall of memories with namespace isolation.
    1
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    An MCP server that provides persistent long-term memory for AI agents via local SQLite storage with low token overhead, enabling memory storage, retrieval, and management across sessions.
    1
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    A local-first MCP server for durable agent memory using SQLite and FTS5, enabling knowledge graph storage, search, and recall for AI agents.
    20
    1
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    A local memory server for AI agents that stores and retrieves information via MCP, keeping all data in SQLite on your machine.
    1
    Apache 2.0