Skip to content

feat(mcp): add mem_relate tool for observation relations #285

@Alejandro-M-P

Description

@Alejandro-M-P

Pre-flight Checks

  • I have searched existing issues and this is not a duplicate
  • I understand this issue needs status:approved before a PR can be opened

Problem Description

The memory_relations table already exists in the schema (with sync_id, source_id, target_id, relation, etc.) and Go methods exist in internal/store/relations.go. However, there is no MCP tool to create links between related observations. AI agents cannot programmatically relate observations.

Proposed Solution

Create mem_relate MCP tool that wires the existing Go methods. The tool should accept:

  • source_sync_id: sync_id of the source observation
  • target_sync_id: sync_id of the target observation
  • relation: type of relation (e.g., "supersedes", "related", "conflicts_with")
  • reason: optional reason for the relation

The tool should call existing methods like SaveRelation() from internal/store/relations.go.

Affected Area

Other (MCP Server)

Alternatives Considered

None - the infrastructure (table + Go methods) already exists, only the MCP tool is missing. This is a wiring task, not a new feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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