Case study · Pipelines · KBPipeline

From inbox to a knowledge base you can question.

Email, calendar and CRM history, cleaned, classified and routed into knowledge bases a team can question.

The problem

Years of work history sit locked in inboxes, calendars and CRM tickets, buried under signatures, quoted replies, newsletters and spam. When someone leaves, most of it leaves with them, and searching for the rest wastes hours.

KBPipeline pulls that history out, throws the noise away and files what matters where people can ask questions of it. At the client where it runs in production, what it surfaced between the email and ticket streams led them to change what data they capture.

How it works

  1. 01ConnectGmail and Microsoft Graph, over OAuth
  2. 02IngestStage 1, no LLM, into Postgres
  3. 03UnderstandStage 2: strip quotes, classify, extract
  4. 04RouteStage 3 rules into knowledge bases
  5. 05AskMaxKB and Open WebUI chat

The admin dashboard sits beside every stage: progress, errors, retries and LLM usage are visible in one place.

What I built

By the numbers

187automated tests: 177 pipeline and 10 dashboard
3stages, from raw mail to a routed knowledge base
1client running it in production

Decisions worth a look

Extractors are configuration, not code.A new extractor is a database row with detection rules and a JSON Schema, and the model's output is checked against it.
Regex first, model second.Quote stripping tries cheap heuristics and only calls a model when they find nothing in a long message.
Errors never crash a worker.Every error is retryable or fatal, and every one shows up in the dashboard for a person to retry or skip.
It never touches a password.Mail and calendars are read through the Gmail API and Microsoft Graph with OAuth, so access can be revoked at any time.

Stack and my role

I designed it as architect and product owner and directed AI coding agents through the build. The repository is private.