Law firms in the UAE operate in a bilingual legal environment with strict data privacy requirements.
Existing AI tools are cloud-based (violating privilege), expensive ($500+/seat/month), and English-only.
Juriqa AI gives every lawyer in a firm their own suite of autonomous AI agents —
for research, document review, deadline tracking, billing, and compliance — all running on the firm's
own infrastructure with open-source models. Arabic-first. Self-hosted. Private.
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | Next.js 15 + Tailwind 4 + shadcn/ui | Dashboard app |
| i18n | next-intl | Arabic + English, RTL/LTR toggle |
| Backend | Next.js API routes + tRPC | Type-safe API |
| Database | PostgreSQL 17 + pgvector + Drizzle | Multi-tenant data + vector search |
| Auth | Better Auth | Self-hosted, multi-tenant |
| Real-time | Socket.io + Redis Pub/Sub | Live agent feed |
| LLM Serving | vLLM | OpenAI-compatible, PagedAttention |
| Arabic LLM | Jais-2-70B (MBZUAI/G42) | #1 Arabic model — Gulf Arabic legal reasoning |
| Reasoning LLM | Qwen3.5-35B-A3B (default) / Llama 3.3-70B / Qwen3.5-122B-A10B | 3 tiers, admin-selectable per firm |
| Embeddings | bge-m3 | Arabic vector search (dense + sparse) |
| Arabic OCR | Surya + EasyOCR | Scanned Arabic legal documents |
| Arabic NLP | CAMeL Tools | Tokenization, normalization |
| Agent Runtime | OpenClaw 3.22+ | Autonomous agent execution |
| File Storage | MinIO | S3-compatible document store |
| Reverse Proxy | Nginx + Certbot | TLS, WebSocket routing |
| Deployment | Docker Compose (split: app + gpu) | Single-command deploy |
| Monorepo | Turborepo | Build caching, workspace management |
Case law lookup, statute search, precedent analysis. Searches UAE Federal Law, DIFC/ADGM regulations.
Contract review, drafting, summarization, risk flagging, key clause extraction. Arabic + English OCR.
Court dates, filing deadlines, statute of limitations tracking. Auto-scans documents for dates.
Intake forms, follow-up scheduling, status updates. Manages client communication pipeline.
Auto-tracks time from agent activity, categorizes by case, generates invoice data.
Flags potential ethical issues, monitors regulatory updates, filing deadline reminders.
| Phase | Tasks | Status | Details |
|---|---|---|---|
| 1. Scaffold | 2 | Done | Turborepo monorepo, Docker Compose (app + gpu split), Dockerfiles |
| 2. DB & Auth | 3 | Done | Drizzle ORM, schema-per-tenant, Better Auth, RBAC middleware |
| 3. Dashboard Shell | 4 | Done | i18n/RTL, sidebar, header, activity terminal, 6-panel home, auth pages |
| 4. Core Features | 5 | Done | Cases table + filters, Deadlines with urgency colors, Documents with AI summaries + risk flags, Billing with AED tracking, Agent Chat with mock conversations, Agents status cards |
| 5. Agent Integration | 5 | Done | OpenClaw runEmbeddedPiAgent(), vLLM client (Jais+Qwen), 6 agent configs with Arabic system prompts, Socket.io event wiring, language-aware routing |
| 6. Analytics & Admin | 3 | Done | Firm-wide metrics, workload distribution bars, agent performance table, vLLM model usage, admin settings (members, language, agent toggle) |
| 7. Deployment | 3 | Done | Docker Compose split (app + gpu), Nginx + Certbot TLS, CLAUDE.md, dev server verified — all 11 pages live |
/ — 6-panel grid (agents, deadlines, cases, docs, billing, activity)/cases — Filterable table with UAE law firm cases/deadlines — Color-coded urgency (DIFC filings, SOL)/documents — Upload zone, AI summaries, risk flags/billing — AED tracking, time entries with agent attribution/chat — Agent selector + legal research conversations/agents — 6 agent cards with start/pause/restart/analytics — Firm metrics, workload bars, vLLM usage/settings — Members, language toggle, agent config/login + /register — Auth with AR/EN switcher
Dev server: http://localhost:3000 | Auth bypassed in dev mode | All data is mock — wire to DB next
| Model | Origin | Arabic | English | VRAM (4-bit) | Context | License |
|---|---|---|---|---|---|---|
| Jais-2-70B | UAE (MBZUAI/G42) | Best (70.7%) | Moderate (78.9%) | ~38 GB | 8K | Apache 2.0 |
| Llama 3.3-70B | US (Meta) | Weak (63.1%) | Best (92.1%) | ~38 GB | 128K | Llama Community |
| Qwen3.5-35B-A3B | China (Alibaba) | Good | Good | ~20 GB | 128K | Apache 2.0 |
| Qwen3.5-122B-A10B | China (Alibaba) | Strong | Excellent | ~35 GB | 128K | Apache 2.0 |
| bge-m3 | China (BAAI) | Strong | Strong | ~1 GB | — | MIT |
Safest compliance story. No Chinese or US model dependencies.
Total: ~77 GB — tight on 1x A100, comfortable on 2x GPUs
Sell: "Your AI is UAE-built and US-backed. Zero Chinese tech."
Best Arabic + strong reasoning. Fits one GPU.
Total: ~59 GB — comfortable on 1x A100 80GB
Sell: "Best Arabic AI on the market + fast English reasoning."
Strongest reasoning. For firms that want the best, origin aside.
Total: ~74 GB — fits 1x A100 80GB
Sell: "Most powerful legal AI available. Period."
Arabic benchmarks: AraGen-12-24 (3C3H Score) | English benchmarks: IFEval Strict 0-shot | Jais-2-70B outperforms Qwen & Llama on Arabic by 8-10% | Admin selects tier in Settings → applies to all firm agents
render prop, not asChild.
sql.unsafe() expects typed params, not unknown[]. Use as any for dynamic query params — acceptable since we're already in unsafe territory.
runEmbeddedPiAgent from openclaw/extension-api (NOT plugin-sdk).
No .d.ts shipped — manual type declarations needed. Per-user isolation via separate workspace dirs and session files.
SOUL.md in workspace acts as system prompt. Config built dynamically per user with vLLM providers.
@import url() in CSS with Tailwind — Tailwind's processing pushes it below other rules.
Use <link> tags in layout.tsx <head> instead for Arabic fonts (Noto Naskh/Kufi Arabic).