Rag
RAG (Retrieval-Augmented Generation) - semantic search across trading knowledge base
Search Knowledge Base
Authorization
HTTPBearer In: header
Request Body
application/json
Search query
2 <= length <= 1000Retrieval strategy
"hybrid_reranked""vector" | "bm25" | "hybrid" | "hybrid_reranked"Filter by document types
Number of results to return
101 <= value <= 50Response Body
application/json
application/json
curl -X POST "https://loading/api/v1/rag/search" \ -H "Content-Type: application/json" \ -d '{ "query": "string" }'{
"success": true,
"query": "string",
"mode": "string",
"documents": [
{
"id": "string",
"content": "string",
"doc_type": "string",
"score": 0,
"source": "string",
"title": "string",
"url": "string",
"snippet": "string",
"timestamp": "string"
}
],
"total_results": 0,
"latency_ms": 0,
"reranked": false
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Get Document Sources
Authorization
HTTPBearer In: header
Response Body
application/json
curl -X GET "https://loading/api/v1/rag/sources"{
"success": true,
"doc_types": [
{
"property1": "string",
"property2": "string"
}
]
}Ingest Document
Authorization
HTTPBearer In: header
Request Body
application/json
Document content
10 <= length <= 50000Type of document
"news""market_analysis" | "trading_signal" | "news" | "social_sentiment"Document title
Source URL
Response Body
application/json
application/json
curl -X POST "https://loading/api/v1/rag/ingest" \ -H "Content-Type: application/json" \ -d '{ "content": "stringstri" }'{
"success": true,
"document_id": "string",
"doc_type": "string",
"message": "Document ingested successfully"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Search Social Posts
Authorization
HTTPBearer In: header
Request Body
application/json
Search query
2 <= length <= 1000Number of results
101 <= value <= 50Minimum similarity score
00 <= value <= 1Filter by platform
Response Body
application/json
application/json
curl -X POST "https://loading/api/v1/rag/social/search" \ -H "Content-Type: application/json" \ -d '{ "query": "string" }'{
"success": true,
"query": "string",
"source": "string",
"results": [
{
"id": "string",
"score": 0,
"content": "string",
"platform": "string",
"author": "string",
"posted_at": "string",
"coins": [
"string"
],
"trading_pairs": [
"string"
],
"conviction": "string",
"action_type": "string",
"sentiment": "string",
"summary": "string"
}
],
"total_indexed": 0,
"latency_ms": 0
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Get Social Rag Stats
Authorization
HTTPBearer In: header
Response Body
application/json
curl -X GET "https://loading/api/v1/rag/social/stats"{}Get Rag Settings
Authorization
HTTPBearer In: header
Response Body
application/json
curl -X GET "https://loading/api/v1/admin/rag-settings"{
"id": "string",
"enabled_sources": {
"property1": true,
"property2": true
},
"collection_limits": {
"property1": 0,
"property2": 0
},
"collection_interval_minutes": 5,
"auto_expiration_days": 1,
"max_posts_per_run": 100,
"version": 0,
"created_at": "string",
"updated_at": "string",
"updated_by": "string"
}Update Rag Settings
Authorization
HTTPBearer In: header
Request Body
application/json
Map of source names to enabled status
Map of source names to max post limits
Collection interval in minutes (5-180)
Auto-expiration in days (1-365)
Max posts per collection run (100-10000)
Current version for optimistic locking (prevents conflicts)
Response Body
application/json
application/json
curl -X PUT "https://loading/api/v1/admin/rag-settings" \ -H "Content-Type: application/json" \ -d '{}'{
"id": "string",
"enabled_sources": {
"property1": true,
"property2": true
},
"collection_limits": {
"property1": 0,
"property2": 0
},
"collection_interval_minutes": 5,
"auto_expiration_days": 1,
"max_posts_per_run": 100,
"version": 0,
"created_at": "string",
"updated_at": "string",
"updated_by": "string"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}