Local model
Qwen3-4B 4-bit runs on the Mac for answer generation.
Python · MLX · mlx-lm
AL-NexusSaudi intelligence
From authorized Saudi source material to a cited answer in AL-Nexus. This is the architecture running on the local Apple silicon Mac and its temporary public demo.
01 / SYSTEM MAP
Evidence is prepared first. The model reads relevant passages when a question arrives.
Research notes and authorized article URLs, PDFs and text files.
Extract, normalize, preserve provenance and revisions, then rankable passages.
Route the question, retrieve evidence, generate with Qwen and check the draft.
Local Python API, browser chat, streaming and a source popup.
Permanent local knowledge
SQLite, research notes, indexed passages, dated facts and prices.
Temporary web evidence
SearXNG search-result snippets are used for gaps but are not added to the library.
02 / BUILD HISTORY
The live system and the experiments are shown separately.
Qwen3-4B 4-bit runs on the Mac for answer generation.
Python · MLX · mlx-lmShort reviewed summaries with source links and source types.
Research notes · metadata · human reviewExact approved URLs and local PDF/TXT, with permissions, metadata, duplicate and revision handling.
ingest_sources.py · PyMuPDF · SQLite · SHA-256Arabic-friendly character n-gram ranking over overlapping chunks.
build_index.py · scikit-learn · NumPy · joblibRetrieval, source-bound answers, citations, Arabic rendering and evidence checks.
ask_history.py · retrieval.py · answer_guard.pyReviewed snapshots and observations keep time, place and units attached to claims.
current_facts.py · price_answers.py · JSONWhen local evidence fails, search result excerpts may support a clearly marked answer.
SearXNG · Docker / Colima · WikimediaAdapters were trained and compared; the base model remains active because V3 showed no reliable gain.
mlx-lm · build_training_v3.py · evaluate_v3.pyUnit tests and question sets guide repairs. The last frozen local-source set reached 137/200 grounded answers.
unittest · 200-question set · 40 adversarial promptsBrowser chats and notebooks, private mode, a temporary public URL and GitHub backup.
web_app · chat_server.py · Cloudflare · GitHub03 / RUNTIME FLOW
Each answer follows a route appropriate to the question and available evidence.
The browser sends the question, response mode and private-chat flag to the local Python server.
The server validates its size and accepts one model job at a time. Policy, greetings and web-capability questions are routed early.
Dated prices or current facts can return directly. Otherwise, the local index finds relevant passages with subject and location filters.
A source-bound answer is used where available; otherwise Qwen3-4B receives the selected evidence and writes a cited draft.
Citations and known risky details such as dates, places and prices are checked. Supported sentences can be retained from a partial draft.
Non-private chat searches SearXNG or Wikimedia excerpts. The answer is checked again and marked as based on unreviewed search results. Private chat does not search the web.
The server returns checked text, status and cited links. The browser replaces any provisional tokens and offers a compact Sources popup.
04 / TRUST BOUNDARIES
Authorized ingestion is deliberate. Original bytes, metadata, page references and revisions stay in SQLite. Adding a source requires a new index build.
A cited search snippet is not a reviewed full article. It is temporary and never silently becomes training data or a permanent source.
Messages remain in the current browser tab and web fallback is disabled. Normal chats and notebooks live in that browser's local storage.
Flash, Nexus and El Shaiek share one base model with different answer budgets. The 68.5% benchmark is a project test, not a general intelligence score.