A step-by-step guide to setting up the Docman development environment from scratch on a brand-new Windows 11 PC.
No prior developer experience is assumed. If you already have some of these tools installed, skip those steps.
- Python 3.13 — the programming language everything runs on
- uv — fast Python package manager (replaces pip and venv)
- Git — version control for downloading and contributing to the code
- Docker Desktop — runs NATS (message broker) and Valkey (data store) in containers
- Ollama — runs AI models locally on your PC
- Heddle — the orchestration framework
- Docman — the document processing pipeline you'll be testing
Total time: roughly 45–60 minutes (depending on your internet speed).
- Press Win + I to open Settings
- Go to System → About
- Look for Edition: you need Windows 11 (Home, Pro, or Education all work)
- Look for OS build: you need 22631 or higher
Most Windows PCs use Intel or AMD processors (x64). Some newer devices (Surface Pro, Copilot+ PCs) use ARM-based Snapdragon processors. This guide covers both, with notes where they differ.
To check: in System → About, look at System type — it will say either "x64-based processor" or "ARM-based processor".
Windows Terminal is the modern command-line application for Windows 11.
- Press Win + X (or right-click the Start button)
- Click Terminal (or Terminal (Admin) if available)
You should see a PowerShell window with a blinking cursor. This is where you'll type all commands.
If you don't see Terminal: Open the Microsoft Store, search for "Windows Terminal", and install it.
Important: Some commands in this guide need administrator access. If a command fails with "Access denied", close Terminal and reopen it by right-clicking the Start button and choosing Terminal (Admin).
winget is Windows' built-in package manager. It should already be available on Windows 11. Verify:
winget --versionIf you see a version number (like v1.9.x), you're good. If not:
- Open the Microsoft Store
- Search for App Installer (by Microsoft)
- Install or update it
winget install --id Git.Git -e --source wingetClose and reopen Terminal so Git is available in your PATH. Then verify:
git --versionYou should see git version 2.x.x.windows.x.
winget install -e --id Python.Python.3.13
winget install -e --id astral-sh.uvClose and reopen Terminal again. Then verify:
python --versionYou should see Python 3.13.x.
Note: On Windows, the command is
python(notpython3as on macOS/Linux).If you see the Microsoft Store open instead: Windows sometimes redirects the
pythoncommand to the Store. After installing Python via winget, close Terminal completely, reopen it, and try again.
Docker Desktop runs containers (small isolated environments) on your PC. We use it for NATS and Valkey.
Docker Desktop needs WSL2 (Windows Subsystem for Linux). Open Terminal as Administrator and run:
wsl --installThis installs WSL2 and Ubuntu. Restart your computer when prompted.
After restarting, Ubuntu may open a window asking you to create a username and password. You can set these to anything simple — they're only for the Linux subsystem, not your Windows account.
winget install Docker.DockerDesktopAfter installation:
- Open Docker Desktop from the Start menu
- Accept the license agreement
- Wait for it to finish starting (you'll see "Docker Desktop is running" in the system tray)
Note for ARM/Snapdragon PCs: Docker Desktop on ARM is in early access. It works but you may encounter occasional issues with certain container images. If a container fails to start, try pulling the ARM-specific image tag (e.g.,
nats:2.10-alpineusually has ARM support built in).
Verify Docker works:
docker --version
docker run hello-worldOllama runs AI models locally on your PC.
- Go to ollama.com/download/windows
- Download and run OllamaSetup.exe
- Follow the installer — it doesn't need administrator rights
After installation, Ollama runs in the background (you'll see its icon in the system tray near the clock).
Open a new Terminal window and download the AI model:
ollama pull command-r7b:latestThis downloads about 5 GB. Wait for it to complete.
Verify it works:
ollama listYou should see command-r7b:latest in the list.
GPU acceleration: If you have an NVIDIA graphics card, Ollama will automatically use it for faster inference. AMD Radeon GPUs are also supported. Intel and Snapdragon GPUs are not currently supported by Ollama — it will fall back to CPU, which is slower but still works.
Make sure Docker Desktop is running (check for its icon in the system tray), then:
docker run -d --name heddle-nats -p 4222:4222 nats:2.10-alpine
docker run -d --name heddle-valkey -p 6379:6379 valkey/valkey:8-alpineVerify they're running:
docker psYou should see two containers: heddle-nats and heddle-valkey.
Note: These containers stop when you restart your PC or close Docker Desktop. To start them again:
docker start heddle-nats heddle-valkey
Create a directory for the project and clone the repositories:
mkdir C:\Dev\IranTransitionProject
cd C:\Dev\IranTransitionProject
git clone https://github.com/getheddle/heddle.git
git clone https://github.com/IranTransitionProject/docman.git
git clone https://github.com/IranTransitionProject/baseline.gitNote: If these are private repositories, you'll need to authenticate with GitHub first:
winget install GitHub.cli gh auth loginFollow the prompts to log in with your GitHub account.
uv manages virtual environments and dependencies automatically — no manual venv activation needed.
# Install Heddle (the framework) with all extras
cd C:\Dev\IranTransitionProject\heddle
uv sync --all-extras
# Install Docman (the test project) with dev tools
# This also resolves Heddle from the sibling directory automatically
cd C:\Dev\IranTransitionProject\docman
uv sync --extra devThis will download and install many packages (including PyTorch for document processing). This is the longest step — it may take 10–15 minutes.
Note for NVIDIA GPU owners: By default, uv installs CPU-only PyTorch on Windows. To enable GPU acceleration for Docling's document layout detection, install the CUDA version instead:
uv pip install torch torchvision --index-url https://download.pytorch.org/whl/cu124Run this before
uv sync --extra dev. If you don't have an NVIDIA GPU, skip this — CPU works fine, just slower.
Verify installation:
uv run heddle --helpYou should see a list of Heddle commands: worker, processor, pipeline, orchestrator, scheduler, router, submit, mcp.
Docling uses AI models for document layout detection. Pre-download them:
uv run docling-tools models downloadThis downloads a few hundred MB. They're cached in your user profile under .cache\docling\models\.
Verify everything is installed correctly:
# Test Heddle
cd C:\Dev\IranTransitionProject\heddle
uv run pytest tests/ -v --ignore=tests/test_integration.py
# Test Docman
cd C:\Dev\IranTransitionProject\docman
uv run pytest tests/ -vAll tests should pass (green). The Heddle integration test is excluded because it needs the full pipeline running.
cd C:\Dev\IranTransitionProject\docman
$env:NATS_URL = "nats://localhost:4222"
$env:OLLAMA_URL = "http://localhost:11434"
$env:OLLAMA_MODEL = "command-r7b:latest"mkdir C:\temp\docman-workspace -ForceIf you have a PDF you'd like to test with, copy it there:
Copy-Item "$HOME\Downloads\your-document.pdf" C:\temp\docman-workspace\.\scripts\dev-start.ps1This starts the pipeline components in the background: router, extractor, classifier, summarizer, ingest, and pipeline orchestrator.
.\scripts\dev-start.ps1 -Action submit -File test_report.pdfGet-Content .dev-pids\*.log -Tail 30 -WaitPress Ctrl + C to stop watching logs.
.\scripts\dev-start.ps1 -Action stopWorkers are defined by YAML configuration files. To create a new one:
-
Copy an existing worker config:
Copy-Item configs\workers\doc_classifier.yaml configs\workers\my_new_worker.yaml -
Edit the file in any text editor (Notepad, VS Code, etc.) to define your worker's system prompt, input/output schemas, and behavior
-
Start it:
uv run heddle worker --config configs\workers\my_new_worker.yaml --tier local --nats-url nats://localhost:4222
See heddle\configs\workers\_template.yaml for a blank template with documentation.
Processing backends handle non-LLM tasks (like document extraction). To create one:
-
Create a new Python file in
docman\src\docman\backends\ -
Implement the
ProcessingBackendinterface from Heddle -
Reference it in a worker config:
processing_backend: "docman.backends.my_backend.MyBackend"
See docman\src\docman\backends\docling_backend.py for an example.
Pipeline stages are defined in configs\orchestrators\doc_pipeline_local.yaml. You can:
- Reorder stages
- Add new stages that reference your workers
- Change input mappings to pass data between stages
# See available models
ollama list
# Pull a new model
ollama pull llama3.2:3b
# Set it as the active model
$env:OLLAMA_MODEL = "llama3.2:3b"
# Restart the pipeline
.\scripts\dev-start.ps1 -Action stop
.\scripts\dev-start.ps1If you're switching between a Mac and a Windows setup, here are the important differences:
| What | macOS | Windows |
|---|---|---|
| Terminal command | python3 |
python |
| Run tools | uv run <command> |
uv run <command> |
| Path separator | / (forward slash) |
\ (backslash) |
| Startup script | ./scripts/dev-start.sh |
.\scripts\dev-start.ps1 |
| Extractor config | doc_extractor.yaml (MPS GPU) |
doc_extractor_windows.yaml (CPU) |
| OCR engine | ocrmac (macOS native) |
easyocr (cross-platform) |
| GPU acceleration | MPS (Metal, automatic) | CUDA (NVIDIA only, needs manual PyTorch install) |
| Container runtime | OrbStack (recommended) | Docker Desktop (requires WSL2) |
| Workspace path | /tmp/docman-workspace |
C:\temp\docman-workspace |
Close Terminal completely. Reopen it and try python --version again. If it still doesn't work, check that Python is in your PATH:
where.exe pythonIf nothing shows up, you may need to add Python to your PATH manually. Open Settings → System → About → Advanced system settings → Environment Variables, and add Python's install directory to the Path variable.
Run this once:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserUse uv run heddle instead of bare heddle. Or re-run uv sync in the project directory:
cd C:\Dev\IranTransitionProject\heddle
uv sync --all-extras- Make sure virtualization is enabled in your BIOS/UEFI settings (usually under "Advanced" or "CPU Configuration" — look for "Intel VT-x" or "AMD-V" or "SVM Mode")
- Make sure WSL2 is installed:
wsl --status - Restart your computer after enabling virtualization
- If you don't have an NVIDIA GPU, Ollama runs on CPU which is slower. Models under 8B parameters (like
command-r7b:latestat 7B) are recommended for CPU-only setups. - Close other memory-heavy applications
- Make sure at least 8 GB of RAM is free
Make sure you ran uv sync in both repos (Step 9). Use uv run pytest to ensure the correct environment is used.
Most official Docker images include ARM support, but some community images don't. If docker run fails with an error mentioning "platform" or "architecture", check if an ARM-specific tag exists for that image.
For those who want to understand how the pieces fit together:
You submit a document (PDF/DOCX)
|
v
+---------------+ NATS message bus
| Pipeline |<---------------------> Coordinates the 4 stages
| Orchestrator |
+-------+-------+
| Stage 1: extract
v
+---------------+
| Extractor | DoclingBackend reads PDF -> extracts text, tables, structure
| (Processor) | Writes extracted JSON to workspace
+-------+-------+
| Stage 2: classify
v
+---------------+
| Classifier | LLM (Ollama) classifies document type from extracted text
| (LLM Worker) | Returns: document_type, confidence, reasoning
+-------+-------+
| Stage 3: summarize
v
+---------------+
| Summarizer | LLM (Ollama) produces structured summary
| (LLM Worker) | Returns: summary, key_points, word_count
+-------+-------+
| Stage 4: ingest
v
+---------------+
| Ingest | DuckDBIngestBackend persists all results to DuckDB
| (Processor) | Returns: document_id, status
+---------------+
All communication happens through NATS messages. Workers are stateless — they process one task at a time and reset. The router determines which worker handles each task based on deterministic rules (no AI involved in routing).