Skip to content

Feature Request: Expose tdai_memory_write tool for subagent sessions #66

@MOOSChen1989

Description

@MOOSChen1989

Problem

The memory-tencentdb plugin (v0.3.5) exposes two read/search tools but provides no write tool:

Tool Available
tdai_memory_search Yes
tdai_conversation_search Yes
tdai_memory_write Missing

This creates a one-way memory trap for subagent sessions: subagents can read via tdai_memory_search but have no tool to write memories back. Their write tool targets memory/*.md files which are never captured by L0 auto-capture.

Proposed Solution

Add a tdai_memory_write tool with signature:

{
  "name": "tdai_memory_write",
  "label": "Memory Write",
  "description": "Write a new entry into long-term memory",
  "parameters": {
    "type": "object",
    "properties": {
      "content": { "type": "string", "description": "The memory content to store" },
      "type": { "type": "string", "enum": ["persona", "episodic", "instruction"] },
      "scene_name": { "type": "string" }
    },
    "required": ["content"]
  }
}

Implementation Reference

  • Tool registration pattern: dist/index.mjs line 17044 (api.registerTool for tdai_memory_search)
  • Plugin source root: src/core/tools/
  • write_memory_entries() already exists in plugin exports
  • L1 JSONL schema: {id, content, type, priority, scene_name, source_message_ids, metadata, timestamps, createdAt, updatedAt, sessionKey, sessionId}

Why This Matters

Essential for multi-agent systems where subagents need bidirectional memory access. Currently subagents are second-class memory citizens — they can read but cannot contribute.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions