Back to Projects

AI Back-Office

Freelance AI EngineerProductionAug 2026 – Present

AI agent and document-intake platform running the back office of an Israeli paper import/export firm.

40+
MCP Tools
~7,000
Labeled Docs (eval)
60+
Architecture Decisions
3,000+
Automated Tests

The Problem

A small international trading firm ran its whole back office through one person juggling Outlook, Excel, a shared drive and an aging MS Access database. Every supplier invoice, waybill and customer confirmation was read, filed and acted on by hand, and the Access database was failing in production.

How It Works

The platform runs on the client's own Windows server under WSL2, with systemd timers for nightly learning, 5-minute inbound processing and a weekly evaluation. A nightly job loads every mail, attachment and workbook change from the company mailboxes and SharePoint into PostgreSQL, so the system learns from how the office actually works.

Staff talk to an AI agent on Telegram. It is backed by a custom MCP server over Microsoft Graph with 40+ tools: it reads and drafts mail, works with SharePoint files and Excel workbooks, OCRs and renders documents in a sandbox, and prints to the office printer. Every write action needs a human approval tap. Recurring jobs run unattended only inside HMAC-signed scopes, and there is a kill switch.

A document-intake pipeline classifies incoming documents, extracts their fields and routes each one to the right order. It is measured against ~7,000 attachments the operations team filed by hand over three years, and new rules are tested against that answer key before they go live.

Alongside the AI work, the company file server was migrated to SharePoint/OneDrive, and a PostgreSQL replacement for the failing Access database is being verified with fidelity diffing against the original.

Key Challenges

Letting an LLM agent act on a real company's mail and files safely

Every write goes through a gate that asks a human for an approval tap on Telegram. Scheduled jobs carry HMAC-signed scopes listing exactly which tools they may call, and a kill switch stops all automation instantly.

Knowing whether the document pipeline is actually right

Built an eval harness whose ground truth is three years of hand-filed attachments, sampled per supplier and document type. A weekly broad eval runs on its own, and rule changes are measured the night they land. Fixing the answer key itself once moved a routing metric from 43% to ~95%: a measurement bug, not a model one.

Introducing automation without breaking a working office

Every automation starts in shadow mode, producing output next to the human process without acting. For example, the recurring port-release emails to the carrier ran in shadow for three weeks before going live as scheduled drafts.

Hebrew/English mixed-direction email rendering in Outlook

Wrote a tested bidi HTML formatter so Hebrew lines align right while embedded English names and numbers keep their order, plus a test that fails any code path that sends mail without it.

Tech Stack

AI

Claude (Agent SDK / CLI)Agent runtime for the office assistant and the document pipeline
Model Context ProtocolCustom TypeScript MCP server exposing Microsoft Graph, documents, orders and printing as typed tools
Eval harnessGround truth from historical human filing; weekly scheduled runs

Backend & Data

Python 3 + TypeScriptPython for pipelines and evals, TypeScript for the MCP server and Office add-in
PostgreSQLLearning corpus, order data and the Access replacement, with read-only roles
Microsoft Graph / M365Mail, SharePoint, OneDrive and Excel access for the whole company

Infrastructure

WSL2 + systemdLinux services on the client's on-prem Windows server
Tesseract / ocrmypdf + sandboxHebrew/English OCR and document rendering in an isolated sandbox
WireGuardSecure remote administration