Contact
ENGINEERING CASE STUDY · ARCHITECTURE & AIviaFCamara

Synforce

Production HR Synthetic Workers on AWS with OpenClaw

FCamara's intelligent People/HR agent platform: cloud architecture, integration with Microsoft Teams and WhatsApp Cloud API, anti-hallucination governance anchored in SharePoint, and zero exposed management ports.

Meu PapelTech lead · Architecture, Infrastructure & AI
Stack Principal
  • AWS
  • Terraform
  • Docker
  • TypeScript
01

The Challenge: HR Support with Zero Hallucinations and Strict Data Isolation

With hundreds of employees and dynamic internal policies (vacations, benefits, medical leaves, expense reports), FCamara's People team was overloaded by repetitive queries spread across disparate channels.

Conventional support bots frequently stumble in this environment: they either rely on naive vector RAG that chops tables and hallucinates benefit policies, or lack strict privilege separation for sensitive employee and payroll records. The goal was to build a production synthetic workforce combining rigorous security, agentic retrieval, and native presence across channels employees already use every day.

Agent Segregation

Synthia & BP: Two Specialized Personas

Synthia handles general company-wide People queries on Teams and WhatsApp. The BP (Business Partner) agent manages sensitive employee data via Orange integration, structurally restricted to Microsoft Teams behind Entra ID authentication.

Governance & Accuracy

Zero Hallucination with Corporate Single Source

No policy is inferred or remembered without grounding: SharePoint acts as the single source of truth for knowledge, synced in real time.

True Omnichannel

Microsoft Teams & WhatsApp Cloud API

Native experience on the corporate desktop (Teams) and in employees' pockets (official Meta WhatsApp with native voice notes and files).

02

Architecture Blueprint: From Edge to Agents

An end-to-end engineering view: from channel ingress and TLS termination to containerized runtime on AWS, LLM integration, and voice synthesis.

The infrastructure was engineered to operate cost-effectively, reliably, and modularly on a single EC2 Graviton t4g.small instance with Docker Compose. Caddy serves as the secure edge terminating TLS :443 and routing only strictly authorized endpoints, isolating the OpenClaw gateway and supporting microservices.

Inspect the diagram nodes and toggle flows to trace each request path:

Fluxo:
Full Architecture
synforce-architecture-v2.dia
ONLINE · AWS SA-EAST-1
FCamara · SynWorkers POC Architecture
01 · Canais de EntradaIngress

Microsoft Teams

Colaboradores FCamara

JWT
/api/messagesBot Framework

WhatsApp Cloud API

Meta Webhook Oficial

HMAC
/whatsapp ➔ :18789Áudio Opus PTT

SharePoint M365

Fonte Única da KB

Token
Power Automate ➔ /kbx-kb-token
02 · Borda & TLSEdge
TLS :443

Caddy Reverse Proxy

56.126.101.37.sslip.io

  • /api/messages➔ :3978
  • /whatsapp➔ :18789
  • /kb➔ :4100
  • /healthz➔ 200 OK
🛡️ Resto: 404 estrito
03 · Host & ContainersEC2 ARM64
Docker Composet4g.small
OpenClaw Gateway:3978
Synthia (People)
BP Agent (Teams)

Plugins: whatsapp-cloud + ler_documento

KB-Receiver:4100

MarkItDown ➔ INDEX.md + .kb-map.json

Symphony-Shim:8899

SSE stream:true ⇄ JSON batch

EBS /srv/openclawDLM 7d
sqlite, sessões, /knowledge (:ro)
04 · IA & ProvidersBackbone

Symphony LLM

Cérebro & Visão

LLM
Symphony /openaiÚnico provider

ElevenLabs TTS

Voz de Marca

Voice
Opus 48kHz nativoWhatsApp PTT

AWS Cloud Ops

Terraform + SSM

Sec
Sem SSH ➔ SSM SessionSegredos SSM
Passo a Passo:Visão Geral Completa

Arquitetura ponta a ponta: 3 canais de entrada, terminação TLS na borda com Caddy, 4 microserviços Docker em EC2 ARM64 e integração com Symphony LLM e ElevenLabs.

  1. 1Entrada por Teams (JWT), WhatsApp (HMAC) e SharePoint (x-kb-token)
  2. 2Caddy expõe apenas portas necessárias e bloqueia o resto com 404
  3. 3Gateway OpenClaw orquestra Synthia (People) e BP (Business Partner)
  4. 4KB-Receiver ingere documentos do SharePoint com MarkItDown
  5. 5Symphony-Shim converte streaming para a API corporativa de LLM
03

Technical Deep Dive: Critical Implementation Decisions

Pragmatic engineering solutions designed to overcome enterprise protocol constraints, streaming quirks, and document ingestion challenges.

01.No Traditional RAG

Agentic Document Navigation with MarkItDown

Instead of chopping documents into opaque vector chunks that lose benefit table context, the pipeline converts SharePoint documents (PDF, Word, PowerPoint) into clean Markdown and generates a semantic INDEX.md. Synthia browses the index and performs active lookups on demand through the dedicated ler_documento tool, ensuring complete context and accurate citations.

02.Streaming Compatibility

Symphony-Shim Microservice

The OpenClaw gateway was built to require stream: true with Server-Sent Events (SSE). However, the enterprise Symphony LLM API only responds in batch JSON (stream: false). We built a lightweight Python shim microservice that translates batch JSON into SSE chunks with sanitized finish_reasons in real time.

03.Meta Cloud API

Native WhatsApp Plugin with Opus Audio

We eliminated legacy HTTP bridge proxies in favor of a proprietary plugin running directly inside the runtime. For voice responses, the channel instructs ElevenLabs to synthesize directly in opus_48000_64 (Ogg/Opus), delivering native voice notes on WhatsApp without bundling FFmpeg in the container.

04

Infrastructure as Code and Security Posture

Fully automated Terraform deployment in the sa-east-1 (São Paulo) region, ensuring employee PII and knowledge bases remain in Brazil.

Zero Port 22 (No SSH)

No management ports exposed to the public internet. Administrative access, deployments, and monitoring are orchestrated exclusively via AWS Systems Manager (SSM Session Manager and SSM Run Command).

Secrets Without .env on Disk

Secrets and API tokens reside in AWS SSM Parameter Store (SecureString) and are loaded dynamically into memory during deployment, never committed to git.

Dedicated EBS with DLM

Persistent state (~/.openclaw containing SQLite, sessions, and workspaces) sits on a dedicated EBS volume decoupled from the EC2 root, safeguarded by prevent_destroy and daily automated DLM snapshots.

Hardened Edge with Caddy

Automated TLS provisioning and renewal, exposing only authorized endpoints (/api/messages, /whatsapp, and /kb with x-kb-token) while returning strict 404s for any unmapped route.

05

Production Impact and Video Demonstration

Demonstrated operational efficiency with near-instant response times and high employee satisfaction.

2Active ChannelsConcurrent Teams and WhatsApp
100%KB Sync AutomationAutomated SharePoint delta flow
0PII LeaksBP agent isolated to Teams
t4g.smallCost Efficiency4 microservices on 1 ARM instance

Video Demonstration

Watch Synforce in action, resolving complex HR queries with natural dialogue and corporate grounding:

en · desktop