How abdulrahman-s-asiri/bahith works
باحث is a local-first Arabic document search application, with a separate, limited public demo that searches only the bundled corpus. The main workflow is upload and extract text, split it into page-aware passages, store originals and passages locally, then retrieve and display source-linked results; users can browse documents and passages and save local feedback. Search offers semantic, BM25, fused, and staged ranking with Matryoshka dimensions. The graph also preserves the documented Pages export and reproducible evaluation branches. Some route and template wiring is unsampled; edges below rely on shown calls or README statements.
Main entry points: app.py Web application · documents.py SQLite library · search.py Arabic retrieval · templates Search and library UI
Components 20
Web experience
- Web application
app.py - Search and library UI
templates - Interactive search
static/js/app.js - Pages search UI
static/js/pages.js - Demo safeguards
public_demo.py
Document library
- Upload and replace
app.py - Text extraction
documents.py - Passage splitting
documents.py - SQLite library
documents.py - Document browsing
templates - Local feedback
app.py
Search and ranking
- Search orchestration
app.py - Arabic retrieval
search.py - Source-linked results
templates/_results.html - Bundled demo corpus
corpus.json
Evaluation and publishing
- Retrieval evaluation
evaluate.py - Static Pages export
deploy/export_pages.py
Other components
- Reader
- Embedding model
- GitHub Pages site
Connections 25
- Reader → Web application: uses
README.md - Web application → Search and library UI: renders
README.md - Search and library UI → Interactive search: enhanced by
static/js/app.js - Search and library UI → Pages search UI: enhanced by
static/js/pages.js - Reader → Upload and replace: uploads
README.md - Upload and replace → Text extraction: extracts
README.md - Text extraction → Passage splitting: splits
README.md - Passage splitting → SQLite library: stores
README.md - Web application → SQLite library: uses
app.py - Reader → Document browsing: browses
README.md - Document browsing → SQLite library: reads
README.md - Reader → Local feedback: rates results
README.md - Local feedback → SQLite library: saves
app.py - Web application → Demo safeguards: applies limits
app.py - Reader → Search orchestration: submits query
README.md - Search orchestration → Arabic retrieval: retrieves
app.py - Arabic retrieval → Embedding model: encodes text
README.md - Search orchestration → SQLite library: loads passages
README.md - Search orchestration → Source-linked results: renders results
app.py - Source-linked results → Reader: shows sources
README.md - Arabic retrieval → Bundled demo corpus: searches demo text
README.md - Retrieval evaluation → Arabic retrieval: measures retrieval
evaluate.py - Static Pages export → Web application: renders pages from
deploy/export_pages.py - Static Pages export → GitHub Pages site: exports site
deploy/export_pages.py - Pages search UI → Search orchestration: requests search