How wahib-elbessali/moroccan-regulatory-assistant works
The repository is a Moroccan regulatory RAG assistant: a user asks in Arabic, French, or Darija; the system searches access-filtered regulatory documents, orchestrates follow-up searches, and returns an answer with verified citations or an “unknown” result. The README also documents ingestion, identity and access, audit, live progress, local-model sovereignty, and optional leak-filtered web search. Several implementation areas are represented only by directories or documentation, so those relationships are shown only where the README supports them; sampled source confirms the Arabic normalizer and retrieval-store behavior.
Main entry points: api API · retrieval Hybrid retrieval · orchestrator Agent orchestration · ingestion Ingestion pipeline
Components 17
Identity and access
- API
src/api - Identity and rights
src/core/db - Audit log
src/core/db
Document ingestion
- Ingestion pipeline
src/ingestion - Arabic normalizer
src/ingestion/normalize.py - Shared contracts
src/core/contracts
Retrieval
- File retrieval fake
src/core/contracts/fakes/retrieval.py - Hybrid retrieval
src/retrieval - Qdrant store
src/retrieval/store.py
Answer orchestration
- Agent orchestration
src/agents/orchestrator - Cited answer writer
src/agents/answer - Web agent
src/agents/web - Chat and admin UI
src/ui
Sovereignty
- Local models
services/models - Leak protection
src/core/leak - Web search service
services/web-search
Other components
- Questioner
Connections 23
- Questioner → API: asks
README.md - API → Identity and rights: checks access
README.md - API → Agent orchestration: submits question
README.md - API → Audit log: records activity
README.md - Agent orchestration → Hybrid retrieval: searches corpus
README.md - Hybrid retrieval → Qdrant store: queries chunks
src/retrieval/store.py - Hybrid retrieval → Local models: embeds and reranks
src/retrieval/store.py - Hybrid retrieval → Identity and rights: filters by rights
src/retrieval/store.py - Agent orchestration → Cited answer writer: requests answer
README.md - Cited answer writer → Agent orchestration: returns cited answer
README.md - Agent orchestration → Web agent: may request web
README.md - Web agent → Web search service: searches generic query
README.md - Web agent → Leak protection: checks query
README.md - API → Chat and admin UI: serves interaction
README.md - API → Ingestion pipeline: accepts uploads
README.md - Ingestion pipeline → Arabic normalizer: normalizes text
src/ingestion/normalize.py - Ingestion pipeline → Hybrid retrieval: indexes chunks
README.md - Ingestion pipeline → Leak protection: registers content
- Ingestion pipeline → Shared contracts: uses shared models
src/core/contracts/protocols.py - Hybrid retrieval → Shared contracts: uses shared models
src/retrieval/store.py - File retrieval fake → Arabic normalizer: uses normalization
src/core/contracts/fakes/retrieval.py - Cited answer writer → Local models: uses local models
README.md - Agent orchestration → Chat and admin UI: streams progress
README.md