Authentication
Your MemSync API key for authentication
Request Body
Natural language search query (e.g., “What does the user do for work?”)
Maximum number of memories to return (1-100)
Filter results to specific memory categories
Enable reranking for improved search quality (recommended for complex queries)
Include user bio in the response
Filter results to memories from a specific agent
Filter results to memories from a specific conversation thread
Response
Auto-generated biographical summary of the user
Array of relevant memories matching the search query
Query Examples
Basic Queries
Advanced Queries
Understanding Search Results
Vector Distance
Thevector_distance
indicates semantic similarity:
- 0.0-0.3: Highly relevant and closely related
- 0.3-0.6: Moderately relevant
- 0.6-1.0: Less relevant, may be tangentially related
Rerank Score
Whenrerank: true
is enabled, the rerank_score
provides enhanced relevance:
- 0.8-1.0: Excellent match for the query
- 0.6-0.8: Good match with clear relevance
- 0.4-0.6: Fair match, some relevance
- 0.0-0.4: Weak match, limited relevance
Result Ordering
Results are ordered by relevance:- With reranking: Ordered by
rerank_score
(descending) - Without reranking: Ordered by
vector_distance
(ascending)
Best Practices
Query Optimization
Use Natural Language
Use Natural Language
Write queries as natural questions rather than keywords
Be Specific
Be Specific
Specific queries often yield better results than generic ones
Use Categories
Use Categories
Filter by categories for more targeted results
Enable Reranking
Enable Reranking
Use reranking for complex or important queries
Performance Tips
- Appropriate Limits: Use reasonable limits (5-15 for most use cases)
- Category Filtering: Reduce search space with relevant categories
- Caching: Cache frequent queries to improve response times
- Batch Processing: Group related searches when possible
Common Use Cases
Personalized Responses
User Analysis
Content Recommendations
Rate Limiting
Search endpoints have enhanced rate limiting:- 50 requests per minute per authenticated user
- Complex queries with reranking may take slightly longer
- Consider implementing client-side caching for frequent queries
Error Codes
Error Code | Description |
---|---|
VALIDATION_ERROR | Invalid request format or parameters |
AUTHENTICATION_ERROR | Invalid or missing API key |
RATE_LIMIT_EXCEEDED | Too many search requests |
NO_MEMORIES_FOUND | No memories exist for the user |