-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
- Python 3.11+
- OpenRouter API key (get one here)
- Docker (optional — only for Langfuse tracing and local LLMs)
- 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-herepip install -e ".[dev]"No database setup needed — SQLite files are created automatically under data/
(mailroom.db for catalog + audit log, checkpoints.db for crash-resume).
Open three terminals:
Terminal 1 — Pipeline Watcher:
PYTHONPATH=src python -m pipeline.watcherTerminal 2 — API Server:
PYTHONPATH=src python -m api.mainTerminal 3 — Ops Monitor (optional):
PYTHONPATH=src python -m pipeline.ops_monitorcurl -X POST http://localhost:8000/upload \
-F "file=@src/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
If you configured observability, every LLM call is auto-traced — OBSERVABILITY_PROVIDER=auto resolves Langfuse if its key is set, else Braintrust if its key is set, else the local cost-free Arize Phoenix (PHOENIX_TRACING, no subscription needed). Open your backend's dashboard to see prompts, responses, latency, and token usage. The pipeline runs fine without any tracing.
| Variable | Required | Default |
|---|---|---|
OPENROUTER_API_KEY |
Yes | — |
DATABASE_URL |
No | sqlite+aiosqlite:///<MAILROOM_BASE_DIR>/mailroom.db |
OBSERVABILITY_PROVIDER |
No | auto |
LANGFUSE_HOST |
No | http://localhost:3000 |
MAILROOM_BASE_DIR |
No | ./data |
DEFAULT_PROVIDER |
No | openrouter |
- Repository docs/ — architecture, agents, configuration, and more
- Sister Repositories — the llm-mailroom umbrella map
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