API Reference
Proactive Intelligence

Proactive Intelligence

Cortex doesn't just store memories - it actively helps you maintain relationships and track commitments. The Proactive API provides nudges, relationship health scores, and smart reminders.

Nudges

Nudges are proactive suggestions from Cortex. They help you:

  • Follow up with people you haven't contacted in a while
  • Complete commitments before they're overdue
  • Maintain important relationships

Get Nudges

const nudges = await cortex.nudges.list();
 
for (const nudge of nudges) {
  console.log(nudge.type);        // "follow_up"
  console.log(nudge.priority);    // "high"
  console.log(nudge.title);       // "Haven't connected with Sarah recently"
  console.log(nudge.message);     // "It's been 32 days since your last interaction"
  console.log(nudge.suggestedAction); // "Send a quick message or schedule a call"
}

Response

{
  "nudges": [
    {
      "id": "nudge_abc",
      "type": "follow_up",
      "priority": "high",
      "title": "Haven't connected with Sarah recently",
      "message": "It's been 32 days since your last interaction with Sarah.",
      "suggestedAction": "Send a quick message or schedule a call with Sarah",
      "entityId": "ent_sarah",
      "entityName": "Sarah",
      "context": {
        "daysSinceContact": 32,
        "healthStatus": "attention_needed"
      },
      "createdAt": "2024-01-22T08:00:00Z"
    },
    {
      "id": "nudge_xyz",
      "type": "commitment_due",
      "priority": "high",
      "title": "Commitment to Mike due tomorrow",
      "message": "\"Review design mockups\" is due tomorrow",
      "suggestedAction": "Complete review and send feedback",
      "entityId": "ent_mike",
      "dueDate": "2024-01-23T17:00:00Z"
    }
  ],
  "total": 5
}

Nudge Types

TypeDescriptionWhen Generated
follow_upHaven't contacted someone in a while30+ days since last interaction
maintenanceRelationship needs attentionHealth score dropping
commitment_dueCommitment deadline approaching2 days before due date
at_riskRelationship at riskHealth score below 0.3
milestoneImportant date coming upBirthdays, anniversaries

Filter Nudges

// Get only high priority nudges
const urgent = await cortex.nudges.list({
  priority: "high"
});
 
// Get nudges for a specific person
const sarahNudges = await cortex.nudges.list({
  entityId: "ent_sarah"
});

Dismiss a Nudge

await cortex.nudges.dismiss("nudge_abc");

Relationship Health

Cortex continuously monitors the health of your relationships based on:

  • Recency - When was your last interaction?
  • Frequency - How often do you interact?
  • Sentiment - Are interactions positive?
  • Commitments - Are you keeping your promises?
  • Engagement - How deep are your conversations?

Get All Relationship Health Scores

const health = await cortex.relationships.health();
 
for (const rel of health) {
  console.log(rel.entityName);      // "Sarah"
  console.log(rel.healthScore);     // 0.65
  console.log(rel.healthStatus);    // "attention_needed"
  console.log(rel.factors.recency); // { score: 0.4, daysSince: 32 }
  console.log(rel.recommendations); // ["Reach out to catch up"]
}

Response

{
  "relationships": [
    {
      "entityId": "ent_sarah",
      "entityName": "Sarah",
      "entityType": "person",
      "healthScore": 0.65,
      "healthStatus": "attention_needed",
      "factors": {
        "recency": {
          "score": 0.4,
          "lastInteractionDate": "2023-12-20T10:00:00Z",
          "daysSince": 32
        },
        "frequency": {
          "score": 0.7,
          "interactionCount": 15,
          "avgDaysBetween": 8
        },
        "sentiment": {
          "score": 0.85,
          "avgSentiment": 0.7,
          "trend": "stable"
        },
        "commitmentHealth": {
          "score": 0.9,
          "pending": 1,
          "completed": 8,
          "completionRate": 0.89
        },
        "engagementDepth": {
          "score": 0.6,
          "avgMemoryLength": 350,
          "topicsDiscussed": 5
        }
      },
      "recommendations": [
        "Reach out to catch up - it's been over a month",
        "Consider scheduling a regular check-in"
      ],
      "riskFactors": [
        "No contact in 32 days"
      ],
      "calculatedAt": "2024-01-22T08:00:00Z"
    }
  ]
}

Health Status

StatusScore RangeMeaning
healthy0.7 - 1.0Relationship is thriving
attention_needed0.5 - 0.7Should reach out soon
at_risk0.3 - 0.5Relationship deteriorating
dormant0 - 0.3No recent meaningful interaction

Get Health for Specific Person

const sarahHealth = await cortex.relationships.healthFor("ent_sarah");
 
console.log(sarahHealth.healthScore);    // 0.65
console.log(sarahHealth.recommendations); // ["Reach out..."]

Key Stakeholders

Get your most important relationships ranked by centrality and importance.

const stakeholders = await cortex.relationships.stakeholders({
  limit: 10
});
 
// Returns people who are most central to your network
for (const person of stakeholders) {
  console.log(person.name, person.importance, person.healthScore);
}

Using Proactive Data

Here's how to build proactive features into your AI:

// Daily briefing
async function generateDailyBriefing() {
  const [nudges, health, commitments] = await Promise.all([
    cortex.nudges.list({ priority: "high" }),
    cortex.relationships.health({ status: "at_risk" }),
    cortex.commitments.list({ status: "pending" })
  ]);
 
  const briefing = `
    Today's priorities:
 
    ${nudges.length} people to follow up with:
    ${nudges.map(n => `- ${n.title}`).join('\n')}
 
    ${health.length} relationships need attention:
    ${health.map(r => `- ${r.entityName}: ${r.recommendations[0]}`).join('\n')}
 
    ${commitments.length} commitments due soon:
    ${commitments.map(c => `- ${c.title} (${c.dueDate})`).join('\n')}
  `;
 
  return briefing;
}

This creates AI assistants that proactively help users maintain their relationships and commitments.