Ask your documents
Upload documents and search them in Arabic with source-cited answers — retrieve, answer, and analyze modes.
اسأل مستنداتك
ارفع مستنداتك، ثمّ استعلم عنها بالعربية. تعمل كل منشأة على نسخةٍ معزولة تماماً — لا تتسرّب بيانات منشأةٍ إلى أخرى.
ASAS RAG lets you upload documents and query them in Arabic, returning answers grounded in — and cited to — your own content. Each organization runs on its own isolated document tenant, so cross-org leakage is structurally impossible.
RAG requires an active RAG entitlement. Your dedicated tenant is provisioned
when the entitlement is granted (it isn't created for every organization, since
each instance consumes resources). Until it is live, RAG endpoints return a
rag_not_provisioned or rag_provisioning problem response.
Upload documents
Documents are uploaded as multipart form data. The gateway enforces size and type limits and scans before forwarding to your tenant.
curl https://api.asas.flitc.tech/v1/rag/documents \
-H "Authorization: Bearer $ASAS_API_KEY" \
-F file=@handbook.pdf \
-F title="Employee Handbook"Indexing runs as a job; you get a rag.job.completed webhook when
the document is searchable, so you don't have to poll.
Search
POST /v1/rag/search runs a query. The mode selects how much work the platform
does — and how the query is billed:
| Mode | What it returns | Latency | Cost |
|---|---|---|---|
retrieve | Ranked chunks + citations, no generation | Fastest | Lowest |
answer | A grounded answer with citations | Medium | Medium |
analyze | Multi-pass analytical answer (5–30 s) | Slowest | Highest |
curl https://api.asas.flitc.tech/v1/rag/search \
-H "Authorization: Bearer $ASAS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "ما هي مدة الإجازة السنوية؟",
"mode": "answer",
"top_k": 8
}'Response (complete JSON — the platform does not token-stream):
{
"mode": "answer",
"answer": "مدة الإجازة السنوية 30 يوماً…",
"results": [
{ "document_id": "doc_12", "chunk_id": "c_3", "score": 0.88, "text": "…" }
],
"search_time_ms": 640
}Search parameters
| Field | Type | Notes |
|---|---|---|
query | string | Required. The natural-language query. |
mode | retrieve | answer | analyze | Default retrieve. |
top_k | integer | 1–100. Default 10. |
detail | minimal | full | Response detail. Default full. |
document_ids | string[] | Restrict search to specific documents. |
language | string | auto, none, or an ISO-639-1 code. |
metadata_filters | object | Filter by your document metadata. |
enable_rewrite_search_query | boolean | Rewrite the query before searching. Requires rewrite_search_query_instructions. |
For analyze (5–30 s), an async submit → webhook pattern
(POST /v1/rag/analyses) is planned for v1.1 — a nicer fit than holding a socket
open. Token-streamed answers are reserved for a future upstream capability.
Billing
RAG bills per query, rated by mode (retrieve < answer < analyze).
Uploads bill by bytes ingested (failed indexing jobs are refunded), and storage is
metered as the max bytes stored per period. Upstream 5xx errors are not billed.