Skip to content

Return metadata fields in recall responses by default #111

@jack-arturo

Description

@jack-arturo

Problem

When recalling memories, custom metadata fields stored via store_memory are not returned in any response format (text, items, detailed, or json). This makes metadata effectively write-only — you can store it but never see it.

Currently, detailed recall returns:

  • ID, Type, Created timestamp, Importance, Confidence, Tags, Score, Match reason

What's missing:

  • ❌ Custom metadata fields (e.g. created_by, model, task, topic)
  • updated_at / last_accessed
  • ❌ Any indication that metadata was stored at all

Why It Matters

As multi-agent setups grow (multiple agents writing to the same memory graph), provenance becomes critical. Knowing which agent or which model stored a memory is important for auditing, debugging, and trust scoring. But that's only useful if the data surfaces on recall.

This also blocks any future consolidation work that wants to preserve source_agents[] arrays or merge provenance across memories.

Proposed Fix

Surface a metadata block in recall responses — at minimum in detailed and json formats. Example:

{
  "id": "abc123",
  "type": "Decision",
  "content": "...",
  "importance": 0.9,
  "tags": ["autohub", "2026-03"],
  "metadata": {
    "created_by": "hub-developer",
    "model": "claude-sonnet-4.6",
    "task": "PR review automation",
    "topic": "AutoHub architecture"
  },
  "created_at": "2026-03-05T...",
  "updated_at": "2026-03-05T..."
}

updated_at and last_accessed should also be included while we're at it.

Acceptance Criteria

  • detailed format returns full metadata object
  • json format returns full metadata object
  • updated_at and last_accessed timestamps included in responses
  • Backwards compatible (memories without metadata return empty {} or omit the field)
  • Test coverage for metadata round-trip (store → recall → verify fields present)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions