Skip to content
Michał Per edited this page Sep 17, 2026 · 2 revisions

AI Message Router — PoC

A microservice PoC for an intelligent message router: it takes a user's request (sender email + free-form text), classifies it with a local LLM (Ollama) through an AI agent using function-calling (neuron-core/neuron-ai), and emails it to the right department, captured by MailHog.

See the repository README for setup instructions, architecture decisions, and the full DoD checklist. This wiki page is a visual walkthrough of the running application — actual screenshots from a real docker compose up -d run.

1. Swagger docs at /api/v1/docs

Both endpoints are documented: GET /api/v1/health and POST /api/v1/route-message.

Swagger UI

Expanding POST /api/v1/route-message shows the request/response schema:

Swagger route-message expanded

2. A real request, correctly routed

curl -X POST http://localhost:8080/api/v1/route-message \
  -H "Content-Type: application/json" \
  -d '{"email": "jan.nowak@example.com", "message": "Nie dziala mi komputer, prosze o pomoc"}'
{"department": "it@example.com", "subject": "Problem with computer"}

The email lands in MailHog, addressed to it@example.com, with Reply-To: jan.nowak@example.com set from the original sender:

MailHog message detail with headers

3. The safety-net fallback, in action

Local LLM inference is slow to start (the model needs to finish downloading and load into memory). A request sent while Ollama was still mid-download for the first time correctly fell back to other@example.com instead of hanging or erroring out:

MailHog inbox showing the fallback email

{"department": "other@example.com", "subject": "Unclassified request"}

This is MessageRoutingAgent's safety net working exactly as designed: if the LLM can't be reached or fails to call the send_email tool, the request is never silently dropped — it's still routed and still carries the original sender's Reply-To.