Inspiration

Small businesses and independent professionals often record income, expenses, invoices, debts, and wallet balances across separate screens and tools. The data may exist, but turning it into a clear financial decision still requires time and financial expertise.

Darahum already helps Arabic-speaking businesses manage their financial operations. For OpenAI Build Week, we built an Arabic-first AI Financial Copilot that transforms the user’s existing financial records into clear risk signals, explanations, and prioritized operational actions.

Our goal was not to build a chatbot that guesses. We wanted a safe, evidence-based assistant that understands financial context, preserves currency boundaries, and never changes the user’s records.

What it does

The AI Financial Copilot analyzes the authenticated user’s aggregated financial data, including:

  • Income, expenses, and net cash flow
  • Wallet balances
  • Outstanding and overdue invoices
  • Borrowed and lent debts
  • Active projects and contract values

It first creates an isolated, read-only financial snapshot for the current user. A deterministic risk analyzer then detects signals such as:

  • Negative cash flow
  • High expense-to-income ratio
  • Negative wallet balance
  • Overdue invoices
  • Overdue debts
  • Debt pressure on available liquidity

GPT-5.6 turns these verified signals into a structured Arabic report containing:

  • An overall financial health status
  • Clear, evidence-backed insights
  • Prioritized operational actions
  • Limitations of the available data
  • A read-only educational disclaimer

Every currency is analyzed independently. Darahum does not combine currencies using uncertain conversion rates. Cross-currency transfers without an authoritative exchange rate are excluded and disclosed as a limitation.

How we built it

The feature was built collaboratively with Codex and integrated into the existing Laravel application.

The analysis pipeline consists of four main layers:

  1. Financial Snapshot Service
    Collects only aggregated financial values belonging to the explicitly supplied user. It excludes raw records, personal identifiers, notes, contact details, and sensitive fields.

  2. Deterministic Risk Analyzer
    Applies fixed, testable financial rules before any model request. Risk severity and the overall health status are derived locally rather than invented by the model.

  3. OpenAI Responses API Boundary
    Sends a sanitized snapshot and verified risk analysis to GPT-5.6. Structured Outputs enforce a strict JSON schema for Arabic summaries, insights, actions, limitations, currencies, severity levels, and evidence codes.

  4. Secure Laravel Endpoint and Arabic UI
    Provides authenticated and verified users with a responsive RTL interface. Analysis begins only when the user requests it, and the result is not stored.

The OpenAI request uses store: false, sends no files or tools, and does not create conversations or retain previous response identifiers.

Challenges we ran into

One major challenge was balancing useful AI explanations with strict financial safety. A fluent response is not enough when it concerns financial data, so we derived risk signals locally and required every generated insight to reference valid evidence.

Multi-currency handling was another challenge. The existing system can contain transfers between different currencies without an authoritative exchange rate. Treating the same nominal value as equivalent across currencies would be financially unsafe, so these ambiguous transfers are excluded from the snapshot and reported transparently.

We also had to protect user isolation throughout the pipeline. Tests verify that analysis for one user cannot expose another user’s invoices, wallets, transactions, projects, debts, or sensitive text—even when a different user is authenticated.

Finally, strict Arabic output required additional validation. Natural-language fields must contain Arabic and cannot expose internal implementation terminology, while technical identifiers remain limited to dedicated structured fields.

Accomplishments that we're proud of

  • A working GPT-5.6 financial analysis experience deployed in production
  • Arabic-first, evidence-backed financial explanations
  • Deterministic risk classification before model generation
  • Strict Structured Outputs validation
  • Explicit per-user financial isolation
  • Independent multi-currency analysis
  • No automatic financial record creation or modification
  • No storage of prompts, snapshots, model responses, or analysis history
  • Protected access with authentication, email verification, account checks, impersonation blocking, and per-user rate limiting
  • A comprehensive automated regression suite covering isolation, safety, model boundaries, authorization, and UI behavior

What we learned

We learned that reliable financial AI requires more than a good prompt. Deterministic calculations, minimal data exposure, strict schemas, evidence validation, controlled failures, and transparent limitations are essential.

We also learned that AI can make complex financial information much more accessible when the explanation is delivered in the user’s own language and grounded in values they already understand.

What's next for Darahum AI Financial Copilot

Next, we plan to add:

  • Period-based trends and financial comparisons
  • User-controlled forecasting scenarios
  • More detailed category-level expense analysis
  • Authoritative exchange-rate support for cross-currency transfers
  • Additional Arabic financial guidance while preserving the same read-only and evidence-based safety model

Built With

Share this project:

Updates