Classeur« »
Projects MVP ready

Arabic Scholarship RAG Platform

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.

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.

2 parallel retrieval legs
7 MVP gates passed
100% citation recall
  • 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
PythonFastAPIpgvectorOpenRouterReactPostgreSQLDocker
Interface React SSE stream
Parallel retrieval GIN tsvector (lexical) pgvector cosine HNSW
Fusion and rerank Reciprocal Rank Fusion cross-encoder
Gate and verify threshold gate verifier recursion loop
Storage and infra PostgreSQL pgvector FastAPI Docker