MTS Logo
Enterprise Multi-Tenant SaaS Platform

MTS AI Agent Studio

Technical Architecture & Product Documentation

Version 2.4.0 July 2026 Confidential
Laravel 12 Filament v5 7 LLM Providers RAG Engine
01

Table of Contents

01

Executive Summary

MTS AI Agent Studio is a comprehensive enterprise-grade multi-tenant SaaS platform for building, deploying, and managing AI-powered conversational agents with integrated knowledge bases, workflow automation, and a marketplace ecosystem.

15+

Core Modules

7

LLM Providers

46

Database Tables

53

RBAC Permissions

36

Eloquent Models

Key Differentiators

Multi-Provider LLM Gateway

Unified API abstraction across OpenAI, Anthropic, Google, DeepSeek, and local Ollama. Hot-switch providers without code changes.

Hybrid Multi-Tenancy

Shared database with org scoping by default, isolated DB option for enterprise tenants. Full data isolation at every layer.

RAG Engine

Full Retrieval-Augmented Generation pipeline with multi-format document ingestion, intelligent chunking, vector embeddings via Qdrant.

Visual Workflow Builder

Drag-and-drop multi-step workflow orchestration with triggers, AI steps, conditional branching, loops, and external integrations.

02

Product Purpose and Vision

Why This Product Exists

Vendor Lock-in Elimination

Unlike proprietary platforms, MTS AI Agent Studio provides a provider-agnostic gateway. Switch between OpenAI, Claude, Gemini, or self-hosted models without rewriting a single line of agent logic.

Enterprise Governance

Built-in RBAC with 53 granular permissions, organization-level isolation, comprehensive audit logging, and compliance-ready data handling for regulated industries.

No-Code Agent Builder

Business users can configure, test, and deploy AI agents through a visual interface. Pre-built templates accelerate time-to-value without prompt engineering expertise.

Knowledge Grounding

Integrated RAG pipeline transforms static documents into intelligent, context-aware responses. Upload PDFs, wikis, or databases and have agents answer from verified sources.

Vision Statement

"To democratize enterprise AI by providing an open, secure, and infinitely extensible platform where every organization can build, deploy, and scale intelligent agents without compromising on control, compliance, or choice."

Core Values

Openness

Open-source core, provider-agnostic, no vendor lock-in

Security

Enterprise-grade encryption, RBAC, and audit trails

Scalability

Horizontal scaling, queue-based processing, caching

Extensibility

Plugin marketplace, custom tools, workflow hooks

03

Target Customers and Use Cases

Customer Segments

E

Enterprise and Corporate

Large organizations with 500+ employees needing governed AI deployment, compliance, and multi-department agent management.

  • Multi-department isolation
  • SSO and SCIM provisioning
  • Dedicated infrastructure option
  • SLA guarantees (99.99%)
S

SaaS Companies

B2B SaaS platforms looking to embed AI agents as features within their own products via API and white-label solutions.

  • White-label deployment
  • Full REST API access
  • Usage-based billing integration
  • Multi-tenant data isolation
S

Startups and SMBs

Small teams needing rapid AI agent deployment with minimal technical overhead and cost-effective pricing tiers.

  • Free tier available
  • Pre-built agent templates
  • No-code configuration
  • Community support

Industry Use Cases

Healthcare

Patient intake automation, symptom triage, appointment scheduling, medical record Q&A with HIPAA-compliant knowledge bases.

Finance

Portfolio analysis, fraud detection alerts, regulatory compliance checking, client onboarding with KYC document processing.

E-Commerce

Product recommendations, order tracking, returns processing, inventory queries, personalized shopping assistance.

Legal

Contract review, legal research, case law retrieval, compliance document analysis, client intake automation.

Education

Student tutoring, course material Q&A, admission assistance, grading support, research paper analysis.

Real Estate

Property matching, virtual tour guidance, mortgage calculation, tenant screening, lease document analysis.

04

System Architecture

Architecture Layer Diagram

Client Layer

Web App (Filament) Mobile App API Clients Widget (Embed)

Application Layer

Laravel 12.63 Filament v5.6 Livewire 4.3 Sanctum Auth Spatie RBAC

Service Layer

LLM Gateway RAG Engine Workflow Engine Usage Tracker Marketplace

Data Layer

MySQL/MariaDB Redis Cache Qdrant Vectors S3 Storage

External Providers

OpenAI API Anthropic API Google Gemini DeepSeek API Ollama (Local)

Multi-Tenancy Model

S

Shared Database (Default)

All tenants share a single database instance with organization_id column scoping on every table. Cost-effective for SMBs and startups.

  • Lower infrastructure cost
  • Easier maintenance and updates
  • Global query scopes enforce isolation
  • Middleware-level org binding
I

Isolated Database (Enterprise)

Each enterprise tenant gets a dedicated database instance with separate credentials and network segmentation for maximum data isolation.

  • Physical data separation
  • Custom backup and retention policies
  • Dedicated Redis namespace
  • Network-level isolation
05

Technology Stack

CategoryTechnologyVersion
BackendPHP, Laravel, LivewirePHP 8.2, Laravel 12.63, Livewire 4.3
FrontendTailwindCSS, Alpine.js, Filament, Chart.jsTailwind 4.x, Filament v5.6, Chart.js 4.x
DatabaseMySQL/MariaDB, Redis, QdrantMariaDB 10.4+, Redis 7.x, Qdrant 1.x
AuthLaravel Sanctum, Spatie PermissionSanctum 4.x, Spatie 6.x
AI SDKsOpenAI, Anthropic, Google, DeepSeek, OllamaOfficial PHP/HTTP SDKs, 2024+ APIs
DevOpsDocker, Kubernetes, GitHub ActionsDocker 24.x, K8s 1.29+, GHA YAML
BillingStripe, Usage Tracking EngineStripe API 2024-12, Custom metering
06

Database Architecture

46 tables organized across 9 functional modules, all scoped to organizations via organization_id for multi-tenant isolation.

ModuleTablesCount
Core / Authusers, organizations, organization_members, roles, permissions, workspaces6
AI Agentsai_agents, agent_templates, agent_tools3
Conversationsconversations, messages, message_feedbacks3
Knowledge Base (RAG)knowledge_bases, documents, document_chunks, embeddings4
Workflowsworkflows, workflow_steps, workflow_executions3
Marketplacemarketplace_items, marketplace_categories, marketplace_reviews, plugin_installations4
Billingsubscriptions, plans, invoices, usages, payment_methods5
Analyticsaudit_logs, analytics_events, api_keys3
Systemprompt_templates, api_endpoints, webhooks, integrations, notifications5
TotalAll modules combined36+

Note: Additional junction tables (model_has_roles, role_has_permissions, etc.), migration tracking tables, and session tables bring the total to 46. Every business table includes organization_id, created_at, updated_at, and soft delete support.

07

Core Modules Breakdown

Comprehensive overview of all platform modules with configurations, sample data, and technical details.

7a

AI Agent Builder

Create and configure AI agents with model selection, system prompts, temperature tuning, token limits, and pre-built templates. Each agent supports multi-turn conversations with persistent memory.

AAtlasCEO Strategy

Strategic planning and executive decision support. Analyzes market data and generates business plans.

GPT-4oTemp: 0.7Tokens: 4096
NNovaSales Navigator

Lead qualification, pipeline management, and sales conversation coaching with CRM integration.

GPT-4oTemp: 0.5Tokens: 2048
PPixelContent Creator

Blog posts, social media content, marketing copy with tone customization and brand voice.

Claude 3.5 SonnetTemp: 0.9Tokens: 4096
SSentinelSecurity Analyst

Threat assessment, vulnerability analysis, and security compliance monitoring.

Claude 3.5 SonnetTemp: 0.2Tokens: 4096
SSageKnowledge Manager

Document search, knowledge retrieval, and FAQ automation powered by RAG pipeline.

GPT-4o-miniTemp: 0.3Tokens: 2048
FForgeCode Assistant

Code generation, review, debugging, and refactoring with multi-language support.

GPT-4oTemp: 0.4Tokens: 8192
PPulseCustomer Support

First-line customer support with ticket routing, sentiment analysis, and escalation.

GPT-4o-miniTemp: 0.5Tokens: 2048
HHarmonyHR Assistant

Policy Q&A, onboarding automation, leave management with privacy-compliant access.

Gemini 1.5 ProTemp: 0.5Tokens: 2048
7c

Knowledge Base (RAG Engine)

Full Retrieval-Augmented Generation pipeline transforming static documents into intelligent, context-aware responses.

Document Ingestion Pipeline

Upload Parse Chunk Embed Store Retrieve

Supported Formats

PDFDOCXTXTCSVHTML

Chunking Strategies

  • Fixed-size (512/1024/2048 tokens)
  • Semantic paragraph splitting
  • Recursive character division
  • Document-structure aware

Sample Knowledge Base: Acme Corp Documentation

1,247

Documents

89,432

Chunks

Qdrant

Vector Backend

7d

Workflow Engine

Visual workflow builder for multi-step agent orchestration with triggers, AI inference, conditional branching, loops, and external action integrations.

Builder Components

Trigger AI Step Condition Action Loop Output
Sample Workflow: Customer Support Escalation

TRIGGER

New Message

AI STEP

Sentiment Analysis

CONDITION

Negative > 0.7?

ACTION

Escalate to Manager

AI STEP

Draft Response

OUTPUT

Send and Log

7b

Chat Interface

Real-time conversational UI built with Livewire for server-side reactivity. Features conversation sidebar, message history, typing indicators, and agent switching.

MTS AI Agent Studio Chat
What was our Q2 revenue growth compared to last year?
A
Based on the Q2 financial reports in the knowledge base, your organization achieved a 23.4% revenue growth YoY, driven primarily by the Enterprise segment (+31.2%) and Professional services (+18.7%).
Show me the breakdown by product line
A
Q2 product line breakdown:
Agent Studio SaaS: $4.2M (+28%)
Enterprise Licenses: $2.8M (+19%)
Professional Services: $1.9M (+22%)
Marketplace Revenue: $0.8M (+67%)
7e

Marketplace

Community-driven plugin ecosystem with categories, ratings, install counts, and both free and paid listings.

Free★★★★★ (142)

Customer Support Bundle

Pre-trained agent + 500 Q&A pairs + escalation workflow

2,847 installsby MTS Team
$29/mo★★★★ (87)

Legal Document Analyzer

AI-powered contract review with clause extraction and risk scoring

1,203 installsby LexiTech
$49/mo★★★★★ (203)

Healthcare Triage Suite

HIPAA-compliant patient intake, symptom checker, and routing

956 installsby MedAI Corp
7f

Billing and Subscriptions

Stripe-integrated subscription management with usage-based metering, tiered pricing, and automated invoicing.

Starter

Perfect for individuals and small teams getting started with AI agents

₹1,499/mo

or ₹11,999/yr · Save 33%

1

Products

1

Users

500

AI Queries/Day

  • 1 AI Agent
  • 500 AI Queries/month
  • 1 User Seat
  • 1 LLM Provider
  • Basic RAG (100 docs)
  • Email Support
Most Popular

Professional

For growing businesses that need multiple agents and team collaboration

₹4,999/mo

or ₹39,999/yr · Save 33%

5

Products

5

Users

5,000

AI Queries/Day

  • 5 AI Agents
  • 5,000 AI Queries/month
  • 5 User Seats
  • 3 LLM Providers
  • Advanced RAG (1,000 docs)
  • Multi-Agent Orchestration
  • Priority Support
  • API Access

Enterprise

For organizations requiring unlimited scale and enterprise-grade features

₹14,999/mo

or ₹119,999/yr · Save 33%

Unlimited

Products

Unlimited

Users

Unlimited

AI Queries/Day

  • Unlimited AI Agents
  • Unlimited AI Queries
  • All LLM Providers
  • Unlimited RAG Documents
  • Custom Agent Development
  • White-Label Options
  • SLA & 24/7 Support
  • On-Premise Deployment
7g

Analytics Dashboard

Real-time operational intelligence with 6 Chart.js visualizations, KPI stat cards, agent leaderboard, and system health.

24,891

Messages (30d)

↑ 12.3%

1,247

Active Conversations

↑ 8.7%

$3,421

API Cost (30d)

↑ 2.1%

99.7%

Uptime (30d)

↑ 0.1%

Chart Visualizations

  • Messages Over Time (Line)
  • Token Usage by Model (Bar)
  • Cost Breakdown (Doughnut)
  • Agent Performance (Radar)
  • Response Latency (Area)
  • User Satisfaction (Polar)

Agent Leaderboard

  • 1. Atlas14,231 msgs
  • 2. Pulse11,892 msgs
  • 3. Sage8,456 msgs
  • 4. Nova5,234 msgs
  • 5. Forge3,891 msgs

System Health

  • API Response142ms avg
  • Queue Depth23 jobs
  • Cache Hit Rate94.2%
  • DB Connections12/100
  • Redis Memory2.1GB / 4GB
7h

Admin Panel (Filament v5)

Full-featured admin dashboard with 9 resources, 26 pages, and 5 dashboard widgets for complete platform management.

Filament Resources
AiAgentResourceCRUD + Builder Wizard + Chat Preview
ConversationResourceList + View + Export + Stats
MessageResourceThread View + Feedback + Metadata
KnowledgeBaseResourceCRUD + Upload + Re-index + Search Test
DocumentResourceUpload + Chunk Preview + Embed Status
WorkflowResourceVisual Builder + Execution History
MarketplaceItemResourcePublish + Pricing + Analytics
SubscriptionResourceManage + Upgrade + Invoice History
AuditLogResourceRead-only + Filter + Export
7i

REST API

17 RESTful API endpoints for programmatic access. Authenticated via Laravel Sanctum bearer tokens with rate limiting.

MethodEndpointDescription
GET/api/v1/agentsList all agents
POST/api/v1/agentsCreate new agent
PUT/api/v1/agents/{id}Update agent
DEL/api/v1/agents/{id}Delete agent
GET/api/v1/conversationsList conversations
POST/api/v1/conversationsStart conversation
POST/api/v1/conversations/{id}/messagesSend message
GET/api/v1/knowledge-basesList knowledge bases
POST/api/v1/knowledge-bases/{id}/documentsUpload document
GET/api/v1/analytics/overviewAnalytics summary

Sample Request / Response

// POST /api/v1/agents
Authorization: Bearer mts_sk_a1b2c3d4e5f6...
Content-Type: application/json

{
  "name": "Finley",
  "role": "Financial Analyst",
  "model": "gpt-4o",
  "temperature": 0.4,
  "max_tokens": 4096,
  "knowledge_base_ids": [1, 3]
}

// Response 201 Created
{
  "id": 9,
  "name": "Finley",
  "status": "active",
  "created_at": "2026-07-12T10:30:00Z"
}
7j

RBAC and Security

Role-Based Access Control powered by Spatie Permission with 5 hierarchical roles and 53 granular permissions.

RoleLevelKey Permissions
super-admin100All permissions, system config, tenant management
admin80Agent CRUD, user management, billing, analytics
manager60Agent CRUD, knowledge bases, workflows, conversations
member40View agents, use chat, view knowledge bases
viewer20Read-only access to dashboards and reports

Security Measures

CSRF Protection

Token-based cross-site request forgery prevention on all forms

XSS Prevention

Output encoding and Content Security Policy headers

SQL Injection Protection

Eloquent ORM parameterized queries throughout

Rate Limiting

Configurable per-route and per-user request throttling

Audit Logging

Complete activity trail for compliance and forensics

Encryption

AES-256 at rest, TLS 1.3 in transit for all data

08

AI Engine and LLM Integration

The LLMGateway singleton pattern provides a unified abstraction across 7 LLM providers, enabling hot-swapping without application changes.

Supported Models and Pricing

ProviderModelInput CostOutput CostContext
OpenAIgpt-4o$2.50 / 1M$10.00 / 1M128K
OpenAIgpt-4o-mini$0.15 / 1M$0.60 / 1M128K
OpenAIgpt-4-turbo$10.00 / 1M$30.00 / 1M128K
OpenAIo3-mini$1.10 / 1M$4.40 / 1M200K
Anthropicclaude-3.5-sonnet$3.00 / 1M$15.00 / 1M200K
Anthropicclaude-3.5-haiku$0.80 / 1M$4.00 / 1M200K
Googlegemini-1.5-pro$1.25 / 1M$5.00 / 1M2M
Googlegemini-1.5-flash$0.075 / 1M$0.30 / 1M1M
DeepSeekdeepseek-chat$0.14 / 1M$0.28 / 1M128K
DeepSeekdeepseek-reasoner$0.55 / 1M$2.19 / 1M128K
Ollamallama3.1 / mixtralSelf-hosted$0.00Varies

Cost Calculation Formula

// Per-message cost calculation

total_cost = (input_tokens / 1,000,000) * input_price

+ (output_tokens / 1,000,000) * output_price

// Monthly organization usage

monthly_cost = SUM(all_message_costs) * (1 + markup)

RAG Pipeline Architecture

DOCUMENT

PDF, DOCX, TXT

CHUNK

512 tokens

EMBED

text-embedding-3

VECTOR STORE

Qdrant

RETRIEVE

Top-K search

INJECT

Into prompt

09

Deployment and DevOps

Production-ready deployment with Docker Compose for single-node and Kubernetes manifests for high-availability clusters.

Docker Compose Services (7 containers)

ServiceImagePortPurpose
appphp:8.2-fpm9000Laravel application server
nginxnginx:alpine80, 443Reverse proxy and static assets
mysqlmariadb:10.43306Primary relational database
redisredis:7-alpine6379Cache, sessions, queue broker
qdrantqdrant/qdrant:v16333Vector database for RAG
ollamaollama/ollama:latest11434Local LLM inference (optional)
workerphp:8.2-fpm-Laravel queue worker

Kubernetes Manifests (8 resources)

Deployment

App, worker replicas

Service

ClusterIP/NodePort

ConfigMap

Env variables

Secret

API keys, passwords

Ingress

TLS, routing rules

HPA

Auto-scaling rules

PDB

Pod disruption budget

PVC

Persistent storage

CI/CD Pipeline (GitHub Actions)

Push to main

git push

Lint and Test

PHPStan + PHPUnit

Build Docker

Multi-stage build

Push Registry

ghcr.io

Deploy K8s

Rolling update

Health Check

Smoke tests

10

Roadmap

Strategic feature development timeline across the next three quarters.

Q3

Q3 2026

Current Quarter
  • Streaming response support (SSE)
  • Voice input/output agents
  • WebSocket real-time updates
  • Agent conversation branching
  • Multi-language support (i18n)
Q4

Q4 2026

Next Quarter
  • Multi-modal agents (image, audio, video)
  • Fine-tuning pipeline integration
  • A/B testing for agent responses
  • Advanced workflow debugger
  • Custom embedding model support
Q1

Q1 2027

Future
  • Enterprise SSO (SAML 2.0, OIDC)
  • Advanced analytics with ML insights
  • Federated multi-org management
  • SOC 2 Type II certification
  • On-premise deployment option
11

Security and Compliance

Enterprise-grade security architecture with defense-in-depth strategies and compliance-ready data handling.

Data Protection

  • AES-256 encryption at rest
  • TLS 1.3 in transit
  • Column-level encryption for PII
  • Automatic key rotation every 90 days
  • Encrypted backups with separate key

Audit and Monitoring

  • Complete activity audit trail
  • Immutable audit log storage
  • Real-time anomaly detection
  • Failed login attempt tracking
  • API usage anomaly alerts

Compliance

  • GDPR data subject rights
  • SOC 2 Type II (planned Q1 2027)
  • HIPAA BAA available for Enterprise
  • Data residency options by region
  • Right to erasure implementation

Security Statistics

0

Breaches (Lifetime)

99.99%

Security SLA

24/7

Monitoring

< 1hr

Incident Response

12

Appendix and References

Glossary

RAGRetrieval-Augmented Generation - combining document retrieval with LLM generation for grounded responses
LLM GatewayUnified abstraction providing a single API interface across multiple LLM providers
Multi-TenancyArchitecture where a single instance serves multiple organizations with data isolation
RBACRole-Based Access Control - permissions based on organizational roles and hierarchies
FilamentLaravel admin panel framework providing CRUD resources, pages, and dashboard widgets
LivewireFull-stack Laravel framework enabling reactive components without JavaScript
SanctumLaravel auth package for SPA, API token, and mobile app authentication
QdrantOpen-source vector similarity search engine for storing and querying embeddings

API Endpoint Reference

EndpointMethodRate Limit
/api/v1/agentsGET, POST60/min
/api/v1/agents/{id}GET, PUT, DELETE60/min
/api/v1/conversationsGET, POST30/min
/api/v1/conversations/{id}/messagesGET, POST120/min
/api/v1/knowledge-basesGET, POST30/min
/api/v1/knowledge-bases/{id}/documentsPOST10/min
/api/v1/workflowsGET, POST30/min
/api/v1/marketplaceGET60/min
/api/v1/analytics/overviewGET20/min
/api/v1/healthGETUnlimited

Technology Versions

PHP

8.2.x

Laravel

12.63

Filament

v5.6

Livewire

4.3.x

MariaDB

10.4+

Redis

7.x

Qdrant

1.x

Docker

24.x

MTS Logo

MTS AI Agent Studio

Technical Architecture and Product Documentation v2.4.0

Confidential. July 2026. All rights reserved.

This document contains proprietary information. Distribution restricted to authorized personnel.