APFlow
Book a callاحجز مكالمة
All case studiesكل دراسات الحالة
Financial servicesالخدمات المالية

A finance agency drowning in paper, rebuilt around local AIوكالة مالية تغرق في الورق، أعيد بناء عملها بذكاء اصطناعي محلي

A regional finance agency processed thousands of Arabic and English client documents by hand every month: statements, contracts, and KYC files. Regulation barred cloud APIs. We deployed Arabic OCR and a local LLM inside their network and rebuilt the intake process end to end.وكالة مالية إقليمية كانت تعالج آلاف المستندات العربية والإنجليزية يدوياً كل شهر: كشوف حسابات وعقود وملفات عملاء. القانون يمنع الخدمات السحابية. ركّبنا قارئ مستندات عربياً ونموذجاً ذكياً محلياً داخل شبكتهم، وأعدنا بناء استقبال المستندات من أوله إلى آخره.

14 → 2 days to onboard a new clientيوماً لفتح ملف عميل جديد

The mess beforeالفوضى قبل

Four people, full time, typingأربعة موظفين يكتبون طوال اليوم

Every client document arrived as a scan or photo. A team of four re-typed figures from bank statements and contracts into the core system, all day, every day. New client onboarding took two weeks because the documents sat in a queue.كل مستند يصل صورة أو ملفاً ممسوحاً. أربعة موظفين يعيدون كتابة الأرقام من كشوف الحسابات والعقود في النظام، طوال اليوم، كل يوم. فتح ملف عميل جديد يستغرق أسبوعين لأن المستندات تنتظر دورها.

Errors that cost real moneyأخطاء تكلف مالاً حقيقياً

Manual entry meant transposed digits and missed lines. Each error surfaced weeks later as a reconciliation break that took hours to trace. Internal audit flagged the process as a standing operational risk.الكتابة اليدوية تعني أرقاماً مقلوبة وسطوراً منسية. كل خطأ يظهر بعد أسابيع كفرق في الحسابات يحتاج ساعات لمعرفة سببه. التدقيق الداخلي صنف العملية خطراً دائماً على العمل.

Duplicates and fraud slipping throughمستندات مكررة واحتيال يمر دون انتباه

The same invoice arrived twice with a different file name and got paid twice. A re-photographed statement with an altered figure looked like a fresh document to tired eyes. Nobody had a systematic way to catch either.الفاتورة نفسها تصل مرتين باسم ملف مختلف فتدفع مرتين. وكشف حساب مصور من جديد برقم معدل يبدو مستنداً جديداً للعين المتعبة. لم يكن عند أحد طريقة منظمة لكشف الحالتين.

Cloud AI was not an optionالذكاء الاصطناعي السحابي ممنوع

The agency had tested a cloud OCR API and the pilot was killed by compliance in a week: client financial data cannot transit a public cloud under their regulator's rules. Every vendor pitch ended at the same wall.جربت الوكالة خدمة سحابية لقراءة المستندات، فأوقفها فريق الالتزام خلال أسبوع: بيانات العملاء المالية لا يجوز أن تمر عبر سحابة عامة حسب قواعد الجهة المنظمة. كل عرض من الموردين ينتهي عند الجدار نفسه.

The stack we deployedالأدوات التي نشرناها

Qari-OCR (Arabic VLM OCR)
Reads Arabic and English scans into structured textيقرأ المستندات العربية والإنجليزية ويحولها إلى نص منظم
Gemma 4 26B via vLLM
Extracts fields, classifies documents, drafts summariesيستخرج البيانات ويصنف المستندات ويكتب الملخصات
Ollama (pilot phase)
Fast local model serving during the pilotتشغيل سريع للنماذج في مرحلة التجربة
PostgreSQL
Extraction store, dedup index, validation rules, audit trailيخزن البيانات وفهرس التكرار وقواعد التحقق وسجل التدقيق
Docker Compose
The whole stack as containers: one file, one command, survives rebootsالمنظومة كلها حاويات: ملف واحد وأمر واحد، وتنجو من إعادة التشغيل
Email + scanner intake
Documents enter from existing channels, nothing changes for clientsالمستندات تدخل من القنوات الموجودة، لا شيء يتغير على العملاء

How it actually wentكيف سارت العملية فعلاً

  1. 1 Weeks 1-2: scoping on their real documentsالأسبوعان 1-2: دراسة على مستنداتهم الحقيقية We took 500 of their actual documents (anonymized) and measured extraction accuracy per document type before promising anything. Bank statements and contracts cleared the bar; handwritten forms did not, and were explicitly scoped out of phase one.أخذنا 500 مستند حقيقي من عملهم (بعد إخفاء الأسماء) وقسنا دقة القراءة لكل نوع قبل أي وعد. كشوف الحسابات والعقود نجحت؛ النماذج المكتوبة بخط اليد لم تنجح، فأخرجناها بوضوح من المرحلة الأولى.
  2. 2 Weeks 3-8: pilot on one GPU serverالأسابيع 3-8: تجربة على خادم واحد One on-prem server, inside their network. OCR reads the scan, the LLM extracts fields into a fixed schema, validation rules cross-check totals and IDs against the core system, and anything below a confidence threshold routes to a human review screen.خادم واحد داخل شبكتهم. القارئ يحول الصورة إلى نص، والنموذج يستخرج البيانات في قالب ثابت، وقواعد التحقق تقارن المجاميع والأرقام مع النظام الأساسي، وكل نتيجة غير مؤكدة تذهب إلى شاشة مراجعة بشرية.
  3. 3 Weeks 9-12: production, with humans in chargeالأسابيع 9-12: التشغيل الكامل، والإنسان هو المسؤول The four-person team moved from typing to reviewing. Every posting into the core system still carries a human approval, and every read, match, and decision lands in the audit trail. Internal audit signed off on the process they had previously flagged.انتقل الموظفون الأربعة من الكتابة إلى المراجعة. كل إدخال في النظام ما زال يحتاج موافقة إنسان، وكل قراءة ومطابقة وقرار يسجل في سجل التدقيق. ووافق التدقيق الداخلي على العملية التي كان يعتبرها خطراً.

Under the hoodماذا يجري تحت الغطاء

Moving 3,500 documents a month without a jam: queues, not heroicsمعالجة 3,500 مستند شهرياً دون تكدس: طوابير منظمة، لا جهود بطولية

Bulk intake is a pipeline problem, not a model problem. Documents land in object storage the moment they arrive; an ingestion queue records each one; GPU workers pull from the queue and process scans in batches of 8 to 16 pages, which keeps the GPU saturated instead of idling between files. A separate priority lane means an urgent single document from the front office overtakes the overnight bulk backlog instead of waiting behind it. If the server reboots mid-batch, the queue simply re-issues the unfinished work: nothing is lost and nobody re-uploads anything.استقبال كميات كبيرة مشكلة تنظيم، لا مشكلة نموذج. المستند يحفظ في المخزن لحظة وصوله؛ وطابور الاستقبال يسجل كل واحد؛ والمعالجات تسحب من الطابور وتعالج الصفحات في دفعات من 8 إلى 16، فيبقى المعالج الرسومي مشغولاً بدل أن ينتظر بين ملف وملف. وهناك مسار أولوية خاص: المستند العاجل من خدمة العملاء يتقدم على أعمال الليل المتراكمة بدل أن ينتظر خلفها. وإذا أعيد تشغيل الخادم في منتصف العمل، يعيد الطابور توزيع ما لم يكتمل: لا شيء يضيع ولا أحد يرفع ملفاً من جديد.

Catching duplicates in three layersكشف التكرار بثلاث طبقات

Layer one is an exact file hash: the same file submitted twice is caught instantly, whatever its name. Layer two is a perceptual hash (pHash) of the page image: it catches the same document re-scanned, re-photographed, or re-saved at a different quality, because visually similar pages produce nearly identical fingerprints. Layer three is fuzzy field matching on the extracted data: same supplier, same amount, same date, but a slightly different invoice number is flagged as a probable duplicate for a human to judge. Each layer catches what the previous one misses.الطبقة الأولى بصمة الملف نفسه: الملف المرسل مرتين يكشف فوراً مهما تغير اسمه. الطبقة الثانية بصمة الصورة (pHash): تكشف المستند نفسه إذا مسح أو صور من جديد أو حفظ بجودة مختلفة، لأن الصفحات المتشابهة بصرياً تعطي بصمات متقاربة جداً. الطبقة الثالثة مقارنة مرنة للبيانات المستخرجة: المورد نفسه والمبلغ نفسه والتاريخ نفسه مع رقم فاتورة مختلف قليلاً يعلم كتكرار محتمل ليحكم فيه إنسان. كل طبقة تلتقط ما فاتته الطبقة السابقة.

Fraud signals: when a document liesإشارات الاحتيال: عندما يكذب المستند

Fraud rarely announces itself; it hides in near-duplicates and small edits. The pipeline flags the classic patterns: a known invoice resubmitted with only the bank account changed, totals that do not match line items, a supplier name one letter away from a real one, and file metadata that says a scanned original was edited last night. None of these flags block a payment by themselves. They open a review case with the evidence attached, and a person decides. Since every document passes the same checks before anyone sees it, tired-eyes fraud lost its main entrance.الاحتيال لا يعلن عن نفسه؛ بل يختبئ في النسخ شبه المكررة والتعديلات الصغيرة. المنظومة تكشف الأنماط المعروفة: فاتورة قديمة أعيد إرسالها وتغير فيها رقم الحساب فقط، ومجاميع لا تساوي تفاصيلها، واسم مورد يختلف بحرف واحد عن اسم حقيقي، وبيانات ملف تقول إن الأصل الممسوح عُدل البارحة. لا تمنع أي إشارة الدفع وحدها، بل تفتح حالة مراجعة مع الدليل، والإنسان يقرر. ولأن كل مستند يمر بالفحوص نفسها قبل أن يراه أحد، فقد الاحتيال الذي يستغل العين المتعبة بابه الرئيسي.

The review loop that shrinks itselfحلقة المراجعة التي تصغر نفسها بنفسها

In month one, about a quarter of documents fell below the confidence threshold and went to a human. Every correction a reviewer makes is stored next to the original, and that growing set of corrected examples is used to tune the extraction. By month six the review rate was under 5 percent. The team did not get faster at typing; the system got better at not needing them.في الشهر الأول، نحو ربع المستندات كانت تحت حد الثقة فتذهب إلى المراجعة البشرية. كل تصحيح يحفظ بجانب الأصل، ومجموعة التصحيحات المتزايدة تستخدم لتحسين الاستخراج. بحلول الشهر السادس صارت نسبة المراجعة أقل من 5 بالمئة. الفريق لم يصبح أسرع في الكتابة؛ النظام أصبح أقل حاجة إليهم.

The transformation, in numbersالتحول بالأرقام

Client onboarding timeمدة فتح ملف عميل جديد
14 days14 يوماً 2 daysيومان
Manual entry error rateنسبة أخطاء الإدخال اليدوي
~5%نحو 5% <1%أقل من 1%
Duplicate paymentsالمدفوعات المكررة
found after payoutتكتشف بعد الدفع flagged at intakeتكشف عند الاستلام
Documents needing human reviewمستندات تحتاج مراجعة بشرية
100%100% <5% (month six)أقل من 5% (الشهر السادس)
Staff on full-time data entryموظفون متفرغون للإدخال اليدوي
44 00
Data leaving the networkبيانات تخرج من الشبكة
noneلا شيء none (unchanged, by design)لا شيء (لم يتغير، وهذا هو التصميم)
The transformationالتحول

The agency did not buy a tool; it changed what its people do. Typing became reviewing, duplicates and tampered documents became cases flagged at the door, and a two-week queue became a two-day turnaround. The regulator's constraint never moved: nothing touches a public cloud. The architecture moved instead.لم تشترِ الوكالة أداة، بل غيرت طبيعة عمل موظفيها. الكتابة صارت مراجعة، والمستندات المكررة والمعدلة صارت حالات تكشف عند الباب، وطابور الأسبوعين صار إنجازاً في يومين. شرط الجهة المنظمة لم يتغير: لا شيء يمر عبر السحابة العامة. الذي تغير هو طريقة البناء.

Discuss your workflowناقش معنا مسار عملك