Refusal is product behavior
No knowledge, weak retrieval, or an ungrounded final draft all resolve to a safe refusal or escalation.
Grounded AI for email and embedded customer chat
A live, multi-tenant customer-support platform that uses one knowledge spine across two channels: an email agent and an embeddable site chat widget. It answers automatically only when evidence clears the configured threshold, otherwise it escalates with a clean summary.
Role · Product and AI architecture
System anatomy

Captured from the live product · October 2026
Open live productThe problem
Customer-support AI needs to be useful without inventing answers, leaking tenant data, or burning through unbounded tokens. Orepli makes grounding, usage limits, escalation, and audit part of the core product model.
What the system does
Gmail OAuth plus IMAP/SMTP with encrypted credentials
Per-mailbox classify → retrieve → draft → send or escalate pipeline
Embeddable chat widget with origin allowlist and one-time API keys
Three-layer strict-KB refusal contract and multi-turn memory
Knowledge-gap, refusal-rate, and feedback insights for administrators
Shared tenant token pool, hard caps, rate limits, DLQ, and audit timelines
Architecture
FastAPI + SQLAlchemy + PostgreSQL/pgvector backend
Next.js administration, live preview, and iframe chat experience
Swappable local or hosted embeddings behind a stable retrieval interface
Docker/Nginx deployment with structured logs and exponential LLM retry
Key decisions
No knowledge, weak retrieval, or an ungrounded final draft all resolve to a safe refusal or escalation.
Email and chat share tenant billing, caps, observability, and administrative controls.
Feedback and refused questions become visible knowledge gaps rather than disappearing into logs.