[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-77839":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":41,"readmeContent":42,"aiSummary":43,"trendingCount":16,"starSnapshotCount":16,"syncStatus":15,"lastSyncTime":44,"discoverSource":45},77839,"lavern","AnttiHero\u002Flavern","AnttiHero","An agentic law firm. Yours. 67 specialist AI agents that review documents through evidence-backed debate, with mandatory human gates and a 10-pass verification loop. Apache 2.0.","https:\u002F\u002Flavern.ai",null,"TypeScript",241,79,7,2,0,1,13,183,5,5.71,"Apache License 2.0",false,"main",true,[27,28,29,30,31,32,33,34,35,36,37,38,39,40],"agentic-ai","ai-agents","anthropic","claude","contract-review","law-firm","legal-ai","legal-tech","mcp","mistral-ai","model-context-protocol","multi-agent","open-source","typescript","2026-06-12 02:03:45","# Lavern\n\n**A multi-agent legal system. Apache 2.0.**\n\nA team of 67 agent prompts (specialists plus orchestrators) coordinating through a debate protocol. The system reads documents, posts findings with cited evidence, runs three layers of verification, and pauses at a human gate before critical decisions land. Runs against Anthropic, Mistral (EU), or fully local via Ollama.\n\nBuilt by a law firm founder over six months because the prevailing \"AI as a junior associate\" framing felt like the wrong analogy to start from. Whether this is the right one is what we're publishing to find out.\n\n[**Watch the demo →**](https:\u002F\u002Flavern.ai\u002Fdemo\u002F) · [**lavern.ai**](https:\u002F\u002Flavern.ai) · [**Architecture deep-dive →**](https:\u002F\u002Flavern.ai\u002Farchitecture\u002F) · [**Quick Start →**](QUICKSTART.md)\n\n> **This is not a product.** Lavern is best understood as a collection of ideas in one repo. A polished demo of how we could build in the future.\n>\n> You can criticise it for not working as a \"product\". That misses the mark. It is not meant to be a product. It is a source of inspiration.\n>\n> It is at least ten things, several of which are, on their own, products somebody could build a company around. They are sitting in the repo. Take whichever ones you want.\n\n> **What is and isn't stress-tested.** The architecture is real and the code is open. The pipeline runs, the agents debate, the verification loops fire, the precedent board persists, the tests pass. What hasn't been independently validated is the *quality bar*: whether all this machinery produces materially better outputs than a well-prompted single LLM on a representative sample of real legal work. We have internal evaluation; we don't have a public benchmark. Treat the engineering as the contribution and the legal-quality claims as a hypothesis.\n\n## Install\n\nmacOS \u002F Linux:\n\n```bash\ncurl -fsSL lavern.ai\u002Finstall.sh | sh\n```\n\nWindows (PowerShell):\n\n```powershell\nirm lavern.ai\u002Finstall.ps1 | iex\n```\n\nEither script clones the repo, installs backend and frontend dependencies, and gives you a `lavern` command. The 60-second walkthrough is in [QUICKSTART.md](QUICKSTART.md).\n\nBy hand:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FAnttiHero\u002Flavern.git\ncd lavern\nnpm install\n(cd viz && npm install)\n```\n\nThen:\n\n```bash\nnpm run serve:dev          # API server on :3000 (LOCAL MODE, no API key needed)\ncd viz && npm run dev      # Dashboard on :5173, hot reload\nopen http:\u002F\u002Flocalhost:5173\n```\n\nDemo mode runs the dashboard, the Clawern view, and the cinematic guided tour without an API key. To run real engagements, add `ANTHROPIC_API_KEY` (or `MISTRAL_API_KEY` for the EU provider) to `.env`. It's auto-created from `.env.example` on first run.\n\n## What's in the box\n\n- **67 agent prompts**: 59 specialists, 7 workflow-specific orchestrators (`orchestrator-{adversarial,counsel,full-bench,review,roundtable,tabulate,verification}.ts`), and 1 generic base orchestrator (`orchestrator.ts`)\n- **21 MCP tools** for debate, scoring, verification, grounding, memory, knowledge base, quality checks\n- **9 workflows** from a single-specialist counsel call to a full adversarial review\n- **5 seeded legal datasets**: CUAD, MAUD, ACORD, UNFAIR-ToS, LEDGAR (each under its own license; see NOTICE). ContractNLI was previously included; it was removed because its CC BY-NC-SA 4.0 license is incompatible with Apache 2.0. Fetch it yourself if you need it.\n- **3 inference providers**: Anthropic Claude (US), Mistral AI (EU), or local via Ollama\n- **1,677 tests** across 105 files. Clean `tsc --noEmit` on backend and frontend.\n\n## Three modes\n\n**Interactive.** Open the dashboard, brief the system in plain language, watch the agents work in a live activity feed, approve critical calls at human gates. Each engagement produces the deliverable plus an audit bundle: structured findings, debate resolutions, verification results, and a cost log.\n\n**Clawern (autonomous).** Point it at a folder. Clawern processes new documents on a 30-minute heartbeat, accumulates a precedent board across past reviews, and pushes findings to Telegram, email, or macOS notifications. Includes weekly digest, multi-client isolation, audit trail, cost forecasting, hybrid local-plus-frontier processing.\n\n**EU mode.** Set `LAVERN_PROVIDER=mistral` and the orchestrator, agents, debate, verification, briefing analyser, partner consult, agent-builder, and Clawern processing all route through Mistral AI in Paris instead of Anthropic. One feature, the Lavern Challenge (blind document comparison) at `src\u002Fapi\u002Froutes\u002Fchallenge.ts`, still instantiates the Anthropic client directly and will hit Anthropic even when Mistral is selected. If you need a strict EU boundary, avoid that feature for now. Use `claw start --ethical` to enforce Mistral-only with conservative risk posture across the rest of the pipeline.\n\n## What \"67 agents\" actually means\n\nEach agent is a specialised system prompt with its own role, MCP tool permissions, and slot in the debate protocol. All 67 run on the same underlying frontier LLM (Claude or Mistral, your choice), so yes, at the bottom of the stack it's an LLM.\n\nThe work isn't the prompts. The work is the four things wrapped around them:\n\n- **The debate protocol.** Agents must cite specific text from the parsed document. Findings without citations don't enter the board. Agents can challenge each other; the challenger has to cite text too.\n- **Three-layer verification.** Evaluator gate (drops weak findings) → adversarial debate (red team \u002F blue team) → 10-pass verification pipeline (`src\u002Fworkflows\u002Ftemplates\u002Fverification.ts`). The 10 passes are: `context`, `ux`, `clarity`, `structure`, `accuracy`, `completeness`, `risk`, `formatting`, `legal_design`, `delivery` (see `src\u002Ftypes\u002Fverification.ts` for the full pass definitions). Each layer fails closed independently. Separate from this pipeline, the mechanical grounding verifier in `src\u002Fmcp\u002Ftools\u002Fgrounding-verifier.ts` cross-checks every cited quote against the parsed document via string matching.\n- **Human gates.** Critical findings don't auto-deliver. The orchestrator surfaces the call and waits for a human to approve or override.\n- **Precedent Board.** Persistent memory across engagements. Findings that recur across documents get reinforced; stale ones decay. A new pattern enters as \"tentative\" and gets promoted to \"confirmed\" once it recurs enough times with consistent verdicts.\n\nWhether all of that actually adds up to materially better outputs than a single well-prompted LLM is an open empirical question. We have structures in place to test it; we don't claim to have settled it.\n\n## LOCAL MODE (the default in v0.15.0)\n\nOut of the box Lavern runs single-user on your machine. No login, no signup, no cookies. Every request is the synthetic `local-user`. Account routes, Google OAuth, email verification, password reset, Stripe billing, and the referral system are all gated behind `LAVERN_AUTH_ENABLED=true` and don't register at startup.\n\nFlip the flag if you want to host Lavern for a team. The database schema is unchanged; the v0.14 cookie-based multi-user flow comes back online with no migration.\n\n## Dashboard\n\nReact SPA, editorial design language (Newsreader serif, Geist sans, cream paper). WCAG AA accessible, responsive across desktop, tablet, and phone.\n\n**Flow:** Landing → Briefing → Strategy → Team → Working → Delivery.\n\nThe Working view shows agents posting findings, debating, and resolving disputes in real time. The Delivery view includes confidence scores, grounding indicators, and the audit trail.\n\n## API\n\n```bash\nnpm run dev -- --serve     # Start API server, default localhost:3000\n```\n\n| Endpoint | Description |\n|---|---|\n| `POST \u002Fapi\u002Fsessions` | Create analysis session |\n| `GET \u002Fapi\u002Fsessions\u002F:id\u002Fevents` | WebSocket event stream |\n| `POST \u002Fapi\u002Fsessions\u002F:id\u002Fgate` | Submit gate decision |\n| `GET \u002Fapi\u002Fsessions\u002F:id\u002Fdownload` | Download work product |\n| `POST \u002Fapi\u002Fengage` | Agent-native engagement (sync plus webhook) |\n| `GET \u002Fapi\u002Fcapabilities` | Report auth state, billing state, provider, version |\n| `GET \u002F.well-known\u002Fagent.json` | A2A agent card |\n\nSee [`.env.example`](.env.example) for full configuration. Key variables:\n\n- `ANTHROPIC_API_KEY`. Anthropic API key. Optional in demo mode.\n- `MISTRAL_API_KEY`. Mistral API key. Required if `LAVERN_PROVIDER=mistral`.\n- `LAVERN_PROVIDER`. `anthropic` (default), `mistral`, or `local` (Ollama).\n- `LAVERN_AUTH_ENABLED`. Set `true` to enable cookie auth, Stripe billing, and Google OAuth. Default: off.\n- `SHEM_PORT`. Server port. Default: 3000.\n- `SHEM_DEFAULT_BUDGET`. Per-session budget in USD. Default: 5.0.\n\n## Clawern commands\n\n```bash\nnpm run dev -- claw init       # Interactive setup\nnpm run dev -- claw validate   # Configuration health check\nnpm run dev -- claw start      # Start watching\nnpm run dev -- claw pause      # Pause processing\nnpm run dev -- claw resume     # Resume processing\n```\n\nIncludes a 30-minute heartbeat, Telegram bot, email alerts, weekly digest, scheduled re-review, change detection, cost forecasting, portfolio intelligence, hybrid local-plus-frontier processing, multi-client isolation, audit trail, and Prometheus metrics. `claw start --ethical` runs in Mistral EU only with a conservative risk posture.\n\n## Development\n\n```bash\nnpm test                  # 1,677 tests across 105 files\nnpm run typecheck:all     # TypeScript check (backend plus frontend)\nnpm run build             # Build backend\ncd viz && npm run build   # Build dashboard\n```\n\n## Project structure\n\n```\nsrc\u002F\n├── agents\u002F             67 agent prompts plus profiles plus definitions\n├── api\u002F                Fastify API server, WebSocket, middleware\n├── assembly\u002F           Document assembly, format conversion\n├── claw\u002F               Clawern: 28 modules (watch, plan, process, deliver,\n│                       precedents, audit, backup, telegram, multi-client,\n│                       hybrid analysis, anonymization)\n├── db\u002F                 SQLite persistence\n├── documents\u002F          Parser (PDF, DOCX, MD, TXT) plus sanitization\n├── mcp\u002Ftools\u002F          21 MCP tools\n├── mcp\u002Fremote-bridge\u002F  JSON-RPC bridge exposing Counsel tools to Anthropic\n│                       Managed Agents (gated by env flag)\n├── providers\u002F          LLM provider abstraction (Claude, Mistral, local)\n├── workflows\u002F          9 templates plus executor\n├── config.ts           Centralised config (env-var backed)\n└── index.ts            Entry point\n\nviz\u002F                    React dashboard\nsite\u002F                   Marketing site (static, Netlify)\nmenubar\u002F                macOS menu bar app (SwiftUI)\ntests\u002F                  1,677 tests across 105 files\n```\n\nFull architectural detail in [CLAUDE.md](CLAUDE.md), the same context Claude Code reads when working on this repo.\n\n## Connectors\n\nThe 21 MCP tools, 5 bundled legal datasets, 3 inference providers (Anthropic, Mistral, Ollama), and the remote MCP bridge are documented in [CONNECTORS.md](CONNECTORS.md).\n\n## Status and known limitations\n\nLavern is at **v0.15.0**, the initial public open-source release. The engine, Clawern daemon, and dashboard are stable enough to run end-to-end against real documents; the test suite passes; `tsc --noEmit` is clean on both backend and frontend.\n\nKnown limitations we're not hiding:\n\n- **No public benchmark.** Internal evaluation only. The quality-of-output claim is a hypothesis. We'd welcome help building a defensible benchmark.\n- **Multi-agent debate is imperfect.** Agents sometimes don't listen to each other. Sometimes one dominates. Sometimes they swing to the opposite extreme when challenged, not because the challenge was stronger but because it was newer. We've built structure around the problem (evidence requirements, confidence thresholds, adversarial roles, escalation protocols), not solved it.\n- **67 agents is probably more than needed.** Started with about a ten, just kept adding. There is also the agent builder mode if you want to build more. And Jude Claw.\n- **No dense or vector retrieval.** The knowledge base uses BM25-style full-text search (SQLite FTS5). There's no embedding layer, no hybrid retrieval, no semantic precedent search. For high-recall retrieval across large document sets, that's the obvious next move; we haven't done it yet.\n- **No durable task queue.** Long-running work flows through an in-process event bus and the Clawern daemon, not a Redis-backed queue with retry, dead-letter, and priority semantics. Session state persists (archive, precedent board), but if the server restarts mid-engagement the work needs to be re-kicked. Fine for the demo demonstrating the ideas; you'd want a real queue before running this at volume.\n- **Counsel deliveries are slow.** A Counsel engagement on Cloud (Anthropic) takes 5–10 minutes end-to-end. Three things stack: the agent produces a long free-form transcript (rich audit trail, by design), the assembler runs a Sonnet cleanup pass to strip the chatter, and assembly calls are non-streaming so the dashboard sits on \"Assembling…\" with no progress feedback until the call completes. Other workflows (Review, Roundtable, Full Bench) are faster because they produce structured findings the assembler can format deterministically. Streaming assembly + a Haiku cleanup pass + marker-wrapped deliverables are the obvious wins for v0.15.1.\n- **EU mode has one known gap.** The Lavern Challenge route (`src\u002Fapi\u002Froutes\u002Fchallenge.ts`) still instantiates Anthropic directly even when `LAVERN_PROVIDER=mistral`. The rest of the pipeline routes through Mistral. If you need strict EU boundary, avoid that feature until it's ported.\n- **Remote MCP bridge is preview.** Gated behind a feature flag.\n- **The HTTP API is evolving.** Expect non-breaking additions before a v1.0 freeze; pin a tag if you depend on it.\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md). New agents, new MCP tools, new workflow templates are all welcomed. The agent prompts are pure markdown, editable in any editor.\n\n## Security\n\nFound a vulnerability? See [SECURITY.md](SECURITY.md). Email `hello@lavern.ai`. Please don't file public GitHub issues for security bugs.\n\n## License\n\n[Apache 2.0](LICENSE). Copyright 2025–2026 Antti Innanen.\n\nSee [NOTICE](NOTICE) for third-party attributions and dataset licenses.\n","Lavern 是一个多代理法律系统，由67个专门的AI代理组成，通过基于证据的辩论审查文档，并结合三层验证和必要的人工审核环节。项目采用TypeScript编写，支持Anthropic、Mistral（欧盟）或本地Ollama运行环境。其核心功能包括文档审阅、多层验证及人工把关，旨在提高法律工作的准确性和效率。适用于需要高精度文档审查和复杂决策过程的法律场景，如合同审查等。Lavern 并非一个成熟的产品，而是一个展示未来可能构建方式的概念性项目，鼓励开发者从中汲取灵感并进行创新。","2026-06-11 03:56:10","CREATED_QUERY"]