LegalTech (Israel) · AI Chat Consultant · Document Analyzer · RAG

MagenLegal

Israeli Law AI Assistant & document analyzer powered by 5,777 verified sources.

A 3-language Israeli law platform (RU, EN, FR) helping residents and newcomers in Israel navigate Hebrew statutes and official documents without fear of costly mistakes. Unites a chat consultant with conversation history, hidden-risk contract analysis, and a library of step-by-step practical guides.

magenlegal.com/en
Product interface for MagenLegal: Home (magenlegal.com/en)
1 / 4
Challenge

The Idea & Engineering Challenge.

When living in or relocating to Israel, nearly every everyday situation — signing an apartment lease, an employment contract, municipal tax (Arnona), Bituach Leumi (National Insurance) benefits, or a government notice — runs into dense legal Hebrew. Israel's legal system works differently from codified European jurisdictions: there is no single civil code — rules are scattered across separate statutes, agency directives, and court precedents that update frequently. Generic LLMs are dangerous here because they confidently invent non-existent statutes. MagenLegal was designed as a clear 'legal shield' for Israel: in one window you can ask a question in your own language, check a contract before signing, and follow a procedure via a ready checklist.

The engineering challenge was twofold. First, bridging three alphabets and two writing directions: users communicate in Latin (EN, FR) or Cyrillic (RU), while the database of 5,777 Israeli acts and the contracts being reviewed are written right-to-left in Hebrew (RTL). Second, eliminating AI hallucinations — teaching retrieval to translate everyday questions and local expat slang ('StuPro' residency status, 'Pitzuim' severance pay) into exact Hebrew statutory terms, and merging RTL and LTR text cleanly during PDF export without breaking layout.

Objective

Build an Israeli legal platform in RU, EN, and FR featuring an AI chat consultant (preserving conversation history), safe analysis of Hebrew contracts, and a guide database where every answer relies strictly on verified Israeli statutes with direct citations.

Outcome

A live Israeli law platform at magenlegal.com backed by 5,777 verified sources and a 3-language library of practical guides. Users receive accurate answers grounded in Hebrew law, uncover hidden contract risks in a minute (with a clean Bidi-PDF report export), and run on our dedicated EU cluster.

Delivery Scope

  • Legal corpus collection & cleaning (Python ETL) and hybrid search (RAG)
  • AI chat interface with history, user account & guide library (RU / EN / FR)
  • Contract & official letter analyzer with PDF report export & subscription billing
  • Fault-tolerant AI core (3 providers), multi-tier caching & dedicated EU cluster
Under the Hood

User Interface ⇄ Pipeline Under the Hood.

Select a step to inspect the underlying mechanics

USER EXPERIENCEEnd-user workflow on screen

PIPELINE TELEMETRYData routing & node execution

USER EXPERIENCEEnd-user workflow on screen

01 · Question in RU / EN / FR

Cross-lingual parsing of everyday questions & local Israeli slang

Users write in English, French, or Russian just like a normal chat — the system extracts the legal core and maps concepts to Hebrew statutory terms.

PIPELINE TELEMETRYData routing & node execution

01 · Cross-Lingual CoT TransformPre-Retrieval

RU/EN/FR (LTR) → Hebrew (RTL) Legal Mapper

Fast LLM TransformIsraeli Legal Terminology

Separates biographical context from the legal subject and expands local slang (StuPro, Pitzuim) into exact Hebrew statutory terms.

USER EXPERIENCEEnd-user workflow on screen

02 · Grounded Israeli Law Search

Cited answers across 5,777 Israeli acts with conversation memory

The engine locates relevant Hebrew statutes, agency directives, and precedents, delivering a verified answer in the user's language with direct links.

PIPELINE TELEMETRYData routing & node execution

02 · Hybrid RAG & AI Judge3-Signal Search

PostgreSQL 16 + pgvector & Relevance Reranker

50% Semantic30% Lexical20% FTS5,777 Docs

Triple-signal search across Israeli laws, circulars, and precedents + AI candidate evaluation against hallucinations.

USER EXPERIENCEEnd-user workflow on screen

03 · Hebrew Contract → Bidi-PDF

Risk check for official letters or contracts with a clean PDF export

Files are parsed in server memory to highlight 'red flags' and deadlines, producing a clean PDF where Hebrew (RTL) and English/French/Russian coexist seamlessly.

PIPELINE TELEMETRYData routing & node execution

03 · Bidi Analyzer & FailoverRTL+LTR PDF

AI Vision, Bidi jsPDF & 3-Tier Cascade

Server Actions (25 MB)OpenSans/HebrewVertex AI → OpenAI

In-memory server streaming parse, clean Bidi PDF assembly (Hebrew + Latin/Cyrillic), and cascading AI failover.

USER EXPERIENCEEnd-user workflow on screen

04 · Guides to Life in Israel

Instant access to step-by-step practical guides in 3 languages

Checklists for Bituach Leumi, Arnona, leases, and employment rights open instantaneously in RU, EN, and FR thanks to multi-tier caching.

PIPELINE TELEMETRYData routing & node execution

04 · Guide Factory & EU Cluster30-Day Cache

30-Day ISR Cache & Sovereign EU Cluster

Next.js Standaloneunstable_cacheCloudflare + Caddy

Instant delivery of the Israeli guide library in RU / EN / FR from dedicated EU servers behind Cloudflare.

Architecture

Key Nodes.

Engineering decisions powering speed, reliability, and long-term product scalability.

  1. 01
    System Node

    Cross-Lingual Hallucination-Free Search Over Israeli Law (RAG 5.5)

    In Israel's non-codified legal system, exact meaning hinges on formal Hebrew statutory terms, while users ask questions in English, French, or Russian using everyday language and slang. Before retrieval, the pipeline separates personal backstory from the core legal issue, translates concepts into official Hebrew terminology, searches across 5,777 acts and precedents in PostgreSQL + pgvector, and runs a dedicated AI relevance judge that selects only verified statutes — strictly forbidding facts outside the database.

  2. 02
    System Node

    Hebrew Contract Analyzer & Bidirectional Bidi-PDF Export

    Users upload a scan, photo, DOCX, or PDF of a lease, employment agreement, or agency letter (up to 25 MB). Vision AI reads the Hebrew original and builds a report in Latin or Cyrillic across 4 sections (translation, core summary, 'red flags', actionable advice). To keep mixed Hebrew (RTL) quotes and English/French/Russian (LTR) commentary from breaking upon export, a dedicated PDF engine handles all three scripts natively.

  3. 03
    System Node

    Fault-Tolerant AI Core & High-Speed Israeli Guide Library

    To prevent downtime from single-vendor outages or rate limits, requests cascade across a 3-tier model failover chain (Vertex AI → Multi-Provider AI → OpenAI). Meanwhile, frequent Israeli procedures (taxes, healthcare, housing, relocation / Aliyah) are packaged into a verified RU / EN / FR guide library with 30-day caching on our dedicated cluster (Dedicated EU Servers + Cloudflare).

Tech Stack

Technology Stack.

Frontend & Caching

Next.js 16 (App Router, Standalone)React 19TypeScriptTailwind CSS30-Day ISR & Edge CachejsPDF

AI & RAG Engine

Vertex AIOpenAI FallbackHybrid RAG (Semantic + Lexical + FTS)AI RerankerAI Vision

Data, Auth & Billing

PostgreSQL 16 + pgvector (0.8.7)PgBouncerPostgRESTGoTrue AuthPython ETL (Selenium)Paddle Billing

Observability & Infra

Dedicated EU Servers (Web + DB Nodes)Caddy v2Cloudflare WAF & CDNSentryPostHogBrevoSlack Bot API

Preliminary Architecture Estimate

Need smart search across your company's documents, a knowledge portal, or a hallucination-free AI consultant?

Leave an inquiry — we will show how to deploy a dependable RAG system over your proprietary data.