From PDF to chatbot: a LangChain RAG pipeline
Building a PDF-backed RAG pipeline in a notebook, grading its own answers with a second model, then wiring it into FastAPI.

Hi, this is Khalid. I’m documenting my learning notes in this blog.
The most recent thing I published.
Building a PDF-backed RAG pipeline in a notebook, grading its own answers with a second model, then wiring it into FastAPI.

Notes from the last few months.

I trained a scikit-learn decision tree on the classic Iris dataset, tuned its depth with cross-validation, and pulled apart the maths behind every step: Gini impurity, information gain, and feature importance.

Four ways to keep an agent in check, redacting PII on input, pausing for approval before a risky tool runs, blocking bad requests up front, and checking the model's answer before it goes out.

I spent an afternoon in a notebook building a LangChain agent from scratch, one piece at a time: a bare model, then tools, then memory, then a couple of real external services. Nothing about it was hard on its own, but the order I hit things in taught me more than any single tutorial had. This is what stuck.