Legal Agent
Reviews, drafts, and advises on legal documents with a traced reasoning chain: clause, applicable principle, analysis, and recommendation. Extracts reusable precedent from every review. Not legal advice.
OVERVIEW
Reviews, drafts, and advises on legal documents with a traced reasoning chain: clause, applicable principle, analysis, and recommendation. Extracts reusable precedent from every review. Not legal advice.
ARCHITECTURE
The agent runs through a Next.js API route that validates input, enforces rate limits, classifies the legal input by practice area, infers whether the matter calls for legal advice or a composed artifact, constructs the appropriate prompt pipeline via OpenRouter, and streams structured output over SSE. The client now separates input type from legal intent: Single and Batch control whether one matter or many are processed, while the backend inference layer decides the final artifact path. Reusable clauses extracted during advice-style analysis can still feed back into future artifact generation.
FUNCTIONALITY
- Single: accepts one legal matter and infers whether the matter calls for legal advice, a composed artifact, or both
- Batch: processes multiple legal matters sequentially and saves derived results into Portfolio
- LEGAL CONTEXT: the Results tab exposes Problem Intent, Party Positions, Governing Framework, Precedent, and Document Type
- LEGAL INSIGHT: the Results tab exposes Classification, Coverage, Interactions, Exposure, and Dependencies
- LEGAL ACTION: the Results tab exposes Required Modifications, Procedural Steps, and Compliance Steps
- LEGAL AUDIT: the Results tab exposes Structural Completeness, Internal Consistency, Jurisdiction Conformance, and Risk Score
- Inference: classifies the input by practice area (corporate, employment, IP, regulatory, commercial) and adapts analysis posture accordingly
- Reuse: can derive reusable clause patterns from document-like inputs and feed them into the reusable clause library
- All output positioned as legal analysis to surface what to take to your lawyer, not a legal opinion
HOW IT WORKS
The user selects Single or Batch, not a legal mode. In Single, they submit one matter; in Batch, they submit several. The backend infers whether each matter needs legal advice, a composed artifact, or both. It then classifies the matter by practice area, runs the corresponding legal analysis spine, and streams a normalized result into the invariant Results information architecture: LEGAL CONTEXT first, then LEGAL INSIGHT, LEGAL ACTION, and LEGAL AUDIT. Derived snapshots and reusable clause patterns can be saved into Portfolio without storing raw legal source material.
OUTCOMES
- Removes up-front mode confusion by inferring the legal task from the submitted matter
- Supports one-matter and many-matter workflows through Single and Batch
- Keeps the Results tab structurally stable regardless of inferred legal intent
- Adapts analysis posture by practice area so employment agreements and MSAs get different treatment