أساس · التوثيق
المنتجات

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.

POST /v1/rag/search runs a query. The mode selects how much work the platform does — and how the query is billed:

ModeWhat it returnsLatencyCost
retrieveRanked chunks + citations, no generationFastestLowest
answerA grounded answer with citationsMediumMedium
analyzeMulti-pass analytical answer (5–30 s)SlowestHighest
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

FieldTypeNotes
querystringRequired. The natural-language query.
moderetrieve | answer | analyzeDefault retrieve.
top_kinteger1–100. Default 10.
detailminimal | fullResponse detail. Default full.
document_idsstring[]Restrict search to specific documents.
languagestringauto, none, or an ISO-639-1 code.
metadata_filtersobjectFilter by your document metadata.
enable_rewrite_search_querybooleanRewrite 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.

On this page