CRMA — AI-Native CRM
A multi-tenant CRM and sales operations platform designed around controlled workflows, deterministic business rules and AI actions that require explicit human review before consequential changes.
Stack: Laravel 12 · React 19 · MySQL · Redis/Horizon · Workflow Engine · Governed Agent Runtime · Arabic RTL
Engineering capability showcase · seeded demonstration data

Built as an engineering capability showcase for modern CRM, workflow automation and governed AI systems. Every screen shows the running application on seeded demonstration data.
Sales operations in one place
Contacts, leads, tasks, deals, the pipeline and reporting share one data model and one permission model, so a change in one module is visible in the others.

Pipeline value, open deals, today's tasks and recent activity for the signed-in team.
From first contact to measured result
Every record follows one path. Automation and AI sit inside it; neither can skip the step where a person decides.
- 01
Capture
Forms, imports, signed webhooks and manual entry create leads and contacts.
- 02
Qualify
Rule-based lead scoring with a per-rule explanation; owners assigned.
- 03
Automate
Workflows react to record, email, form, schedule and webhook events.
- 04
Sell
Deals move through pipeline stages; every stage change is recorded.
- 05
Assist
Agents read CRM context and draft proposals — they never write directly.
- 06
Approve
A person reviews the proposed change, its risk and its evidence.
- 07
Measure
Reports, deal health and the audit log read the resulting state.
Approval is a step in the flow, not an optional setting: governed actions cannot execute without a decision.
Business state is computed from CRM data, not guessed by the model.
Scores, health and pipeline review come from fixed, testable rules over stored records. The language model may explain a number; it never produces one.


Pipeline stages
Configured stages per organization; deals carry a stage and a status.
Deal health
A deterministic signal calculator scores each deal from activity, age and stage — AI may explain it but never produces it.
Pipeline review
Pipeline intelligence summarises stalled and at-risk deals from the same rules, with thresholds held in configuration.
Lead scoring
Priority, status, 30-day engagement, recency, contact completeness and value, each with its own rule and points, capped at 100.
Stage history
Every stage change is written to its own table, so time-in-stage is measured, not estimated.
Tasks & follow-up
Due and overdue work is counted per owner for the daily brief and the hourly proactive scan.
Automation you can read before it runs
Workflows are drawn as graphs, synced to executable triggers and actions, and validated before they can be activated.
01
Trigger
Record created or updated, email opened, clicked or replied, form submitted, cron schedule, signed inbound webhook.
02
Condition
A typed expression language evaluates conditions — no eval() — with an audit command for existing workflows.
03
Action
Controlled actions on CRM records, waits and delays, resumed by a scheduler every minute.

Graph-defined
The visual graph is the source; trigger and action rows are synced from it.
Validated activation
A workflow with errors cannot be switched on; the errors are returned to the builder.
Waits
Wait and delay steps park a run; a scheduled job resumes due runs every minute.
Event-driven
Record, email, form, schedule and webhook events start runs on queued workers.
AI proposes.Humans decide.
Agents work inside CRM context with a tool allowlist per profile. Anything that changes data becomes a proposal: the stored current state, the proposed state, a reason, evidence and a risk class — waiting for a person.
CRM context
Records the user can already see, scoped to their organization.
Agent runtime
One of 14 agent profiles, each with its own tool allowlist.
Tool
Read tools answer directly; write tools can only propose.
Proposal
Stored with reason and evidence; expires after 72 hours by default.
Field-level diff
Current and proposed values, side by side.
Risk
One of five risk classes decides how it may be approved.
Human approval
Approve, reject — or edit an email or WhatsApp draft, which is validated again.
Controlled execution
Executed by the action handler, written to the audit log.
Resume
The same agent run continues with the outcome.

deal.stage_changeMedium writePending review| Field | Current | Proposed |
|---|---|---|
stage | Proposal | |
stage_id | 2 |
Recreated from the proposal shown above. The proposal stores the before and after state; the reviewer sees both before anything changes.
Risk classes
READReads only. Nothing to approve.LOW_WRITESmall internal writes. May be approved in bulk.MEDIUM_WRITERecord changes. May be approved in bulk.HIGH_EXTERNALLeaves the system — email, WhatsApp. Never in bulk.CRITICALReviewed one at a time. Never in bulk.
Eight governed action types
Create task, add note, update record, change deal stage, assign lead, draft workflow, send email, send WhatsApp.
Same-run resume
A run pauses while waiting for a decision and resumes the same run afterwards — covered by runtime tests.
Edited drafts are revalidated
A reviewer can edit an outbound email or WhatsApp draft; the edit is a new revision and is checked again.
Everything is audited
Proposed, revised, rejected and executed events are written to the audit log.
The copilot turns on these screens were recorded with the deterministic test driver, so the tool sequence is repeatable.
Answers grounded in the organization's own documents
Hybrid retrieval: keyword ranking and vector similarity, fused into one result list, with an evaluation command that fails when quality drops.
01
Ingest
Text, file or URL; URLs fetched through the SSRF-safe fetcher.
02
BM25
Keyword ranking over full-text candidates.
03
Vector
Cosine similarity over stored embeddings.
04
Fusion
Reciprocal rank fusion merges both lists.
05
Evaluate
kb:eval reports recall@k and MRR against thresholds.

Fusion ranking
BM25 plus vector similarity, merged with reciprocal rank fusion.
Sized for a team's knowledge
Vector similarity is computed in the application over a bounded set of recent chunks.
Measured, not assumed
Retrieval quality has a command and thresholds, so a regression fails loudly.
Three tiers, one tenant boundary
Recreated from the codebase: what talks to the application, what runs inside it, and what it depends on.
Clients & inbound
Web app
Inertia + React 19, English and Arabic.
REST API
/api/v1 — 244 routes.
MCP clients
OAuth 2.1, PKCE S256.
Signed webhooks
Twilio, Stripe, Meta, workflow hooks.
Application · Laravel 12
Tenant boundary
Organization global scope, RBAC per organization, 49 policies.
CRM domain
Contacts, leads, deals, tasks, pipeline, reports.
Workflow engine
Graph sync, typed expressions, waits.
Agent runtime
14 profiles, 39 registered tools.
Action engine
Proposals, risk, approval, execution.
Pipeline intelligence
Deterministic deal and lead signals.
Knowledge retrieval
BM25 + vector + RRF.
Async, data & external
MySQL
168 migrations.
Redis · Horizon
Queues for email, AI agents, webhooks, WhatsApp, imports.
Scheduler
Workflow resume each minute, proposal expiry, hourly scan.
Reverb
WebSocket server in the compose stack.
Model providers
Anthropic, OpenAI, OpenAI-compatible — keys encrypted.
Deployment design
Docker Compose: app · nginx · mysql · redis · horizon · scheduler · reverb. Release script with atomic symlink swap, health check and rollback.
Specific controls, each in code and tests
No blanket claims. These are the mechanisms the repository implements.
Tenant isolation
A global organization scope on tenant models, cross-tenant validation rules, and dedicated tenancy tests.
Per-organization RBAC
Roles and permissions keyed to the organization, with API/UI policy parity tests.
Two-factor and sessions
TOTP two-factor, session list and revoke, IP allowlist, rate limiting.
SCIM provisioning
SCIM endpoints with their own authentication for user lifecycle.
SSRF-safe fetching
Public-IP validation, a pinned connection and re-validation on every redirect, with a body size cap.
Idempotency and headers
Idempotency keys on writes and a security-headers middleware.
AI tool allowlists
Each agent profile can only call the tools it lists.
Audit trail
AI proposals, revisions, rejections and executions are written to the audit log.

What is built, and what is a connector
Two different things, kept apart.
Implemented
In the codebase, with tests or verification logic
MCP server
OAuth 2.1 with PKCE S256, hashed audience-bound tokens, rotating refresh tokens with reuse detection; scopes crm:read and crm:propose. MCP writes become proposals.
External MCP client
HTTPS only and SSRF-validated. An admin approves each read-only tool; approval is revoked if the tool changes.
Signed webhooks
Twilio signature validation, Stripe event construction, Meta lead HMAC verification, inbound workflow hooks.
Model router
Anthropic, OpenAI and OpenAI-compatible endpoints (including a local Ollama), bring-your-own-key credentials encrypted at rest, usage recorded per call.
Connector architecture
Lightweight HTTP connectors, shown disconnected
Google Workspace
OAuth connection; reads profile and Gmail message list.
Slack · n8n
OAuth or token connections through the same connector catalog.

One responsive product. No separate mobile application.
The same Inertia app at a 390 px phone viewport: the dashboard, the pipeline, a deal and the AI Action Center.

Dashboard

Pipeline

Deal workspace

AI Action Center
Captured at 390 × 844 at 3× density. The Arabic Action Center has an automated check at 390, 430, 768, 1024 and 1440 px.
Arabic & English, natively.
Direction is switched at runtime, not faked with translated strings: layout, navigation and the board mirror as a whole.


- Language, RTL and direction contexts set the document direction at runtime.
- Full Arabic message catalogue alongside English.
- A locale middleware carries the choice across requests.
- The Arabic Action Center is checked across five viewport widths.
Repository evidence
Counts from the CRMA codebase, not business results.
Measured: 14 October 2026 · route count from route:list, other counts from the repository tree
- HTTP routes
- 1,098
- /api/v1 routes
- 244
- Eloquent models
- 150
- Migrations
- 168
- Controllers
- 155
- Authorization policies
- 49
- Inertia pages
- 183
- Queued jobs
- 25
- Governed action types
- 8
- Registered AI tools
- 39
- Agent profiles
- 14
- Playwright specs
- 22
Test files
421 PHP test files · 269 frontend test files · 22 Playwright specs
File counts from the repository tree.
More screens
The running application on seeded, fictional data. Select a screen to view it full size.
Need these capabilities?
The same engineering, applied to your operation.
- Custom SaaS PlatformsMulti-tenant products with real isolation and per-organization roles.
- CRM / ERP SystemsPipelines, records and reporting shaped around how you sell and deliver.
- Backend Systems & APIsVersioned APIs, queues, schedulers and signed webhooks.
- Business AutomationWorkflows that are validated before they run.
- AI Operational WorkflowsAgents that propose, with people who approve.
- IntegrationsOAuth, MCP and webhook integrations with verification built in.
Need a system like this?
HexaTerminal designs and builds custom CRM, ERP, SaaS, automation and AI-enabled business systems around real operational workflows.
