System thesis
Case study
Local Document AI Extraction
Local PDF extraction workflow that keeps document parsing, chunking, prompting, and review close to the analyst.
Primary evidence: Local/private inference path
At a glance
- Input
- Local PDF upload
- Processing
- PDFPlumber, chunking, prompt assembly
- Inference
- Ollama via LangChain
System problem
Why this system exists.
Regulated document workflows need extraction assistance without automatically sending sensitive files to remote services.
Implementation surface
What was built.
- Streamlit UI.
- PDF extraction and chunking path.
- Ollama client integration.
- Privacy-preserving document AI framing.
Architecture
A system map for the project.
PDF upload -> PDFPlumber extraction -> chunking -> prompt assembly -> local Ollama/LangChain call -> structured answer -> Streamlit review surface.
A privacy-oriented pipeline that keeps parsing, chunking, prompt assembly, local inference, and review inside the local workflow.
Document Zone
Context Zone
Inference Zone
Review Zone
How it works
Input, transformation, model or agent logic, and reviewable output.
PDF parse
Documents are parsed locally before any prompt is assembled.
Chunking
Extracted text is chunked so criteria-driven prompts remain inspectable.
Local model call
LangChain coordinates calls to a local Ollama model rather than an automatic remote service.
Reviewable output
Streamlit keeps extraction results in front of a human reviewer.
Evidence
Screenshots, responses, diagrams, tests, and model tables from the source repos.
Artifacts are included only where the public repo has enough context to show them safely.
Local inference boundary
PDFs stay in the local workflow: parse -> chunk -> prompt -> Ollama -> review UI. This is the architectural point of the repo.
Engineering Decisions
Privacy-first shape
The architecture is useful in regulated contexts where document residency matters.
Workflow controls over magic
The value is the parse/chunk/prompt/review loop, not a claim that the model is always correct.
Portable prototype
Streamlit and Ollama keep the workflow easy to run locally.
Validation / reliability
How the system is made reviewable.
- Prompt and memory smoke tests passed locally.
- Python compile checks pass.
- Full extraction requires Docker, Ollama, and a local model.
- Streamlit analyst interface.
- Docker/Ollama local execution.
- Runtime setup keeps private files outside version control.
Limits / responsible use
Use synthetic/sample documents only. Uploaded private documents should never be committed.
- The local path keeps PDF parsing, chunking, prompt assembly, and model calls close to the analyst workflow.
- Human review stays part of the output boundary.
- Private documents should never be committed or routed through uncontrolled services.
Repository
Open the source repo and inspect the implementation boundary.
All public examples are synthetic, sanitized, historical, or research/demo implementations. No PHI, PII, employer-confidential data, proprietary claims data, private keys, production credentials, or sensitive datasets are included.