Document Q&A
Upload documents and ask questions about them using RAG.
Upload documents (PDF, DOCX, TXT) and ask questions about them. Behind the scenes this is RAG: Tarqa finds the relevant sections and the model answers from them, citing what it used.
Good for
Legal documentsPull out key terms, find specific clauses, compare contracts.Research papersSummarize findings, extract methods, compare several papers.Knowledge basesSearchable docs, internal wikis, customer support answers.Medical reportsExtract diagnoses, medications and treatment plans.
No-code route
Upload files in Build → Data Sources, then turn on Data Sources under the Playground's message box and ask away.
How to do it
- 1Create a conversationcURL
curl -X POST https://api.tarqaai.com/api/v1/context/conversations/create \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "title": "Legal Contract Analysis", "knowledgeBaseType": "custom" }' - 2Index your document
Send the document's text, plus any metadata you want to keep with it.
cURLcurl -X POST https://api.tarqaai.com/api/v1/rag/index \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "conversationId": "conv_abc123", "documentText": "Your full document text here...", "metadata": { "filename": "contract.pdf", "uploadDate": "2026-06-01" } }' - 3Ask questionscURL
curl -X POST https://api.tarqaai.com/api/v1/rag/chat \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "conversationId": "conv_abc123", "message": "What are the payment terms in this contract?", "model": "gemini-2.5-flash", "topK": 5 }'
FAQ
Can I ask about several documents at once?
Yes. Index them all into the same conversation, and every question searches across all of them.
How do I get better answers?
Ask specific questions and raise
topK if answers miss details. See RAG System.