Run it locally: services, sandbox, knowledge
From `docker compose up` to the hardened code sandbox and the optional knowledge sidecar — what boots, what to lock down, and what is opt-in.
Quick Start
You'll need Docker and an OpenRouter API key (free tier is sufficient — pay-as-you-go credits, no monthly fee).
git clone https://github.com/anylegal-ai/anylegal-oss.git
cd anylegal-oss
cp .env.example .env
# Edit .env and paste:
# OPENROUTER_API_KEY (required — chat won't work without it)
#
# SERPER_API_KEY OR BRAVE_SEARCH_API_KEY
# (recommended — pick one. Without a search key the agent can't find
# sources to cite. Both have free tiers, no credit card:
# SERPER: https://serper.dev (~2.5K queries/mo)
# Brave: https://brave.com/search/api/ (2K queries/mo))
docker compose up
.env.example lists every other knob (encryption, cache TTLs, provider routing, optional secrets). Skim it once before first boot — most defaults are fine.
Adding or changing keys after first boot: edit .env, then recreate the affected services so they re-read it:
docker compose up -d --no-deps backend lexwiki-compiler
docker compose restart re-uses the cached env and won't pick up changes — use up -d instead.
First boot takes ~5 minutes (Docker pulls the base images, builds backend + frontend, installs LibreOffice — about 1 GB of downloads). Subsequent boots are seconds. When you see Uvicorn running on http://0.0.0.0:8000 and the frontend's ▲ Next.js ... Ready, you're up.
Open http://localhost:3000. You should see an empty workspace with a chat composer at the bottom. Try /research What's the standard term for an MSA in California? — that exercises the full agent loop (skill load → web search → LLM synthesis).
docker compose up brings up four services:
backend— FastAPI agent harness on port 8000frontend— Next.js workspace UI on port 3000libreoffice-service— DOCX conversion on port 8002 (internal-only, not exposed)lexwiki-compiler— async wiki-compilation sidecar (optional; comment out indocker-compose.ymlto disable)