API Reference
Base Endpoint
POST http://localhost:3000/api/queryRequest Format
Basic Request
{
"query": "What did we discuss about the API refactor?",
"mode": "mix"
}Full Request
{
"query": "What did we discuss about the API refactor?",
"mode": "mix",
"top_k": 60,
"chunk_top_k": 20,
"score_threshold": 0.5,
"disable_rerank": false,
"source": "slack",
"record_types": ["message", "thread"],
"date_range": {
"start": "2024-01-01",
"end": "2024-01-31"
},
"entity_limit": 10,
"metadata": {
"user_id": "user_123",
"session_id": "session_456"
}
}Parameters
Required Parameters
query (string)
query (string)Optional Parameters
mode (string)
mode (string)top_k (number)
top_k (number)chunk_top_k (number)
chunk_top_k (number)score_threshold (number)
score_threshold (number)disable_rerank (boolean)
disable_rerank (boolean)source (string)
source (string)record_types (array)
record_types (array)date_range (object)
date_range (object)entity_limit (number)
entity_limit (number)metadata (object)
metadata (object)Response Format
Success Response
Result Fields
id (string)
id (string)score (number)
score (number)title (string)
title (string)content (string)
content (string)source (string)
source (string)recordType (string)
recordType (string)sourceId (string)
sourceId (string)primaryDate (string)
primaryDate (string)entities (array) - Optional
entities (array) - Optionalrelationships (array) - Optional
relationships (array) - Optionalmetadata (object) - Optional
metadata (object) - OptionalMetadata Fields
mode (string)
mode (string)total (number)
total (number)processingTime (number)
processingTime (number)reranked (boolean)
reranked (boolean)Error Responses
400 Bad Request
429 Too Many Requests
500 Internal Server Error
Code Examples
cURL
TypeScript/JavaScript
Python
Go
Advanced Usage
Multi-Source Query
Progressive Loading
Pagination
Rate Limiting
Performance Tips
1. Choose Appropriate Mode
2. Adjust top_k
top_k3. Disable Reranking
4. Cache Results
Next Steps
Last updated
Was this helpful?