Skip to content

[upstream PR 7] feat: agentmemory v0.4.0 — MCP resources, prompts, enrichment, confidence #908

@wbugitlab1

Description

@wbugitlab1

Source repository: rohitg00/agentmemory
Source pull request number: 7
Source URL: intentionally omitted to avoid GitHub cross-references
Title: feat: agentmemory v0.4.0 — MCP resources, prompts, enrichment, confidence
Author: rohitg00
State: closed
Draft: no
Merged: yes
Head: rohitg00/agentmemory:feat/v0.4.0-mcp-resources-enrichment @ 0492682
Base: main @ 1333118
Labels: (none)
Changed files: 0
Commits: 0
Created: 2026-02-28T09:51:45Z
Updated: 2026-02-28T10:28:35Z
Closed: 2026-02-28T10:28:32Z
Merged at: 2026-02-28T10:28:32Z

Original PR body:

Summary

Closes 4 feature gaps identified from GitNexus competitive analysis:

  • MCP Resources (4): agentmemory://status, agentmemory://project/{name}/profile, agentmemory://project/{name}/recent, agentmemory://memories/latest
  • MCP Prompts (3): recall_context(task_description), session_handoff(session_id), detect_patterns(project?)
  • Confidence-scored relations: Auto-computed from co-occurrence (+0.1/shared session, max +0.3), recency (+/-0.1), and relation type (+0.1 supersedes, -0.05 contradicts). Explicit override supported. minConfidence filter + confidence-desc sorting on mem::get-related
  • Unified enrichment: mem::enrich aggregates file context + relevant observations + bug memories into <agentmemory-relevant-context> / <agentmemory-past-errors> XML blocks. PreToolUse hook now calls /agentmemory/enrich with search term extraction from Grep/Glob patterns

Files changed (13)

  • src/types.tsconfidence?: number on MemoryRelation
  • src/functions/relations.ts — confidence scoring + minConfidence filter
  • src/functions/enrich.tsnew enrichment function
  • src/mcp/server.ts — 4 resources + 3 prompts endpoints
  • src/triggers/api.tsPOST /agentmemory/enrich + version bump
  • src/hooks/pre-tool-use.ts — switch to enrich endpoint
  • src/index.ts — wire up enrich, version bump
  • package.json — 0.3.0 → 0.4.0
  • 4 new test files (27 tests)

Test plan

  • npm test — 171 tests passing (144 existing + 27 new)
  • npm run build — clean build, no TS errors
  • Manual: curl GET /agentmemory/mcp/resources → 4 resources listed
  • Manual: curl POST /agentmemory/mcp/resources/read with agentmemory://status → JSON counts
  • Manual: curl POST /agentmemory/mcp/prompts/get with recall_context → messages array
  • Manual: curl POST /agentmemory/enrich → enriched context string

Summary by CodeRabbit

  • New Features

    • Enrichment capability to aggregate file context, observations, and relevant past errors for improved processing.
    • Confidence scoring for memory relations, exposed for filtering and ordering results.
    • New resources and prompts endpoints for discovery and helper prompts.
    • Public API endpoint to request enrichment.
  • Tests

    • Added comprehensive tests for enrichment, confidence scoring, MCP prompts, and MCP resources.
  • Chores

    • Bumped package version to 0.4.0.

Local branch:
Fork PR:
Fork decision:
Verification:
Notes:

Metadata

Metadata

Assignees

No one assigned

    Labels

    decision-candidateFork decision has not been madeupstream-mergedUpstream pull request is merged upstreamupstream-prTracks an upstream pull request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions