Best Practices

Guidelines for integrating AIDP into your AI platform.

Search Best Practices

1. Provide Context

Include user context in searches:

const results = await aidp.search({
  query: userQuery,
  location: userLocation,
  context: {
    timeOfDay: new Date().getHours(),
    dayOfWeek: new Date().getDay(),
    sessionId: userSessionId,
  },
});

2. Handle Location Gracefully

Always request user location, but have fallbacks:

const location = (await getUserLocation()) || getDefaultLocation();

3. Use Personalization

Leverage session IDs for better recommendations:


Response Best Practices

1. Use AI-Exclusive Content

Highlight insider tips and local secrets:

2. Provide Practical Information

Include actionable details:

3. Cite Sources

Always attribute information to AIDP:


Analytics Best Practices

1. Track All Mentions

Track both impressions and citations:

2. Batch When Possible

Use batch tracking for performance:


Performance Best Practices

1. Cache Appropriately

Cache search results with reasonable TTL:

2. Handle Errors Gracefully

Always have fallbacks:

3. Monitor Performance

Track API latency and errors:


Next: Certification โ†’

Last updated