The platform delivers citation-exact answers (page, line, hadith number, bayt number, folio) from private or shared classical Arabic knowledge bases. Its retrieval stack runs two parallel legs, lexical GIN tsvector and pgvector cosine HNSW, fused with Reciprocal Rank Fusion, then reranked by a cross-encoder. A threshold gate refuses synthesis when top cosine similarity falls below the knowledge-base threshold, returning near-misses rather than hallucinating. A verifier recursion loop (depth-capped, SSE-streamed) iterates sub-queries until the retrieval is judged sufficient. The stack was built autonomously and passes a seven-gate MVP scorecard including 100% citation recall.
Arabic Scholarship RAG Platform
2 parallel retrieval legs
7 MVP gates passed
100% citation recall
01What it is
A multi-user platform for citation-exact answers over classical Arabic books, powered by a hybrid BM25 + pgvector retrieval pipeline with cross-encoder reranking, verifier-loop recursion, and a precision "I don't know" threshold gate.
02Engineering
03 Architecture
Interface
ReactSSE stream
Parallel retrieval
GIN tsvector (lexical)pgvector cosine HNSW
Fusion and rerank
Reciprocal Rank Fusioncross-encoder
Gate and verify
threshold gateverifier recursion loop
Storage and infra
PostgreSQLpgvectorFastAPIDocker
04 Highlights
- Returns citation-exact answers (page, line, hadith number, bayt number, folio) from classical Arabic knowledge bases
- Hybrid retrieval runs two parallel legs, lexical GIN tsvector and pgvector cosine HNSW, fused with Reciprocal Rank Fusion and reranked by a cross-encoder
- A threshold gate refuses synthesis below the knowledge-base threshold, returning near-misses instead of hallucinating
- A depth-capped, SSE-streamed verifier recursion loop iterates sub-queries until retrieval is judged sufficient
05Stack
PythonFastAPIpgvectorOpenRouterReactPostgreSQLDocker
06Status
MVP ready