Why Arabic retrieval needs its own design
A document assistant can answer fluently from the wrong passage. When the search step misses the relevant Arabic text, a stronger language model still starts with poor evidence. Test retrieval on Arabic questions and documents before drawing conclusions from English results, and ask Arabic readers to check cases where the answer seems plausible.
The same word can be typed in several ways. Users ask questions in their own Arabic dialects, in Modern Standard Arabic, in English, in Latin-script Arabic, or in a mix of all four within one sentence. Company documents are usually in Modern Standard Arabic or English, sometimes both, sometimes with one version out of date. And the chat interface must display right-to-left text with embedded English terms and numbers without scrambling them.
If you are still deciding whether the assistant should retrieve documents at all, start with RAG, fine-tuning and prompting.
Modern Standard Arabic, Arabic dialects and Arabizi
A business assistant can receive Arabic in several written forms. These three are common.
Modern Standard Arabic (MSA) is the language of policies, contracts, government circulars and most formal documents. It is also the form your source documents are most likely to use.
Arabic dialects are common in everyday chats. Vocabulary, spelling and grammar differ from MSA and vary across dialects. A question about working hours or leave balance may use words that never appear in the HR policy, even though the meaning is identical. The language model may understand the question perfectly. The search index, which compares the question with MSA text, may not.
Arabizi is Arabic written in Latin letters, with digits standing in for sounds that have no Latin equivalent (for example, 3 for ع and 7 for ح). Many users type this way on phones, especially in quick messages. There is no single standard spelling, so one word can appear in several forms.
Keep the user’s original question. Generate one or more search queries that use the terms found in your documents, then compare retrieval with and without rewriting.
Normalize the text before you index it
Arabic has several spelling variants that a human reader treats as the same word but a computer does not. Normalization folds these variants into one form, at indexing time and again at query time, so that a query and a document match even when they were typed differently.
The Apache Lucene project's ArabicNormalizer, which many search engines build on, performs five steps: it maps hamza forms with an alef seat to bare alef, maps teh marbuta to heh, maps dotless yeh (alef maksura) to yeh, removes diacritics (the harakat), and removes tatweel. The code points involved are all in the Unicode Arabic block:
| What is normalized | Characters (Unicode) | Becomes |
|---|---|---|
| Alef with madda, hamza above, hamza below | آ أ إ (U+0622, U+0623, U+0625) | Bare alef ا (U+0627) |
| Teh marbuta | ة (U+0629) | Heh ه (U+0647) |
| Alef maksura | ى (U+0649) | Yeh ي (U+064A) |
| Diacritics (fathatan to sukun) | U+064B to U+0652 | Removed |
| Tatweel (stretching character) | ـ (U+0640) | Removed |
Check three other features of the text. First, look for Persian letter forms such as Farsi yeh (U+06CC) and keheh (U+06A9), which some keyboards enter and which look almost identical to Arabic yeh and kaf. Second, decide how to treat digits. Arabic-Indic digits (U+0660 to U+0669), extended Arabic-Indic digits (U+06F0 to U+06F9), and ASCII digits can all appear in the same document set. The W3C's Arabic and Persian Layout Requirements describes the three forms. A search for an invoice or policy number should find it regardless of the digit set. Third, strip invisible formatting characters introduced when text is copied from word processors.
Two cautions apply. Normalization is for matching, not for display. Store the original text and show it in answers and citations, because a user reading a contract clause expects the exact wording, diacritics included. And apply exactly the same rules on both sides. A pipeline that normalizes documents but not queries, or uses two different libraries for each, produces misses that are hard to diagnose.
Multilingual embeddings and cross-lingual retrieval
A hybrid search can use both keyword and vector retrieval. Keyword search compares terms after operations such as normalization and stemming. Vector search uses an embedding model to represent each passage and question numerically and compares those representations for similarity.
For keyword search, use an Arabic-aware analyzer rather than the default. Microsoft's Azure AI Search, for example, lists two Arabic analyzers: ar.lucene and ar.microsoft. The documentation says the Lucene analyzers are faster, the Microsoft analyzers add lemmatization, and indexing with the Microsoft analyzers is on average two to three times slower. It recommends comparing both on your own text with the Analyze API, which is good advice for any search engine. Run 30 or 40 typical Arabic terms through each analyzer and read the tokens it produces.
For vector search, the embedding model matters more than any other single choice. A multilingual embedding model places text in different languages in one shared space, so an English question can find an Arabic passage and the reverse. Cohere's embed documentation describes multilingual models supporting more than 100 languages and lists Arabic in its supported-language table. Google lists multilingual embedding models for Vertex AI, and several open-source projects publish them as well. Do not assume a model handles Arabic well because Arabic appears in a list. Test it on your own documents with the evaluation set described below.
Hybrid search combines the two methods. Keyword search helps retain exact product codes, legal references, and names. Vector search can find paraphrases and dialect questions even when the wording differs from the document. Test both kinds of query against the passages staff need to find.
An Arabic-aware retrieval pipeline
- Receive the questionKeep the user's original text and detect script and language
- Rewrite the queryProduce MSA and English search queries from dialect, Arabizi or mixed text
- NormalizeApply the same alef, yeh, teh marbuta, diacritic, tatweel and digit rules used at indexing
- Hybrid searchRun keyword search with an Arabic analyzer and vector search with a multilingual embedding model
- Answer and citeAnswer in the agreed language and cite the original, unnormalized passage
Mixed-script and dialect queries
Users often mix languages in the same question. A staff member may type a question with an English policy term inside an Arabic sentence, or ask about "annual leave" in Arabizi. Product names, system names and acronyms are often in English even in fully Arabic text.
Three techniques handle most of this.
Query rewriting. Before searching, ask the language model to rewrite the user's question into one clear MSA query and one English query, keeping names and codes unchanged. Search with both and merge the results. This step does most of the work for dialect and Arabizi, because the model is better at understanding informal text than the search index is. Log the rewritten queries so you can check them during evaluation.
A bilingual glossary. Record the Arabic and English names of departments, products, forms, and internal systems. Add the English name when a query uses the Arabic name of a form, and do the same in the other direction. Give the glossary to translators and to the people writing the evaluation questions so they use the same terms.
Index both language versions with a link between them. Where a policy exists in Arabic and English, index both and record that they are versions of the same document. If the two versions disagree, decide which one governs and say so in the answer. Many organizations state that one language version prevails in case of conflict. Your assistant should follow the same rule.
Decide the answer language policy in advance
Decide before launch whether the assistant follows the language of the question, the user's chosen language, or the language of the source. The question's language is a reasonable default for a staff assistant. When a question mixes languages, decide whether the user's profile or the dominant language of the question takes precedence.
Quotations need a separate rule. If the answer quotes a policy clause, quote it in its original language and offer a translation, rather than silently translating the clause, because a translated clause is not the clause. Citations should always point to the original document.
Numbers, dates and amounts deserve attention too. Decide whether answers use Arabic-Indic or ASCII digits, and keep reference numbers exactly as they appear in the source. A policy number copied with different digits may not be found when the user searches for it.
Evaluate with native-speaker review
Automated scores can flag problems, but reviewers familiar with the audience need to judge whether an Arabic answer sounds natural to the intended readers and uses terms they recognize. Give reviewers examples and shared scoring criteria so they can apply the same standard across test runs.
Build an evaluation set of real questions. Write many of them in at least three forms. Use MSA, a dialect your users write in, and Arabizi or mixed text. Write the expected source passage for each. Then score each run on four separate measures: whether the right passage was retrieved, whether the answer is faithful to that passage, whether the citation is correct, and whether the Arabic sounds natural and uses terms the audience recognizes. A retrieval failure and a language failure need different fixes, so keep their scores apart.
Choose reviewers who know how your intended audience speaks. A phrase that sounds natural in one dialect can sound unfamiliar in another. Give reviewers a short scoring guide with examples so they judge the same questions against the same criteria.
Use public benchmarks to shortlist candidates for tests with your documents. The Open Arabic LLM Leaderboard on Hugging Face, for example, tracks how models score on general Arabic tasks. Your assistant's job is narrower: answering from your documents for your users. A model that ranks well on general tasks may still miss your internal terms. Record the date of any leaderboard you consult, because rankings change as models are released.
Arabic evaluation set, minimum contents
- One question, several formsWrite the same question in MSA, a dialect your users write in, and Arabizi or mixed text
- Spelling variantsQuestions typed with and without hamza, diacritics and tatweel
- English terms inside ArabicProduct names, form names and acronyms embedded in Arabic sentences
- DigitsReference numbers typed in Arabic-Indic and ASCII digits
- Native-speaker scoringRetrieval, faithfulness, citation and language quality scored separately
Arabic in the chat interface
Test a chat reply that contains Arabic text, an English product name, a policy number, and a link. The Unicode Bidirectional Algorithm decides the display order of each character, and the W3C layout requirements explain how it treats letters and numbers. Without the right markup, punctuation jumps to the wrong end of a line and numbers appear out of order.
Set the text direction per message rather than for the whole page, so that an English answer in an Arabic interface still displays correctly. In HTML, dir="auto" on each message lets the browser choose the direction from the first strong character. Isolate embedded English terms and numbers so that they do not reorder the text around them. Mirror the layout for Arabic users: the message input, send button and avatars move to the other side. Check that the font covers Arabic properly at small sizes on phones, and that streaming text (words appearing as the model writes) does not jump between directions. The guide on Arabic RTL interface design covers layout, typography and testing in more depth.
Choosing a model without a ranking
Compare models against the work the assistant must do, including retrieval, handling of dialect, and response quality at your typical prompt length.
| Criterion | What to check |
|---|---|
| Arabic answer quality on your set | Native-speaker scores on your evaluation set, by dialect form |
| Dialect and Arabizi understanding | Scores on the dialect and Arabizi versions, compared with MSA |
| Data location and terms | Where requests are processed, retention, and whether data may be used for training |
| Embedding model fit | Retrieval hit rate on your Arabic and English documents, tested separately |
| Cost and latency | Measured on your typical prompt length, including retrieved passages |
| Lifecycle | Announced retirement dates and how often the provider changes the model |
Run the same evaluation on each model, on the same day, with the same prompt and retrieval settings. Save the results so you can compare a new model against a known baseline. Our knowledge search and assistants work uses approved sources, references in the answers, and escalation to a person when the system is uncertain. If you also need to read scanned forms or invoices, see our guide to Arabic and bilingual document extraction.
Questions buyers ask
Which Arabic language model suits a business assistant?
No single model is best for every assistant, and public leaderboards test general tasks rather than your documents and your users' dialect. Shortlist models that meet your data-location and contract requirements, then run the same Arabic evaluation set against each and have native speakers score the answers. Repeat the test when the provider releases a new version.
Should we translate our Arabic documents into English before indexing?
Usually not as the only copy. Translation can lose terms of art and names, and citations should point to the original text a user can read. A multilingual embedding model can match an English question to an Arabic passage directly. Where you do translate, keep the original as the cited source and treat the translation as a search aid.
Can the assistant understand Arabic dialects and Arabizi?
Large models differ in how well they handle colloquial Arabic expressions and Latin-script Arabic, and quality also varies by topic, so test it rather than assume it. Retrieval is the weaker link, because your documents are written in Modern Standard Arabic or English while users type in dialect. Rewriting the query into Modern Standard Arabic before searching, and testing with real dialect questions, closes much of that gap.
What does Arabic text normalization change?
It folds spelling variants into one form for search, for example alef with hamza into bare alef, and it removes diacritics and the tatweel stretching character. This helps a query match a document even when the two were typed differently. Apply the same normalization at indexing and at query time, and show users the original, unnormalized text.
Sources
- Unicode Standard: Arabic code chart (U+0600 to U+06FF)
- Apache Lucene 9.11: ArabicNormalizer
- Microsoft Learn: Add language analyzers to string fields (Azure AI Search)
- Cohere documentation: Embed models
- W3C: Arabic and Persian Layout Requirements (Group Draft Note)
- Open Arabic LLM Leaderboard (Hugging Face)
- Google Cloud Vertex AI: Get text embeddings