Skip to content

[Mem] one mem linked <identity-key> — query surface for cross-platform joins #131

@moekatib

Description

@moekatib

Problem

Identity keys (#128, #129, #130) are the plumbing. Without an ergonomic query surface, the feature isn't reachable — users fall back to raw `mem sql` with JSONB array operators, which most won't write.

The demo-able moment is: "one email address, one command, records from every connected platform."

Proposed

Add `one mem linked ` — list every mem record whose `keys` array contains the given value, grouped by type.

```bash
$ one mem linked email:jane@acme.com
attio/attioPeople 1 record Jane Smith (Acme Corp)
gmail/threads 14 records most recent: "re: Q2 pricing" 2d ago
google-calendar/events 3 records next: "Jane <> Moe" tomorrow 10am
fathom/meetings 1 record "Acme intro call" 2026-04-10
```

Flags:

  • `--type ` filter to one record type
  • `--limit ` cap per type (default 10)
  • `--agent` JSON output grouped `{ type: [items] }`

Under the hood this is one query: `SELECT * FROM mem_records WHERE keys @> ARRAY[$1]`. The value-add is the grouped rendering and the agent-friendly JSON, not the SQL.

Optional second shape: `one mem linked ` for intersection — records carrying both keys (e.g. "find threads involving BOTH jane@acme.com AND bob@acme.com").

Acceptance

  • `one mem linked email:jane@acme.com` groups results by type, shows count + top N.
  • `one --agent mem linked ...` returns `{ key, total, byType: { : { count, items } } }`.
  • Works across any prefix (`email:`, `domain:`, future `phone:`, etc.) — not hardcoded to email.
  • Documented in `one guide memory` under Cross-Platform Identity.

Blocked on

#128. Useful even before #129/#130 land since Attio-only linking would still work.

Related

Cross-platform identity story. This is the command that makes the feature demo-able. Found during PR #125 testing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions