A secure, on-device document analysis solution powered by Foundry Local, designed to handle sensitive documents without relying on the cloud.
The PrivyDoc Document Analysis Tool transforms how teams work with sensitive documents by bringing AI-powered analysis directly to your device. Using Microsoft Foundry Local, all processing happens locally-no data leaves your computer.
Ideal for:
- Policy teams analyzing internal documents
- Researchers handling sensitive research materials
- Legal teams reviewing confidential contracts
- Compliance teams processing regulatory documents
- Anyone needing document insights without uploading to the cloud
- ✅ Multi-Format Support: PDF and DOCX
- ✅ Structure Recognition: Identify document sections and hierarchy
- ✅ Text Extraction: Preserve formatting cues
- ✅ Smart Summarization: Concise overviews of entire documents or sections
- ✅ Entity Recognition: Detect people, organizations, locations, dates, etc.
- ✅ Sentiment Analysis: Analyze emotional tone at document and section levels
- ✅ Topic Classification: Auto-categorize documents by subject
- ✅ 100% Local Processing
- ✅ Zero Data Transmission
- ✅ Air-Gap Compatible
- ✅ Analysis Traceability: Logs of all interactions
- ✅ Document Fingerprinting: Verify integrity and processing history
- ✅ Multiple Formats: Markdown, JSON, CSV
- ✅ Structured Data: Standardized output for downstream processing
- ✅ Analysis History: Browse previous analyses with metadata
| Component | Requirement |
|---|---|
| OS | Windows 10/11, macOS 12+ |
| RAM | 8 GB minimum, 16 GB recommended |
| Storage | ≥ 5 GB free |
| Python | 3.10+ |
- Clone the repository
git clone https://github.com/ShivamGoyal03/PrivyDoc.git
cd PrivyDoc- Set up Python environment
# Create a virtual environment
python -m venv venv
# Activate it
venv\Scripts\activate # Windows
source venv/bin/activate # macOS/Linux
# Install dependencies
pip install -r requirements.txt- Install Foundry Local
# Windows
winget install Microsoft.FoundryLocal
# macOS
brew tap microsoft/foundrylocal
brew install foundrylocal
# Verify installation
foundry --version- Download a model (automatic on first run)
# List available models
foundry model ls
# Download specific model (optional)
foundry model run qwen2.5-0.5bchainlit run multi_agent_doc_analysis.py- Open: http://localhost:8000
- Upload PDF or DOCX, track progress, export results
python multi_agent_doc_analysis.py --file path/to/document.docx- Process a single file and save results to local JSON database
| Model | Size | Best For | Notes |
|---|---|---|---|
| qwen2.5-0.5b | Small | Quick analysis | Default, fastest |
| phi-3.5-mini | Medium | Balanced performance | Good all-around |
| phi-4 | Large | Detailed analysis | Most accurate |
- Document Processor: Extracts and normalizes text
- AI Engine: Runs Foundry Local models
- Analysis Workflow: Multi-step analysis using Agent Framework
- Storage Layer: JSON-based analysis history
- User Interfaces: Web UI (Chainlit) & CLI
- Document Upload (via Web or CLI)
- Text Extraction (PDF/DOCX cleaned for analysis)
- Section Extraction (LLM-powered agent)
- Entity Extraction (NER agent identifies people, orgs, locations)
- Summarization & Sentiment (Analyzer agent)
- Results Compilation & Storage (saved locally in JSON)
- UI Feedback/Export (Markdown, JSON, CSV)
flowchart TD
A([User Uploads PDF/DOCX])
B([Text Extraction])
C([Section Extraction Agent])
D([Entity Recognition Agent])
E([Summarize + Sentiment Agent])
F([Results Saved Locally])
G([Chainlit Web UI Shows Results/Export])
H((User))
A --> B
B --> C
C --> D
D --> E
E --> F
F --> G
G -- "Download (Markdown/JSON/CSV)" --> H
B -. CLI Mode .-> F
All results are saved in analysis_history.json for:
- Historical reference
- Audit purposes
- Quick retrieval without reprocessing
PrivyDoc/
├── multi_agent_doc_analysis.py # Main application
├── analysis_history.json # Local analysis
├── requirements.txt
└── README.md
foundrylocal: Microsoft Foundry Local SDKchainlit: Web UI frameworkpdfplumber: PDF text extractionpython-docx: DOCX text extractionagent_framework: Create & orchestrate agents
Contributions are welcome! Fork the repo, create your feature or fix branch, and submit a PR.
Licensed under the MIT License — see LICENSE.
![]() Shivam Goyal |
