Work with me
RAG and document AI engineering
I build retrieval and document AI for teams whose answers sit in long, messy files: case records, medical documents, contracts. The aim is an answer you can check, with its source next to it.
Problems this is for
- Finding the evidence across many documentsA question whose answer is spread over several files, not sitting in one passage.
- Turning documents into dataOCR, classification and structured extraction from scanned or inconsistent files.
- Answers grounded in sourcesEvery answer points to the passage it came from, so a person can check it.
- Documents that disagreeSpotting when two records contradict each other, instead of quietly picking one.
What I've built
Smart Advocate
Senior AI Lead Engineer, at Devsinc
Document AI for legal and medical case files, shipped into a platform used by 20,000+ legal professionals. I led its document AI, from OCR, classification and structured extraction to knowledge-graph retrieval.
A knowledge-graph (KAG) approach with a fine-tuned model gave a 40% accuracy gain over standard RAG.
Measured with a GPT-4-class LLM judge, BLEU and ROUGE for answer text, and precision@k and recall@k for retrieval. The graph and the model changed together, so the 40% doesn't isolate the graph's share.
Leading the AI team at Devsinc
Senior Software Engineer, Nov 2024 – Jun 2026
Led eight AI engineers across legal, healthcare and real-estate products, including retrieval across about five million documents.
Contract analysis
Associate Software Engineer, at Amrood Labs
Contract analysis on the OpenAI API that cut manual review by about 60%.
Mentanima
In development
A legal copilot I'm building. Every answer cites its source, or says it can't answer.
How I'd approach a project
A proposed way of working, adjusted to each project. It isn't a fixed package.
- DiscoveryThe questions that matter, the documents behind them, and what a good answer looks like to the people who use it.
- A retrieval baselineThe simplest approach that works on your documents, so every later change is measured against it.
- An evaluation setQuestions with agreed answers and sources, scored for retrieval and for the answers themselves.
- ImplementationExtraction, better retrieval (a knowledge graph where links between documents matter) and answers that cite their sources.
- IntegrationInto your product or workflow, with a way to see when answers drift.
Depending on the project, the result could be one or more of:
- an agreed evaluation set for your documents and questions
- a retrieval prototype that runs on your own files
- an integration plan for your product or workflow
- a production implementation
Questions
- Where are you, and how do you work?
- I'm based in Pakistan (UTC+5) and work remotely, as an independent contractor since July 2026. I'm open to relocation; US roles need visa sponsorship.
- What do you build with?
- Python, FastAPI, LangGraph, RAG and knowledge-graph retrieval (Neo4j, pgvector), LoRA fine-tuning, and models from OpenAI, Anthropic and Gemini.
- What size of project?
- Anything from an evaluation set and a prototype on your documents to a production system. A first conversation is about which of those you actually need.
- How do we start?
- Send one line about the project through the form, or email me. I read and answer these myself. If you're hiring for a role, choose that option in the form, or start with the resume.
Have documents that need answers?
Tell me what the documents are and what you need to know from them.