Query Performance Spectrum
The Ontbo API offers four retrieval modes, each optimized for different use cases. Choose the right mode based on your needs for speed, accuracy, and comprehensiveness.
FULL_DATA
Performs an extensive search on all profile facts. This mode provides the most comprehensive and accurate results but may take longer to process.
Best For
- • Comprehensive analysis
- • Complex multi-faceted queries
- • When accuracy is critical
- • Background processing
Considerations
- • Higher latency
- • More resource intensive
- • May timeout on large datasets
- • Best for non-real-time use
curl -X GET "https://api.ontbo.com/api/tests/profiles/user123/facts/query?query=What are all the user's preferences and behaviors?&query_type=FULL_DATA" \ -H "Authorization: Bearer YOUR_API_KEY"
MULTI_HOP
Makes multiple sub-queries to answer complex questions. This mode provides a good balance between accuracy and performance for most use cases.
Best For
- • Complex reasoning tasks
- • Multi-step queries
- • General-purpose applications
- • When you need good accuracy
Considerations
- • Moderate latency
- • Good balance of features
- • Handles complex queries well
- • Suitable for most applications
curl -X GET "https://api.ontbo.com/api/tests/profiles/user123/facts/query?query=How do the user's preferences relate to their past decisions?&query_type=MULTI_HOP" \ -H "Authorization: Bearer YOUR_API_KEY"
SINGLE_HOP
Simple call to the facts database. This is the fastest option for straightforward queries that don't require complex reasoning.
Best For
- • Simple fact retrieval
- • Real-time applications
- • Direct information lookup
- • High-frequency queries
Considerations
- • Limited to direct matches
- • May miss related information
- • Best for specific queries
- • Fastest response time
curl -X GET "https://api.ontbo.com/api/tests/profiles/user123/facts/query?query=What is the user's favorite color?&query_type=SINGLE_HOP" \ -H "Authorization: Bearer YOUR_API_KEY"
VECTOR_SEARCH
Uses embeddings to find semantically similar content. This is the fastest option and great for finding conceptually related information.
Best For
- • Semantic similarity search
- • Real-time applications
- • Finding related concepts
- • High-performance queries
Considerations
- • May return conceptually similar but not exact matches
- • Great for discovery and exploration
- • Fastest response time
- • Good for fuzzy matching
curl -X GET "https://api.ontbo.com/api/tests/profiles/user123/facts/query?query=Find information about user interface preferences&query_type=VECTOR_SEARCH" \ -H "Authorization: Bearer YOUR_API_KEY"
Performance Comparison
| Mode | Speed | Accuracy | Use Case |
|---|---|---|---|
| VECTOR_SEARCH | Fastest | Good | Semantic similarity |
| SINGLE_HOP | Fast | Good | Direct fact lookup |
| MULTI_HOP | Medium | Very Good | Complex reasoning |
| FULL_DATA | Slowest | Best | Comprehensive analysis |
Best Practices
Choosing the Right Mode
- • Use VECTOR_SEARCH for real-time semantic queries
- • Use SINGLE_HOP for direct fact retrieval
- • Use MULTI_HOP for complex reasoning tasks
- • Use FULL_DATA for comprehensive analysis
Performance Tips
- • Start with faster modes and escalate if needed
- • Cache results for frequently accessed data
- • Use appropriate timeouts for each mode
- • Monitor query performance and adjust
Next Steps
Now that you understand retrieval modes, learn about profile update policies to optimize your data processing workflow.