Profile Update Policies

Understanding how and when profiles are updated with new conversation data

Update Control

Profile update policies give you control over when and how your profiles are updated with new conversation data. This allows you to optimize performance and ensure data freshness.

Automatic Updates

Profiles can be automatically updated when new conversation data is added. This ensures your context database is always current and ready for queries.

When to Use

  • • Real-time applications
  • • When immediate context is needed
  • • Low-volume conversation data
  • • Interactive chat applications

Considerations

  • • Higher processing overhead
  • • May impact response times
  • • Good for small to medium datasets
  • • Ensures data freshness
Example: Automatic Update
curl -X POST "https://api.ontbo.com/api/tests/profiles/user123/scenes/conv1/text?update_now=true" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "role": "user",
      "content": "I love Italian food",
      "timestamp": 1731964920
    }
  ]'

Manual Updates

Control when profile updates occur for better performance management. This approach allows you to batch updates and optimize processing resources.

When to Use

  • • High-volume data processing
  • • Batch processing workflows
  • • Performance optimization
  • • Scheduled updates

Considerations

  • • Better performance control
  • • Can batch multiple updates
  • • Requires manual trigger
  • • Good for large datasets

1. Add Data Without Update

Add conversation data
curl -X POST "https://api.ontbo.com/api/tests/profiles/user123/scenes/conv1/text" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{"role": "user", "content": "I prefer dark mode", "timestamp": 1731964920}]'

2. Trigger Manual Update

Run profile update
curl -X PUT "https://api.ontbo.com/api/tests/profiles/user123/update/run" \
  -H "Authorization: Bearer YOUR_API_KEY"

Update Status Monitoring

Status Types

IDLE

The profile is not currently being updated. All data is processed and ready for queries.

WORKING

The profile is currently being updated. Progress is tracked from 0.0 to 100.0.

Monitoring Commands

Check Update Status

GET /profiles/{profile_id}/update/status
curl -X GET "https://api.ontbo.com/api/tests/profiles/user123/update/status" \
  -H "Authorization: Bearer YOUR_API_KEY"
Response:
{
  "status": "WORKING",
  "progress": 75.5
}

Stop Update Process

PUT /profiles/{profile_id}/update/stop
curl -X PUT "https://api.ontbo.com/api/tests/profiles/user123/update/stop" \
  -H "Authorization: Bearer YOUR_API_KEY"

Wait for Result

When using automatic updates, you can choose to wait for the update to complete before receiving a response. This ensures the profile is fully updated when you get the result.

With Wait

  • • Waits for update completion
  • • Returns updated profile state
  • • Longer response time
  • • Guaranteed fresh data

Without Wait

  • • Returns immediately
  • • Update runs in background
  • • Faster response time
  • • Check status separately
Example: Wait for Update Completion
curl -X POST "https://api.ontbo.com/api/tests/profiles/user123/scenes/conv1/text?update_now=true&wait_for_result=true" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{"role": "user", "content": "I love pizza", "timestamp": 1731964920}]'

Best Practices

Update Strategy

  • • Use automatic updates for real-time apps
  • • Use manual updates for batch processing
  • • Monitor update status for long-running processes
  • • Set appropriate timeouts for your use case

Performance Tips

  • • Batch multiple conversations before updating
  • • Use wait_for_result sparingly
  • • Monitor progress for large updates
  • • Stop updates if they're taking too long

Next Steps

Now that you understand profile update policies, explore the interactive API documentation to see these concepts in action.