---
title: Suggest relationships and pick predicates
description: Use a recording’s Creation Profile to choose a predicate, check a target classification, and prepare an ordered relationship for review.
url: https://docs.intuition.systems/docs/build/suggest-relationships
markdown_url: https://docs.intuition.systems/docs/build/suggest-relationships.md
version: V2
llms_index: https://docs.intuition.systems/llms.txt
kind: how-to
reader:
  - app
packages:
  - '@0xintuition/predicates@0.1.1'
  - '@0xintuition/classifications@0.1.1'
---

Build a relationship picker that proposes a recording’s artist using the Creation Profile and the predicate registry.

**Prompt for your agent:** Propose relationships for a person to review

```text
Goal: suggest relationships for a recording and present them for a person to review.
Read https://docs.intuition.systems/docs/build/suggest-relationships.md, https://docs.intuition.systems/docs/concepts/predicates.md and https://docs.intuition.systems/docs/reference/predicates.md.
Use exact package versions from https://docs.intuition.systems/intuition-release.json and public entry points only.
Input: a recording atom ID and candidate target atoms whose classifications my app has already checked.
Use the recording Creation Profile to choose the relationship, and resolve its predicate from the registry.
Reject a target whose classification does not fit the relationship, and say why.
Output each proposal as subject, predicate and object IDs in order, with its triple ID, labeled as a proposal.
Do not create triples or send transactions.
Report the checks you actually ran and anything you could not verify.
```

## Before you start

Start with a recording atom ID and a candidate target atom whose classification your application has checked. The example derives both IDs from synthetic payloads. Read [classifications](https://docs.intuition.systems/docs/concepts/classifications) and [predicates](https://docs.intuition.systems/docs/concepts/predicates).

For your own project, follow [Install the packages](https://docs.intuition.systems/docs/build/install). To run the [offline example](https://github.com/0xIntuition/intuition-docs/blob/c3b1eaa91a822bb59b20cb6de2bc9b874a00b7b0/examples/v2/predicate-picker/src/suggest-relationships.ts), install its locked dependencies from the documentation repository root with Node.js 22.21.0.

```sh
npm ci --prefix examples/v2 --ignore-scripts
```

## Steps

### 1. Read the recording’s recommendations

Look up the selected key in `musicRecordingCreationProfile.relationships`. Each entry describes the subject classification, predicate and expected objects. For `byArtist`, the recording is the subject. An artist goes in the object slot. A picker can display the predicate label and suggest targets classified as a music group or a person.

### 2. Check the target and resolve the predicate

This picker handles classification hints. It omits a recommendation when the key is absent or the candidate’s classification falls outside those hints. After checking the target, resolve the profile’s predicate ID through the registry and keep the registered spelling, ID and status together.

```ts
import { musicRecordingCreationProfile } from '@0xintuition/classifications/creation/music-recording';
import { getPredicateById, getPredicateId } from '@0xintuition/predicates';
import type { Hex } from 'viem';

export function suggestRelationship(
  recordingId: Hex,
  key: string,
  target: { id: Hex; classification: string },
) {
  const relation = musicRecordingCreationProfile.relationships.find(
    (entry) => entry.predicate.key === key,
  );
  if (!relation) return { reason: 'No profile recommendation' };
  const allowed = relation.expectedObjects.some(
    (hint) =>
      hint.kind === 'classification' && hint.slug === target.classification,
  );
  if (!allowed)
    return { reason: 'Target falls outside the recommended classifications' };
  const predicate = getPredicateById(relation.predicate.id);
  if (!predicate || predicate.key !== key)
    return { reason: 'Unknown predicate' };
  return {
    subjectId: recordingId,
    predicateId: getPredicateId(predicate.key),
    objectId: target.id,
    label: predicate.name,
    status: predicate.status,
  };
}
```

### 3. Present the proposed relationship

Display the recording, “by artist,” and the selected group for review. The registry’s `proposed` status describes the predicate vocabulary. The application still needs to verify that this particular group performed this recording and that the terms exist before it submits a claim.

## Check the result

```sh
node examples/v2/predicate-picker/src/suggest-relationships.ts
```

For the group, the helper prints the recording ID as subject, the group ID as object, the label `by artist`, and status `proposed`. The predicate ID is `0x13d5d4ad6ae3a4e1b5043141b6ce4633c2df4646eaefc9e45eba899c45ce235b`. The album yields “Target falls outside the recommended classifications.” An empty key yields “No profile recommendation.”

## Related

[Build creation forms](https://docs.intuition.systems/docs/build/creation-profiles), [recording relationship definitions](https://github.com/0xIntuition/packages/blob/ccae0f0d0277cddd8490b72c49d3771866e7ffea/packages/classifications/src/metadata-predicate-matrix.ts), and [predicate registry lookups](https://github.com/0xIntuition/packages/blob/ccae0f0d0277cddd8490b72c49d3771866e7ffea/packages/predicates/src/predicates.ts).

Applies to V2 · `@0xintuition/predicates` 0.1.1 · `@0xintuition/classifications` 0.1.1
