Skip to content

Trigger-based / contextual memory surfacing #46

@ramonlimaramos

Description

@ramonlimaramos

Problem

recall() is pull-only. The agent has to recognize that a moment calls for recall before doing the work. In practice this means relevant memories get bypassed because the agent isn't pattern-matching at write time.

Example: a feedback/core memory says "never use step-numbering in code comments". The agent writes # 1) validate ... anyway because it didn't query Synapto before editing.

Proposal

Memories can declare triggers that surface them automatically when matching patterns appear in the agent's pending output (file edits, tool calls, planned commits).

trigger:
  match:
    - pattern: "^\\s*#.*PR #\\d+|Greptile P|^\\s*# \\d+\\)"
      kind: regex
      scope: edit  # also: tool_call, commit_message, write
  surface: <memory_id>
  action: warn  # or: block, suggest

Two integration paths:

  1. MCP server emits a surfaced_memories array with each tool response, harness injects them as system reminders before the next agent turn.
  2. PreToolUse hook that calls Synapto with the proposed input and returns blocking errors when a block-action memory matches.

Why this matters

Without this, every Synapto memory is opt-in for the agent. Triggers turn passive memory into active enforcement without forcing the agent to be perfectly disciplined.

Acceptance

  • A memory with a regex trigger surfaces (as a system reminder) when the agent is about to write content matching the regex.
  • Trigger action block prevents the offending tool call.
  • Trigger action warn surfaces the memory but lets the call proceed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions