Enterprise RAG Platform
Production-ready RAG system with file-type-aware chunking, metadata extraction, TOC mapping, and persona customization achieving 40% improved response relevance.
40%
The problem
Enterprise teams accumulate vast document libraries — strategy decks, technical reports, financial spreadsheets, legal contracts — and struggle to find information across them. Standard search returns documents, not answers. Users want to ask "What was our Q2 margin in the Nordic region?" and get a direct response with a citation, not a list of 50 PDFs to read through.
The core technical challenge is that enterprise documents come in wildly different formats. A chunking strategy that works for a 200-page PDF technical manual fails completely on a 10-slide PowerPoint or a spreadsheet with pivot tables. One-size-fits-all RAG systems produce mediocre results because they treat all content the same way.
Approach
I built a RAG platform with file-type-aware processing at its core. Each document type gets its own chunking and extraction pipeline.
File-type-aware ingestion → unified retrieval
PDFs go through layout analysis to detect headers, paragraphs, tables, and figures. Long documents get table-of-contents mapping — the system identifies the document structure and uses it to create hierarchical chunks that preserve context. A chunk from "Section 3.2: Nordic Revenue" carries that structural metadata, so the retrieval step knows where in the document the information lives.
PowerPoint files are processed slide by slide, with speaker notes and slide titles preserved as metadata. Spreadsheets get special treatment — each sheet is analyzed for structure (is it a data table? a pivot table? a chart data source?), and numerical data is extracted with column headers intact so the LLM can reason about it.
On top of this, the system supports persona customization. A finance user asking about revenue gets responses formatted with numbers and comparisons. A legal user asking about contract terms gets responses that cite specific clauses. The persona layer adjusts both retrieval weights and response formatting.
Results
The file-type-aware approach improved response relevance by 40% compared to the previous system that used uniform chunking across all document types. The biggest gains came from two changes: preserving table structure in spreadsheets (so the LLM could actually read financial data instead of getting garbled text) and using TOC-based chunking for long PDFs (so chunks carried their section context).
User adoption increased significantly once responses started including page numbers and section references. Being able to verify an answer against the source document was critical for trust.
Reflection
The most impactful lesson was that chunking strategy matters more than model choice. Switching from a generic recursive text splitter to file-type-aware chunking had a larger impact on answer quality than upgrading the underlying LLM. The retrieval step is the bottleneck in most RAG systems — if you retrieve the wrong chunks, no amount of generation quality will save you.
The persona system was initially overengineered. The first version tried to maintain detailed user profiles. The shipped version uses simple role-based presets (finance, legal, technical, executive) that adjust a few retrieval and formatting parameters. Simple and good enough beat complex and fragile.