Mujassad is an AI-powered platform that creates conversational digital twins of domain experts, preserving not only their knowledge but also their reasoning style, communication patterns, and authentic dialect.
The platform was developed to address a fundamental challenge faced by many institutions: valuable expertise often resides in the minds of experienced specialists and becomes difficult to transfer, preserve, scale, or sustain over time.
Mujassad explores whether expert knowledge can be captured and transformed into an interactive digital twin capable of engaging in natural conversations while remaining grounded in verified knowledge and maintaining the authentic voice of the expert.
The first deployed implementation models Mahmoud Al-Shanti, a Saudi cave-science expert with more than two decades of field experience, reproducing his expertise, communication style, and Hijazi dialect through a retrieval-driven architecture designed specifically for low-resource expert domains.
Many expert domains suffer from a scarcity of structured training data. Traditional approaches based on full model training or extensive fine-tuning are often impractical because authentic expert material is limited.
Mujassad investigates an alternative approach:
Can a faithful digital twin of a real expert be built without training a dedicated language model?
Instead of relying on large-scale model training, the platform combines retrieval-augmented generation, persona modeling, dialect preservation, expert verification, and conversational interfaces into a unified system capable of reproducing expert knowledge and communication style.
A complete framework for constructing conversational digital twins that preserve:
- Domain expertise
- Communication style
- Authentic dialect
- Personal reasoning patterns
- Expert identity and persona consistency
The system retrieves information from two complementary channels:
Provides factual domain information grounded in verified sources.
Preserves the expert’s characteristic speaking style, phrasing, personality traits, and dialect.
A structured behavioral specification governing:
- Personality consistency
- Communication style
- Domain boundaries
- Dialect usage
- Safety behavior
- Expert identity preservation
Experts remain part of the system lifecycle by:
- Reviewing responses
- Correcting inaccuracies
- Approving modifications
- Feeding validated corrections back into the knowledge base
Users may interact with the expert through:
- Text conversations
- Interactive talking-avatar sessions
Mujassad employs a multi-stage generation pipeline designed to balance authenticity, grounding, safety, and dialect preservation.
| Stage | Description |
|---|---|
| 0 — Safety Gate | Rule-based filter that rejects out-of-scope requests before any model call |
| 1 — Dual Retrieval | Retrieves knowledge evidence and voice anchors from separate retrieval channels |
| 2 — Constitutional Draft | Generates an initial answer guided by the persona constitution |
| 3 — Self-Critique | Evaluates the response across seven quality dimensions |
| 4 — Iterative Refinement | Improves the response while preserving grounding and persona consistency |
| 5 — Dialect Verification | Ensures authenticity of the target dialect |
| 6 — Final Delivery | Returns a grounded, safe, and persona-consistent response |
- Authentic Hijazi dialect generation
- Source-grounded responses
- Retrieval-Augmented Generation (RAG)
- Expert matching and intelligent routing
- Human verification workflow
- Conversational memory management
- Multi-page web application
- Arabic and English support
- Interactive talking avatar
- Domain-restricted safety controls
- Expert knowledge preservation
The deployed system was evaluated across functionality, grounding quality, dialect preservation, expert routing, safety behavior, and user interaction.
Key findings include:
- Expert routing achieved perfect accuracy within the evaluated domain.
- Safety controls consistently rejected out-of-scope requests.
- Users positively evaluated persona authenticity and dialect quality.
- Human corrections successfully propagated into the knowledge base.
- The system maintained expert consistency across conversations.
- The primary limitation remained response latency caused by the quality-oriented multi-stage pipeline.
The current deployment focuses on a single cave-science expert. However, the architecture itself is domain-agnostic and designed to support broader expansion.
Future directions include:
- Multi-expert collaborative conversations
- Cross-domain expert networks
- Multimodal understanding of images and documents
- Real-time visual field assistance
- Expanded expert verification workflows
- Institution-wide knowledge preservation
- Scalable digital twin ecosystems
The long-term vision is to transform Mujassad into a platform capable of creating digital twins for experts across diverse disciplines, enabling organizations to preserve, transfer, and scale human expertise while maintaining each expert’s authentic voice, dialect, and professional identity.
In this vision, expert knowledge becomes searchable, conversational, continuously maintainable, and accessible to future generations.
- Large Language Models (LLMs)
- Retrieval-Augmented Generation (RAG)
- Vector Search
- Embedding Models
- Persona Engineering
- Constitutional AI
- Self-Refine Evaluation
- Python
- FastAPI
- SQLite
- ChromaDB
- React
- TypeScript
- Modern Web UI
- Cloud Deployment
- REST APIs
- Session Management
- Expert Verification Services
The architecture and methodology of Mujassad draw inspiration from research in:
- Retrieval-Augmented Generation (RAG)
- Persona-Based Language Models
- Constitutional AI
- Self-Refine Frameworks
- Expert Finding Systems
- Digital Twin Technologies
- Human-in-the-Loop AI
A complete list of academic references, methodology details, and evaluation procedures is available in the accompanying graduation project report.
Mujassad — Graduation Project
Artificial Intelligence Program
College of Computing
Umm Al-Qura University
© 2026 Mujassad. All Rights Reserved. Experts remain part of the system lifecycle by:
- Reviewing responses
- Correcting inaccuracies
- Feeding validated corrections back into the knowledge base
Spoken Digital Twin
Users may interact with the expert through:
- Text conversations
- Interactive talking avatar sessions
⸻
System Architecture
Mujassad employs a multi-stage generation pipeline designed to balance authenticity, grounding, and safety.
- Safety Validation
- Filters out-of-scope requests before generation.
- Dual Retrieval
- Retrieves domain evidence and voice anchors independently.
- Persona-Constrained Draft Generation
- Produces an initial answer guided by the expert constitution.
- Multi-Criterion Self-Critique
- Evaluates answers against seven quality dimensions.
- Iterative Refinement
- Improves weak responses while maintaining grounding.
- Dialect Verification
- Ensures consistency with the target dialect.
- Final Response Delivery
- Returns a grounded and persona-consistent answer.
⸻
Key Capabilities
- Authentic Hijazi dialect generation
- Grounded answers supported by curated sources
- Expert matching and routing
- Human verification workflow
- Conversational memory management
- Multi-page web platform
- Arabic and English support
- Interactive talking avatar
- Domain-restricted safety controls
⸻
Evaluation Summary
The deployed system was evaluated across functionality, grounding quality, dialect preservation, expert routing, safety behavior, and user interaction.
Results demonstrated that:
- Expert routing achieved perfect accuracy within the tested domain.
- Safety controls consistently rejected out-of-scope requests.
- Users positively evaluated persona authenticity and dialect quality.
- Human corrections successfully propagated into the knowledge base.
- The primary limitation remained response latency caused by the multi-stage quality-oriented pipeline.
⸻
Broader Vision
While the current deployment focuses on cave science, the architecture itself is domain-agnostic.
The long-term vision is to transform Mujassad into a platform capable of creating digital twins for experts across multiple disciplines, enabling institutions to preserve, transfer, and scale human expertise while maintaining the authentic voice and identity of each expert.
In this vision, expert knowledge becomes searchable, conversational, continuously maintainable, and accessible to future generations| 4 — Refinement Loop | Rewrites to meet the criteria (up to two iterations) | | 5 — Dialect Verification | Over sixty deterministic replacements to ensure Hijazi dialect purity |
| Category | Technology |
|---|---|
| Language Model | Anthropic Claude (claude-haiku-4-5) |
| Backend | Python, FastAPI |
| Vector Database | ChromaDB (semantic search, cosine similarity) |
| Embedding Model | intfloat/multilingual-e5-large |
| Database | SQLite |
| Frontend | HTML, CSS, JavaScript |
| Avatar | LiveAvatar (external service via an OpenAI-compatible interface) |
| Deployment | Docker on a cloud server (DigitalOcean) |
mujassad/
├── mahmoud.py # Twin engine: six-stage generation pipeline
├── expert_matcher.py # Expert matching (Balog Model 2)
├── server.py # FastAPI server and API endpoints
├── static/ # Web interface (HTML/CSS/JS)
│ ├── index.html
│ ├── chat-with-expert.html
│ ├── experts.html
│ └── ...
├── chroma_unified_index/ # Knowledge index (ChromaDB)
├── chroma_voice_anchors/ # Voice-anchor index (ChromaDB)
├── requirements.txt # Python dependencies
├── Dockerfile # Container configuration
└── README.md
- Python 3.10 or later
- An Anthropic API key
# 1. Clone the repository
git clone https://github.com/remas565/mujassad.git
cd mujassad
# 2. Install dependencies
pip install -r requirements.txt
# 3. Set the API key (environment variable, never written in code)
export ANTHROPIC_API_KEY="your-api-key-here"
# 4. Run the server
python server.pyThen open http://localhost:7860 in a browser.
docker build -t mujassad .
docker run -p 7860:7860 -e ANTHROPIC_API_KEY="your-api-key-here" mujassad| Endpoint | Description |
|---|---|
POST /api/chat |
Text conversation with the twin (returns the answer, citation, sources, and quality scores) |
POST /v1/chat/completions |
OpenAI-compatible interface (used by the avatar) |
POST /api/match-experts |
Matches a question to the most suitable expert |
POST /api/verifications/resolve |
Human-in-the-loop verification: expert corrections |
The matcher ranks experts by the documented evidence in their knowledge rather than by job title:
score(E, Q) = 0.45 · DEPTH + 0.25 · BREADTH + 0.30 · COVERAGE
- DEPTH — the single strongest document match
- BREADTH — the number of relevant documents (logarithmic scale)
- COVERAGE — the average relevance of the top matching documents A domain gate first rejects questions for which no suitable expert exists.
Mahmoud Al-Shanti — Senior geological engineer specialising in cave science and geology, with over twenty-five years of experience.
The project builds on recent peer-reviewed research, including:
- PersonaAI (Kimara et al., 2025) — Digital avatars using retrieval-augmented generation instead of full training. arXiv:2503.15489
- Natural Language Interaction with a Knowledge-based Digital Twin (Fortuna et al., 2024) — RAG reduces hallucination through grounding. arXiv:2406.06566
- TwinVoice (Wang et al., 2025) — Evaluating digital twins via an LLM judge with human validation. arXiv:2510.25536
- PersonaRAG (Zhang et al., 2024) — User-centric agents with a live feedback loop. arXiv:2407.09394
- ID-RAG (Wang et al., 2025) — Identity retrieval for long-horizon persona coherence. arXiv:2509.25299
- Absher (Al-Monef et al., 2025) — A Saudi-dialect benchmark showing that mainstream models default to Modern Standard Arabic.
- Saudi-Dialect-ALLaM (Alyafeai et al., 2025) — Measuring and reducing dialect leakage in Arabic models. arXiv:2508.13525
- Balog, Azzopardi, and de Rijke (2006) — Formal models for expert finding (Model 2). ACM SIGIR.
- The API key is read from an environment variable (
ANTHROPIC_API_KEY) and is never stored in the codebase. - This is an academic graduation project. The current deployment serves a single expert as a proof of concept.
