PRODUCT / INTERNAL BUILD · REVOPS SAAS

Building a Multi-Tenant AI CRM and Business Automation Platform

Technical case study for EAIBAP (Enterprise AI Business Automation Platform): how a modular Go + PostgreSQL SaaS separates tenant CRM, workflows, integrations and FreeSWITCH voice orchestration—with honest implementation status.

Commercial packages, industry use cases and the scope estimator live on the custom AI CRM product page. This URL proves engineering approach, evidence and gaps.

Vue 3Go · GinPostgreSQLFreeSWITCH ESLMulti-tenantAI agents
Product class
Multi-tenant AI CRM + automation SaaS
Personas
Platform admin · tenant admin · staff
Scope authority
EAIBAP-SCOPE-001 (baseline blueprint)
Voice
FreeSWITCH ESL · call sessions in product DB
Honest limit
Not a generic “AI replaces your CRM” claim — modules are scoped and verified per release
EAIBAP tenant home with onboarding checklist and KPI tiles
Tenant workspace — demo/local data on the glass, not customer production metrics.

Business problem → engineering approach

  1. Business problem: revenue and operations teams lose traceability when CRM, dialers, campaigns and AI pilots are separate products with ad-hoc integrations.
  2. Engineering response: a modular monolith (Go API + PostgreSQL domain schemas) with session-bound tenancy, integration hub, workflow engine and optional voice-orchestrator beside FreeSWITCH—not replacing the media switch.
  3. Verified capabilities: IAM/tenant paths, CRM + leads APIs, integration webhooks, workflow/campaign CRUD, AI agent lifecycle UI, ESL smoke path—see status matrix below.
  4. Remaining gaps: streaming STT/TTS at scale, full RAG ingestion, enterprise OIDC SSO—tracked per requirement ID until Verified / Production Ready.
  5. Delivery roadmap: phased acceptance (discovery → foundation → workflows → AI/voice → production readiness) aligned to modules selected on the product page.

The problem (technical framing)

Revenue teams run CRM, dialers, campaigns and AI experiments in separate tools. Integrations are one-offs; tenant isolation, consent and audit trails are inconsistent. Voice is often bolted on without shared call-session state in the product database.

EAIBAP targets a modular monolith: one PostgreSQL system of record, persona-specific Vue 3 surfaces, and a voice orchestrator that does not pretend to be the PBX.

Seven product pillars

  • AI CRM and work management (accounts, opportunities, cases, tasks)
  • Voice and conversational AI (agents, orchestration, handoff)
  • Lead generation and engagement (imports, consent, routing)
  • Workflow and process automation (graph designer, runs)
  • AI knowledge and assistance (tenant-scoped RAG)
  • Integration hub (connections, mappings, webhooks)
  • Analytics and governance (audit, metering hooks)

Documentation authority (beyond UI)

The product is governed by EAIBAP-SCOPE-001 (full scope blueprint). Engineering docs in the solvedRevOps repository describe architecture, APIs, and delivery gates — the public site summarizes them; a scoped engagement includes the living doc set.

  • ARCHITECTURE.md — system context, components, migrations, request flows
  • DOMAIN_MODEL.md — entities and state machines (leads, workflows, campaigns, tenants)
  • PRODUCT_REQUIREMENTS.md — requirement IDs (TEN-, IAM-, CRM-, VOICE-, …) with priority and release phase
  • VOICE_TELEPHONY_DESIGN.md — SIP → FreeSWITCH → ESL → orchestrator; degradation paths
  • GAP_ANALYSIS.md — what is wired in code vs still production-hardening
  • API_CONTRACTS.md + OpenAPI — REST surface for Vue UI and integrations
  • DEPLOYMENT.md, RUN_LOCAL.md, SRE runbooks — operability

Capabilities are not “done” because a screen exists — each requirement carries status: Planned → In Progress → Implemented → Verified → Production Ready.

System architecture

Modular monolith in Go (Gin); PostgreSQL schemas per domain; async work via RabbitMQ workers and scheduler. The Vue 3 SPA talks HTTPS + Bearer JWT to the API. Voice is isolated in apps/voice-orchestrator (ESL to FreeSWITCH, internal port).

flowchart TB
  subgraph clients [Clients]
    Web[Vue3_Web_UI]
    FS[FreeSWITCH]
    Ext[External_webhooks]
  end
  subgraph eaibap [EAIBAP]
    API[apps_api_8080]
    Voice[voice_orchestrator_8090]
    Worker[worker]
    Sched[scheduler]
  end
  subgraph data [Data]
    PG[(PostgreSQL)]
    Redis[(Redis)]
    MQ[RabbitMQ]
  end
  Web -->|REST| API
  API --> PG
  API --> Voice
  Voice -->|ESL| FS
  Voice --> PG
  Worker --> PG
  Worker --> MQ
  Ext -->|integrations_inbound| API
        

Logical modules

ModuleSchemaResponsibility
Identity & tenantiamTenants, users, roles, teams, sessions
CRMcrmLeads, parties, accounts, pipelines, consent
CommunicationscommConversations, call sessions, messages
AIaiAgents, versions, deployments
KnowledgekbSources, documents, chunks (RAG path)
WorkflowswfDefinitions, runs, outbox
CampaignscampCampaigns, sequences, enrollments
IntegrationsintegConnections, webhooks, mappings, events
Billing / analytics / auditbilling, analytics, auditUsage, rollups, DSR, audit log

Deployable processes

ProcessPortRole
apps/api8080REST API, auth, CRUD
apps/voice-orchestrator8090ESL, call control (internal only)
apps/worker—Workflow steps, webhook delivery
apps/scheduler—Campaigns, SLA, retention jobs
web (Vite)5173Vue UI; proxies API in dev

Key request flows

  • Sign-in — POST /api/v1/auth/login → IAM session → Bearer token for all tenant APIs.
  • CRM — Handlers enforce crm.record.* permissions; every row carries tenant_id from session (not a trusted client header).
  • Outbound test call — UI → API → voice orchestrator → ESL originate → comm.call_sessions.
  • Inbound — FreeSWITCH dialplan → HTTP callback to orchestrator → session state + ESL CHANNEL_* updates.
  • Integration webhook — POST /integrations/inbound/:provider with dedupe on provider event ID.

Domain lifecycles (examples)

  • Lead: new → validating → qualified → assigned → working → converted / closed
  • Workflow run: queued → running → waiting_approval → succeeded / failed / dead_letter
  • AI agent version: draft → validated → published → deprecated
  • Campaign: draft → scheduled → running → paused / completed
  • Tenant: provisioning → active → suspended → closed

Voice and telephony

Media path: SIP → FreeSWITCH → ESL adapter → voice-orchestrator → STT/LLM/TTS adapters → tool layer → async persist to CRM, audit, billing. Real-time loop avoids blocking DB or long LLM calls on the media thread. ESL is not exposed publicly; recording/transcript access uses separate permissions (COM-008).

Degradation examples: STT failure → DTMF/transfer; LLM failure → fallback model or scripted response; object storage failure → disable new recordings only.

Industry packs (scope)

Insurance, banking/collections, cross-industry outreach, and general business operations packs are versioned modules — not hard-coded tenant conditionals in core CRM.

Implementation status matrix

Statuses are engineering gates—not marketing labels. “Implemented” means wired in codebase; “Verified” means agreed test evidence; “Production Ready” means operational checklist for your environment.

CapabilityStatusEvidence / acceptance condition
IAM, tenants, RBACImplemented → Verified (partial)pkg/iam, platform console, persona logins; SSO = Planned production gate
CRM & leads APIs + UIImplementedpkg/crm, schema-aligned forms, permission-enforced handlers
Integration hubImplementedConnections, mappings, inbound webhook dedupe, worker relay
Workflow engineImplementedGraph editor, definitions, run records; approval paths per scope
CampaignsImplemented (core CRUD)Definitions + enrollments; scale/eligibility hardening ongoing
AI agents (config)ImplementedVersions, deployments UI; production STT/LLM/TTS scale = gate
Knowledge / RAGPlanned → partialSchema path; full ingestion pipeline not production-certified
Voice orchestratorImplemented (smoke) → Verified pendingESL path, comm.call_sessions; load & language matrix in discovery
Audit & observabilityPlanned / partialHooks in scope; SRE runbooks depend on deployment tier

Gap analysis summary

From repo GAP_ANALYSIS.md: streaming speech at scale, full RAG ingestion, enterprise OIDC SSO and many requirement IDs remain Planned until verified. UI screenshots do not imply Production Ready.

AreaEvidence in build
IAM / tenantspkg/iam, tenant provisioning UI, RBAC migrations
CRM / leadspkg/crm, Leads/CRM views, §9.6-aligned forms
Voiceapps/voice-orchestrator, comm.call_sessions, dialplan curl inbound
IntegrationsConnections, webhooks, inbound dedupe, worker relay
Workflows / campaignsGraph editor UI, definitions + runs

Explicit non-goals (initial core)

Not a core banking system, policy admin, universal ERP replacement, or autonomous approver for regulated credit/claims decisions. Platform features do not by themselves prove legal compliance — customer policy and jurisdiction still apply.

Screenshots (running UI)

Captured from local demo stack — regenerate from the EAIBAP web app when UI changes.

EAIBAP login with Platform, Tenant and Staff tabs
Sign-in — three personas, environment badge visible in local mode.
EAIBAP integrations connections table
Integrations — connections, mappings, webhooks, allowlist tabs.
EAIBAP CRM accounts and pipeline view
CRM — schema-aligned forms, not one-field placeholders.
EAIBAP conversations and call sessions
Conversations — message threads and call session visibility.
EAIBAP AI agents versions and deployments
AI agents — configuration and deployment lifecycle.
EAIBAP workflow graph editor
Workflows — visual graph editor with auditable runs.
EAIBAP platform administrator login
Platform admin entry — separate from tenant workspace.
EAIBAP platform console tenant list
Platform console — tenant provisioning and lifecycle.

FAQ — buyer & architecture questions

Ten questions teams ask when evaluating custom AI CRM and automation platforms — phrased the way procurement and engineering search.

Software that unifies CRM records, lead lifecycle, outbound/inbound engagement, workflow automation, optional RAG knowledge and AI agents — with tenant isolation and audit trails. EAIBAP is one documented blueprint (EAIBAP-SCOPE-001) implemented as Go + PostgreSQL + Vue 3, not a generic “AI wrapper” on a spreadsheet.

No. UnifiedPBX.in is a build practice. You commission phased delivery, operate the stack yourself, or white-label to your customers. Start with the product estimator.

Suites optimize for fastest time-to-CRM on their cloud. EAIBAP optimizes for your tenancy model, telephony-native call sessions, integration hub and vertical packs you control. Choose suites for commodity CRM; choose EAIBAP-style builds when the platform is the product you sell.

No. AI receptionist is a narrower FastAPI control plane for receptionist workflows. EAIBAP is the wider RevOps monolith (CRM, campaigns, integration hub, broader automation). They can coexist in one practice; they are different SKUs.

SIP and RTP stay on FreeSWITCH. apps/voice-orchestrator consumes ESL events, runs the real-time STT/LLM/TTS loop off the media thread, and persists comm.call_sessions. ESL is not exposed publicly. See voice section above.

Baseline: IAM/tenants, CRM and leads APIs, integration connections and webhooks, workflow and campaign CRUD, AI agent lifecycle UI, orchestrator ESL smoke path. Production gates: streaming speech at scale, full RAG ingestion pipeline, enterprise OIDC SSO — tracked in gap analysis and requirement IDs.

Often yes. If power dialing and supervisor tools are the core, read VoIP CRM & power dialer first. EAIBAP fits when campaigns, AI agents, knowledge and multi-module automation are on the same roadmap.

Tenants configure connections, field mappings and outbound webhooks; inbound provider events hit /integrations/inbound/:provider with dedupe on provider event IDs. Workers relay async delivery — see request flows.

PBX or CPaaS stack, CRM today, tenant count, regulated industry, modules you need in phase 1, languages, and deadline. Use the project brief or email hello@unifiedpbx.in — screenshots of your current pain beat a generic RFP.

Compliance (GDPR/HIPAA) and industry packs require explicit customer policy and jurisdiction — the scope document defines posture; legal sign-off remains the customer’s process.