LIVE Agents · Tool-calling

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.

PostLotse workbench: an invoice email triaged — classification, extracted fields, tool-calls trace and routing suggestion.

Architecture

Clean Architecture, four layers

domain

Agent data-flow models + LLM port

application

TriageAgent — custom state machine, stream() + run()

infrastructure

Tools (classify/extract/kb/frist/draft), Mistral/Ollama

api

FastAPI: workbench + /analyze (SSE)

Process history

From plan to deploy — six phases

  1. 01

    Setup & architecture

    DONE

    Clean-arch skeleton, Docker, CI (ruff + mypy --strict + pytest). Blue accent.

  2. 02

    Tools

    DONE

    classifier, extractor (structured output), kb_lookup, frist_rechner, draft — tested offline (FakeLLM).

  3. 03

    Agent & tracing

    DONE

    Custom state machine, tool-calls trace (name·args·result·latency), HITL, error path.

  4. 04

    Eval harness

    DONE

    16 labelled emails: accuracy, macro-F1, extraction, tool-call success, latency.

  5. 05

    Workbench (SSE)

    DONE

    Live steps, tool trace, routing, draft editor with HITL actions. BFSG/TDDDG.

  6. 06

    Deploy & docs

    DONE

    Live on own VPS via Traefik. Project docs + design presentation public.

Results

Made measurable

100 %
Classification accuracy (16 emails)
1.00
Macro-F1 · tool-call success 16/16
~3,1 s
Latency p50 (3 LLM steps)

Measured against a golden set (26 cases). Details in the project documentation.

Stack & compliance

Python 3.12FastAPIHTMX + SSEMistral / OllamaTool-CallingPydanticDockerTraefik

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).

PostLotse live demo

Open live demo ↗ ← All projects