Skip to main content

Preference Graph

At the heart of PrefID is the Preference Graph — a structured representation of user preferences across multiple domains.

Domains

Preferences are organized into domains — logical groupings that represent different aspects of user identity.
Musical tastes, favorite artists, genres, streaming habits, and mood-based listening patterns.Signals: Spotify listening history, explicit preferences, concert attendance
Dietary restrictions, favorite cuisines, allergies, cooking preferences, and restaurant favorites.Signals: Order history, explicit preferences, restaurant reviews
Travel style, preferred airlines/hotels, destination preferences, and booking patterns.Signals: Booking history, travel reviews, explicit preferences
Programming languages, frameworks, editor preferences, and coding style.Signals: GitHub activity, explicit preferences, project analysis
Investment style, risk tolerance, and financial preferences.Signals: Explicit preferences, risk assessments
Name, communication style, interests, and general preferences.Signals: User-provided information, behavioral analysis

Atoms

Atoms are the smallest unit of preference data. Each atom represents a single preference signal.
{
  "atom_id": "atom_abc123",
  "domain": "music_preferences",
  "key": "favorite_artist",
  "value": "AR Rahman",
  "confidence": 0.95,
  "source": "spotify_history",
  "created_at": "2024-12-19T10:00:00Z"
}

Atom Properties

PropertyDescription
atom_idUnique identifier for the atom
domainThe domain this atom belongs to
keyThe preference key (e.g., “favorite_artist”)
valueThe preference value
confidenceConfidence score (0.0 - 1.0)
sourceWhere this preference was learned from

Agent Hints

Agent Hints are structured prompts generated from the preference graph, designed to be injected into AI context.
{
  "hints": [
    "User loves AR Rahman and Indian classical music",
    "Prefers vegetarian food, allergic to peanuts",
    "Likes window seats on flights"
  ],
  "domains_used": ["music_preferences", "food_profile", "travel_profile"],
  "token_count": 45
}
Use agent hints instead of raw preferences for better AI context injection. They’re optimized for token efficiency.

Scopes

OAuth scopes control what data applications can access:
ScopeAccess
preferences:readRead all preferences
preferences:writeWrite preferences
music_preferencesRead music domain only
food_profileRead food domain only
travel_profileRead travel domain only
coding_profileRead coding domain only
agent_hintsAccess agent hints endpoint

Semantic Firewall™

The Semantic Firewall protects user preferences from unauthorized access and ensures data quality:
1

Input Validation

All preference updates are validated against domain schemas
2

Scope Enforcement

Applications can only access scopes the user granted
3

Audit Logging

All access is logged for user transparency
4

User Corrections

Users can suppress incorrect preferences via “This Doesn’t Fit Me”

Architecture Overview