A central challenge in data has always been moving between layers of the DIKW (Data, Information, Knowledge, Wisdom) pyramid. As more of a “numbers guy,” I’ve long focused on automated ways of extracting structured meaning from unstructured text. For me, this has gone from regex to sentiment analysis and NLP, and now to Large Language Models.  LLMs and their application have unleashed a whole suite of new tools to use in this area, but that range of tools and the pace at which they are changing means an adaptable architecture to slot them in and out of becomes a necessity.
To do this, I’ve been applying the familiar Medallion Architecture to unstructured document processing. This approach reuses common base layers while maintaining the flexibility to feed multi-level data into various tools and store the enriched outputs.
Implementation
I’ve implemented this locally in a containerised stack of open-source tech based around Paperless-ngx. This open-source project is a document management system built off Postgres with integration of tesseract for OCR and an extensible metadata schema. I use its API to interface with AnythingLLM, which I’ve got connected to Ollama for hosting open-weight models. While I’m doing this all locally, this pattern easily translates to any cloud provider or even completely within the more complete data platforms like Databrick or Snowflake, requiring only file storage, SQL and vector databases, model serving, and an orchestration layer.
Layer Breakdown
- Bronze (Raw Ingestion): Paperless serves as the raw data vault. Original documents enter via web UI, mobile app, or email and receive a persistent ID for full lineage tracking. Upon ingestion, Tesseract runs OCR, saving the PDF and writing metadata and extracted text to PostgreSQL.
- Silver (Analytics-Ready): Paperless enriches documents using automated rules, regex, and TF-IDF/Naive Bayes classifiers alongside manual tags. This structured output forms the Silver layer. I export or query this layer via API, SQL, or file export to feed downstream LLMs.
- Gold (Knowledge & Insights): In AnythingLLM, I create scoped vector embeddings based on paperless tags to experiment with prompts and swapping in and out different models. Once an approach is proven, I deploy it as a Python notebook orchestrated across the corpus. With this setup gold output can be linked back to the original document ID and saved back to Postgres, persisted as Markdown files for a Karpathy-style Wiki or extracted into RDF triples for knowledge graphs which in my current experiment direction.
Â
By applying this pattern I’ve been able to experiment quickly with new approaches while reusing underlying infrastructure and continually adding valuable outputs back into my underlaying knowledge base. As our increasing AI-enabled workflows continue to evolve, it’s important to remember the fundamentals and build in a way that can make use of the new approaches without buckling under the weight of constant change and system complexity.

Ben Bradshaw
Senior Data Design Consultant






