Skip to content

Add batch endpoint for memories (HTTP + MCP + CLI) #53

Closed

Description

@savioruz

Summary

Adding multiple memories currently requires one HTTP call / MCP tool call per
memory (N subprocess spawns for N memories). This is slow and rate-limit-prone.
Add a batch add endpoint so N memories can be inserted in a single call.

Proposal

  • HTTP: POST /api/memories/batch
    body: { "memories": [ {"content": "...", "metadata": {...}}, ... ] }
    response: { "result": { "status": "success", "added": N, "memory_ids": [...] } }
  • MCP: add_memory accepts either content (string, single) OR memories
    (array, batch) — backward compatible.
  • CLI: memayu add --batch file.jsonl (or pipe jsonl via stdin)

Acceptance criteria

  • Single call inserts N memories with one embedding round-trip.
  • MCP add_memory supports array argument.
  • CLI --batch supports jsonl file + stdin.
  • Errors are per-item (one bad memory doesn't fail the whole batch).

Activity

  1. added this to the v0.1.0 milestone on Aug 15, 2026
  2. added
    enhancementNew feature or request
    corememayu-core domain logic
    apiHTTP API transport/handlers
    priority-mediumMedium priority — important but not blocking
    on Aug 15, 2026
  3. savioruz commented on Aug 16, 2026

    @savioruz
    OwnerAuthor

    Implemented by PR #59 — batch memory endpoint: POST /api/memories/batch (HTTP), memories[] array in the MCP add_memory tool, and CLI add --batch. Per-item failures are reported per-index (no whole-batch abort); HTTP 200 with errors[]; backward compatible (single-add unchanged). No DB schema change. CI green. Reviewed by g3333kbot: APPROVED.

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

    apiHTTP API transport/handlerscorememayu-core domain logicenhancementNew feature or requestpriority-mediumMedium priority — important but not blocking

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions