Categories
Self-Hosted AI Agent Human-in-the-Loop Multi-Tenant AI Customer Support LLM Firewall Chat Widget Retrieval-Augmented GenerationStars
Forks
Watchers
Developer links
Mabeyn
Customer-support bots tend to fail in two ways, inventing answers and taking actions nobody approved, and Mabeyn is a support agent built to stop both. Upload PDF, Markdown, or HTML files, or add a public web page, and policy answers come only from that material, citing the exact section and admitting when nothing fits. Register HTTP endpoints from your backend as tools, label each read, write, or sensitive, and attach policies that check the real order; the customer's identity comes from the verified session, never the model. Sensitive actions such as refunds wait in an approval queue that shows the exact arguments and the thread; once an admin approves, the answer reaches the shopper's chat without a reload. Returning shoppers are remembered: facts they state are kept for 180 days, instructions and personal data are never stored, and customers and admins can read or erase every note. A four-layer firewall screens messages, uploaded documents, tool calls, and replies, masks card numbers and e-mail addresses on the way out, and logs each block as a filterable security event. Businesses stay isolated in separate workspaces, each with secret and publishable API keys, per-customer rate limits, and daily token and cost reports. One script tag adds a streaming chat bubble to any page, and a shopper who asks for a person flags the conversation as escalated. Running on a dedicated VPS on RepoCloud with guaranteed CPU, RAM, and SSD, full root SSH access, and a browser serial console. MIT licensed.
Benefits
- Answers grounded in your documents
- Replies come from the files and pages you upload, cite the exact section, and fall back to a plain "no reliable information" message in the customer's language instead of guessing.
- Risky actions wait for a person
- Refunds and other sensitive tools stop at an approval queue with exact arguments; requests survive restarts, expire after 72 hours, and a signed webhook can announce each new one.
- Every blocked attack leaves a record
- Each blocked message, flagged document, or refused tool call becomes an auditable event with its layer and category, so admins can see exactly what the firewall caught.
- One business never sees another
- Isolation is enforced by the database on every table, including conversation checkpoints and customer memory, so a tenant's workspace stays private even if application code slips.
Features
- FastAPI and LangGraph Core
- A FastAPI service runs LangGraph workflows: a supervisor routes each message to a knowledge agent, an action agent, or a human handoff, with checkpoints stored in PostgreSQL.
- Hybrid Retrieval Pipeline
- pgvector similarity and Turkish or English full text search merge through Reciprocal Rank Fusion, then an LLM reranker keeps the six best passages for the answer.
- Next.js Admin Panel
- A Next.js 16 panel covers approvals, conversations, documents, tools, security events, firewall settings, usage, and API keys, with tokens held in httpOnly cookies.
- Embeddable Streaming Widget
- A dependency-free widget script served by the API opens a session, streams answers over Server-Sent Events, shows cited sources, and keeps the chat across page loads.
- Docker Compose Deployment
- Compose starts the API, background worker, admin panel, demo shop, PostgreSQL with pgvector, and Redis, and a seed profile loads the demo tenant with its documents and tools.
- OpenAI Models and Tracing
- Defaults to gpt-4.1-mini for answers, gpt-4o-mini for grading, and text-embedding-3-small for embeddings; optional LangSmith tracing records a sampled share of runs.