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.
- Python
- 187 automated tests
- In production at a client
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
- 01ConnectGmail and Microsoft Graph, over OAuth
- 02IngestStage 1, no LLM, into Postgres
- 03UnderstandStage 2: strip quotes, classify, extract
- 04RouteStage 3 rules into knowledge bases
- 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
- Gmail and Microsoft Graph connectors over OAuth2
- A three stage pipeline with no LLM in the ingest stage
- LLM agents that classify mail as spam, noise, important or actionable
- Cleaning and entity extraction, with output validated against a JSON Schema
- A rule based router into MaxKB knowledge bases
- Open WebUI as the chat front end
- A Flask admin dashboard: batch jobs, pause and cancel, retries, prompt editor, usage stats
- Backup and restore scripts
By the numbers
Decisions worth a look
Stack and my role
- Python
- Gmail API
- Microsoft Graph
- OAuth2
- PostgreSQL
- pgvector
- MaxKB
- Open WebUI
- Flask
- Docker
I designed it as architect and product owner and directed AI coding agents through the build. The repository is private.