PostLotse
AI agent for SME email triage — classifies, extracts, suggests routing and a reply. With a visible tool-calls trace and human-in-the-loop (no auto-send). Live.
Problem & context
Email overload costs SMEs hours every week
Requests, invoices, appointments and spam land in one inbox. An agent that classifies, prioritises and drafts routine replies — escalating tricky cases — gives that time back.
Solution
An agent with tools — not a chatbot
A custom state machine (no LangGraph) runs five steps: classification and extraction (structured output), two deterministic tools (knowledge base, deadline calculator) with a logged tool-calls trace, a routing suggestion with reasoning, and a reply draft. No auto-send — the human confirms, edits or discards.
Architecture
Clean Architecture, four layers
Agent data-flow models + LLM port
TriageAgent — custom state machine, stream() + run()
Tools (classify/extract/kb/frist/draft), Mistral/Ollama
FastAPI: workbench + /analyze (SSE)
Process history
From plan to deploy — six phases
- 01
Setup & architecture
DONEClean-arch skeleton, Docker, CI (ruff + mypy --strict + pytest). Blue accent.
- 02
Tools
DONEclassifier, extractor (structured output), kb_lookup, frist_rechner, draft — tested offline (FakeLLM).
- 03
Agent & tracing
DONECustom state machine, tool-calls trace (name·args·result·latency), HITL, error path.
- 04
Eval harness
DONE16 labelled emails: accuracy, macro-F1, extraction, tool-call success, latency.
- 05
Workbench (SSE)
DONELive steps, tool trace, routing, draft editor with HITL actions. BFSG/TDDDG.
- 06
Deploy & docs
DONELive on own VPS via Traefik. Project docs + design presentation public.
Results
Made measurable
Measured against a golden set (26 cases). Details in the project documentation.
Stack & compliance
GDPR: emails are personal data → EU/local LLM, no storage (data minimisation). Human-in-the-loop (no auto-send) + a visible tool-calls trace = explainability (EU AI Act).