-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
- Python 3.11+
- Docker and Docker Compose
- OpenRouter API key (get one here)
- 8GB+ RAM
git clone <repo-url>
cd llm-mailroom
cp .env.example .envEdit .env with your OpenRouter key:
OPENROUTER_API_KEY=sk-or-v1-your-key-heredocker compose -f docker/docker-compose.yml up -dThis starts Postgres, ClickHouse, and Langfuse. Verify:
docker compose -f docker/docker-compose.yml psAll services should show healthy or running.
pip install -e ".[dev]"Open three terminals:
Terminal 1 — Pipeline Watcher:
python pipeline/watcher.pyTerminal 2 — API Server:
python api/main.pyTerminal 3 — Ops Monitor (optional):
python pipeline/ops_monitor.pycurl -X POST http://localhost:8000/upload \
-F "file=@tests/fixtures/contract/sample_msa.txt" \
-F "matter_id=MATTER-001"Watch the watcher terminal — you'll see the pipeline log each stage. The document moves through:
-
inbox→processing→classified→ extracted →archived
# Get document status (use the doc_id from the watcher output)
curl http://localhost:8000/status/<doc_id>
# View the full audit trail
curl http://localhost:8000/audit/<doc_id>
# See pipeline-wide metrics
curl http://localhost:8000/ops/statusls -R data/archive/MATTER-001/The document is now in its final home: data/archive/MATTER-001/contract/sample_msa.txt
Open http://localhost:3000 in your browser. Set up your first user account.
You'll see traces for every LLM call: classification, extraction, reporting — with full input/output, latency, and token usage.
| Variable | Required | Default |
|---|---|---|
OPENROUTER_API_KEY |
Yes | — |
DATABASE_URL |
No | postgresql+asyncpg://mailroom:mailroom@localhost:5432/mailroom |
LANGFUSE_HOST |
No | http://localhost:3000 |
MAILROOM_BASE_DIR |
No | ./data |
DEFAULT_PROVIDER |
No | openrouter |
- Configuration — customize taxonomy, thresholds, and model mappings
- Architecture — understand the full system design
- Agents — learn about each specialist agent
Mailroom — Multi-Agent Legal Document Processing Pipeline. Built with LangGraph and OpenRouter; SQLite by default, Postgres optional.
- Repo docs/ — canonical docs (architecture, agents, configuration, API, deployment, local models)
- Sister Repositories — the llm-mailroom umbrella map