curl -X POST https://api.example.com/api/knowledge/search \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "How do I configure authentication?",
"projectId": "proj_123",
"topK": 5,
"minScore": 0.7,
"searchType": "semantic"
}'
const response = await fetch('https://api.example.com/api/knowledge/search', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
query: 'How do I configure authentication?',
projectId: 'proj_123',
topK: 5,
minScore: 0.7,
searchType: 'semantic'
})
});
const data = await response.json();
import requests
response = requests.post(
'https://api.example.com/api/knowledge/search',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'query': 'How do I configure authentication?',
'projectId': 'proj_123',
'topK': 5,
'minScore': 0.7,
'searchType': 'semantic'
}
)
data = response.json()
{
"success": true,
"documents": [
{
"id": "chunk_abc123",
"content": "To configure authentication, navigate to Settings > Security...",
"score": 0.89,
"metadata": {
"fileName": "setup-guide.pdf",
"fileType": "pdf",
"pageNumber": 12,
"chunkIndex": 5
}
},
{
"id": "chunk_def456",
"content": "Authentication can be enabled using OAuth 2.0 or API keys...",
"score": 0.82,
"metadata": {
"fileName": "api-reference.md",
"fileType": "markdown",
"section": "Authentication"
}
}
],
"message": "Found 2 relevant documents"
}
{
"success": true,
"documents": [],
"message": "No documents found matching the query"
}
Search
Search Documents
Searches indexed documents using vector similarity search
POST
/
api
/
knowledge
/
search
curl -X POST https://api.example.com/api/knowledge/search \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "How do I configure authentication?",
"projectId": "proj_123",
"topK": 5,
"minScore": 0.7,
"searchType": "semantic"
}'
const response = await fetch('https://api.example.com/api/knowledge/search', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
query: 'How do I configure authentication?',
projectId: 'proj_123',
topK: 5,
minScore: 0.7,
searchType: 'semantic'
})
});
const data = await response.json();
import requests
response = requests.post(
'https://api.example.com/api/knowledge/search',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'query': 'How do I configure authentication?',
'projectId': 'proj_123',
'topK': 5,
'minScore': 0.7,
'searchType': 'semantic'
}
)
data = response.json()
{
"success": true,
"documents": [
{
"id": "chunk_abc123",
"content": "To configure authentication, navigate to Settings > Security...",
"score": 0.89,
"metadata": {
"fileName": "setup-guide.pdf",
"fileType": "pdf",
"pageNumber": 12,
"chunkIndex": 5
}
},
{
"id": "chunk_def456",
"content": "Authentication can be enabled using OAuth 2.0 or API keys...",
"score": 0.82,
"metadata": {
"fileName": "api-reference.md",
"fileType": "markdown",
"section": "Authentication"
}
}
],
"message": "Found 2 relevant documents"
}
{
"success": true,
"documents": [],
"message": "No documents found matching the query"
}
Request Body
string
required
Search query text
string
required
Project ID to search within
number
default:5
Maximum number of results to return
number
Minimum similarity score threshold (0-1)
string
Search algorithm type
semantic- Pure vector similarity searchmrr- Maximal Marginal Relevance (diverse results)hybrid- Combines semantic and keyword search
number
Balance between semantic and keyword search in hybrid mode (0-1)
0= Pure keyword search1= Pure semantic search0.5= Equal weight (default)
Response
boolean
Whether the search was successful
array
string
Status message or error details
curl -X POST https://api.example.com/api/knowledge/search \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "How do I configure authentication?",
"projectId": "proj_123",
"topK": 5,
"minScore": 0.7,
"searchType": "semantic"
}'
const response = await fetch('https://api.example.com/api/knowledge/search', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
query: 'How do I configure authentication?',
projectId: 'proj_123',
topK: 5,
minScore: 0.7,
searchType: 'semantic'
})
});
const data = await response.json();
import requests
response = requests.post(
'https://api.example.com/api/knowledge/search',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'query': 'How do I configure authentication?',
'projectId': 'proj_123',
'topK': 5,
'minScore': 0.7,
'searchType': 'semantic'
}
)
data = response.json()
{
"success": true,
"documents": [
{
"id": "chunk_abc123",
"content": "To configure authentication, navigate to Settings > Security...",
"score": 0.89,
"metadata": {
"fileName": "setup-guide.pdf",
"fileType": "pdf",
"pageNumber": 12,
"chunkIndex": 5
}
},
{
"id": "chunk_def456",
"content": "Authentication can be enabled using OAuth 2.0 or API keys...",
"score": 0.82,
"metadata": {
"fileName": "api-reference.md",
"fileType": "markdown",
"section": "Authentication"
}
}
],
"message": "Found 2 relevant documents"
}
{
"success": true,
"documents": [],
"message": "No documents found matching the query"
}
⌘I

