Skip to content

feat: add custom metadata fields to RememberRequest API #655

Closed

Description

@ajianaz

Summary

The /remember endpoint ignores custom metadata. The RememberRequest struct (main.rs:98-113) only accepts content, tags, namespace, type, valid_from, valid_until, detect_contradiction — no meta, metadata, entity, category, importance, slug, or source fields.

The server builds metadata from only type → metadata["type"], valid_from → metadata["valid_from"], valid_until → metadata["valid_until"]. All custom metadata sent via API is silently discarded.

Meanwhile, the CLI (--meta key:value, --entity) correctly stores custom metadata to the SQLite metadata TEXT column as JSON. So the DB schema fully supports it — only the API is missing.

Root Cause

uteke-server/src/main.rs lines 98-113 (RememberRequest) and 606-620 (metadata builder).

Expected Behavior

POST /remember
{
  "content": "DrawOver launched on Product Hunt",
  "tags": ["drawover", "product-launch"],
  "namespace": "cmo",
  "entity": "drawover-ph-launch",
  "category": "marketing",
  "meta": {"platform": "producthunt", "votes": 42, "url": "https://..."}
}

Should store the full metadata JSON in the metadata column, matching what the CLI does.

Acceptance Criteria

Functional

  • Add entity, category, meta (arbitrary JSON object), importance, slug, source fields to RememberRequest
  • Merge custom fields into the metadata map alongside auto-generated ones (type, valid_from, valid_until)
  • meta field accepts arbitrary JSON object — merged directly into metadata
  • Existing CLI-stored memories with custom metadata are correctly returned by API (no regression)

Verification (CMO can run without reading code)

  • curl POST /remember with {"content":"test","entity":"drawover","meta":{"votes":42}} → returns 200 with metadata containing entity & votes
  • curl POST /recall with {"query":"test","entity":"drawover"} → returns the remembered memory
  • curl POST /remember with entity: "" or meta: null → returns 200, no crash, empty values ignored
  • curl POST /remember with no custom fields → returns 200, behavior identical to before

Tests

  • Unit: remember with custom metadata → recall with entity filter matches
  • Unit: remember with empty meta → recall still works (no null crash)

Priority

High — blocks all structured data use cases (social media tracking, CRM, etc.)

Activity

  1. added
    enhancement
    priority:high
    scope:api
    on Jul 14, 2026
  2. ajianaz commented on Jul 14, 2026

    @ajianaz
    CollaboratorAuthor

    Duplicate of #672 (same scope, newer issue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpriority:highscope:api

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions