Two distinct product specifications prepared for client review — covering the Document Comparison Tool and the Full Legal Assistant Platform.
Made by Aditya
A focused, single-purpose engine that automatically identifies how an uploaded legal document differs from a standard reference template.
Legal professionals routinely spend hours manually comparing drafted contracts against standard templates. This product eliminates that friction by automating the comparison pipeline — uploading a document triggers classification, reference matching, and a structured diff report — all within seconds. Think of it as "Grammarly, but for legal document differences."
MVP: Successfully parse uploaded PDFs and Word (.docx) files, extracting clean text for analysis.
Future: Advanced OCR for scanned documents and handwritten images.
MVP: Categorize document type (lease, NDA, sales contract) and match against the closest template in the database.
Future: Clause-level search and finer-grained categorization for complex document types.
MVP: Identify and highlight "usual markups" — the most common discrepancies between new drafts and standard templates.
Future: Advanced analysis for novel clauses and edge-case deviations outside standard patterns.
| Layer | Technology | Purpose | Notes |
|---|---|---|---|
| Frontend | React + TailwindCSS | Document upload, interactive diff viewer, report UI | Rich clause-level markup display, responsive |
| Backend | Python — FastAPI | Async REST API, agentic pipeline orchestration | FastAPI preferred for async LLM call handling |
| Document Parsing | Docling (IBM), PyMuPDF | Structure-aware extraction from PDF and Word — preserves headings, clause hierarchy, tables | Docling outperforms legacy parsers on legal doc layout; Future: multimodal LLM for scanned/handwritten docs |
| Document Classification & Extraction | Public LLM API (e.g. OpenAI, Anthropic) or Private / On-Premise SLM (e.g. Mistral, Llama 3, Phi-4) with structured JSON output | Zero-shot document type classification, key party extraction, clause identification — all in a single LLM pass. Public API is faster to deploy; Private SLM keeps all legal data fully on-premise — recommended for data-sensitive clients. | Choice is driven by data privacy posture: Public API = lower cost, faster iteration. Private SLM = full data sovereignty, no third-party exposure — critical for attorney-client privileged documents. |
| Embeddings | voyage-law-2 (Voyage AI) | Legal-domain-optimised embeddings for clause-level semantic search and template matching | State-of-the-art for legal semantic retrieval; significantly outperforms general-purpose embedding models on legal benchmarks |
| Knowledge Graph & RAG | Neo4j + Graph-RAG | Stores clause relationships, template dependencies, and statutory cross-references as a graph — enabling relational retrieval that flat vector search cannot achieve | Graph-RAG preserves the inherent relational structure of legal knowledge (clause → statute → precedent); critical for accurate template matching |
| Vector Store | Weaviate | Hybrid vector + keyword search over the template corpus | Native Graph-RAG integration; supports multi-tenancy out of the box |
| Semantic Diff Engine | LLM-as-Judge (Public LLM API or Private SLM — same choice as classification layer) | Clause-by-clause comparison using an LLM to reason about intent-level differences, not just text-level changes | Catches semantic deviations ("payment within 30 days" vs "payment within 45 days") and missing implied obligations that keyword diff entirely misses |
| Reranking | Cohere Rerank | Re-ranks retrieved template clauses by relevance before passing to the diff LLM | Improves precision of retrieval; reduces hallucination risk by ensuring the LLM sees the most relevant context first |
| Primary Database | PostgreSQL | User accounts, document metadata, report history, audit logs | Row-level security; GDPR-compliant data handling |
| File Storage | AWS S3 / Azure Blob | Encrypted document storage with lifecycle management | Pre-signed URLs; 90-day auto-expiry; versioning enabled |
| Auth | JWT + OAuth 2.0 | User authentication and role-based access | SSO-ready; MFA support |
| Infrastructure | Docker + Kubernetes (EKS / AKS) | Containerised, auto-scaling deployment | LLM API calls handled asynchronously via task queue (Celery + Redis) to avoid timeout on large documents |
User authenticates and uploads a legal document (PDF or .docx). File is encrypted at rest and assigned a unique session ID. A virus/malware scan is run on upload.
Docling (IBM's document intelligence library) parses the document with full layout understanding — preserving clause hierarchy, section headings, numbered lists, and table structures. Unlike simple text extractors, this produces a structured clause map, not a flat text dump, which is essential for accurate comparison downstream.
A single LLM call — via Public LLM API (e.g. OpenAI, Anthropic) or a Private / On-Premise SLM (e.g. Mistral, Llama 3, Phi-4) depending on the client's data privacy requirements — simultaneously identifies the document type, extracts key parties and dates, and produces a labelled clause inventory using structured JSON output. This replaces what previously required a separate fine-tuned classifier, an NER model, and a rule-based parser — with higher accuracy and zero training data maintenance.
Clause embeddings (via voyage-law-2) are queried against the Neo4j knowledge graph using Graph-RAG. Unlike flat vector search, Graph-RAG traverses relationships — a lease clause can retrieve not just similar lease clauses, but also the statutes those clauses reference and precedent deviations seen in prior documents. Cohere Rerank then re-scores retrieved results before passing them to the comparison step.
An LLM acting as a reasoning judge (Public API or Private SLM — consistent with the deployment choice made at classification) compares each uploaded clause against its retrieved template counterpart — identifying not just wording changes but intent-level deviations, missing obligations, and risk implications. Each finding is classified by severity (Critical / Advisory / Informational) with a plain-language explanation of why the deviation matters.
A structured diff report is generated with highlighted sections, severity ratings (Critical / Advisory / Informational), and suggested corrections. Delivered as an interactive UI view and downloadable PDF/Word report.
Prioritize clarity for non-technical legal professionals. Clean diff display, tooltip explanations, and plain-language summaries alongside technical details.
Each flagged difference includes a brief reasoning statement ("This clause deviates from standard payment terms by adding an early termination penalty"). Builds user trust.
End-to-end encryption (at rest and in transit). Role-based access control. Audit logging. Compliance with GDPR and relevant data protection regulations.
Containerized microservices allow horizontal scaling of the NLP processing layer. Document queue management prevents overload during peak usage.
| Control | Implementation | Standard |
|---|---|---|
| Data Encryption | TLS 1.3 in transit, AES-256 at rest | GDPR, SOC 2 |
| Access Control | Role-based access (Admin, Reviewer, Viewer) | Principle of least privilege |
| Audit Logging | All document access and API calls logged with timestamp and user ID | SOC 2 Type II |
| Data Retention | Configurable retention policies; documents purged after defined period | GDPR Art. 17 |
| Infrastructure | VPC isolation, WAF, DDoS protection via cloud provider | NIST CSF |
| Compliance Audit | Quarterly security reviews; penetration testing annually | GDPR, Industry-specific |
A full-stack, multi-role ecosystem connecting clients with lawyers — powered by AI-assisted triage, document understanding, draft generation, and lawyer workflow management.
Individuals facing legal issues often don't know how to respond to notices, which documents to gather, or how long to wait for professional help. Lawyers, meanwhile, spend disproportionate time on repetitive drafting and triage work. This platform sits between both parties — an AI layer that understands the legal situation, prepares structured summaries and draft responses, routes to a qualified lawyer for review, and delivers a final professional response to the client. Think of it as "A digital legal assistant + lawyer workflow system."
| Layer | Technology | Purpose | Notes |
|---|---|---|---|
| Client Portal | React + React Native | Web and mobile interface for clients | Single codebase, responsive + PWA |
| Lawyer Dashboard | React (Admin-grade UI) | Case management, AI tools, approvals | Real-time updates via WebSocket |
| Backend | Python — FastAPI + Django (hybrid) | FastAPI for async LLM-heavy endpoints; Django for admin, ORM, and case lifecycle management | Two services, same database; FastAPI handles agentic pipeline calls without blocking |
| Agentic Orchestration | LangGraph | Stateful multi-agent graph where each node is a specialist agent (Triage → Research → Drafting → Review). Handles conditional branching (e.g., request more docs before proceeding), retries, and human-in-the-loop checkpoints | Preferred over LangChain for complex legal workflows that require state persistence across async steps and conditional re-routing |
| Triage Agent | Public LLM API (e.g. OpenAI, Anthropic) or Private / On-Premise SLM (e.g. Mistral, Llama 3, Phi-4) with structured JSON output | Classifies legal issue type, identifies jurisdiction, flags urgency, detects missing documents, and generates a structured case brief — all in one agentic pass. Public API is faster to deploy; Private SLM ensures attorney-client privileged data never leaves the client's infrastructure. | This is the most data-sensitive point in the pipeline. For legal firms with strict confidentiality requirements, Private SLM on-premise or in a private cloud VPC is strongly recommended over a public API. |
| Research Agent | Graph-RAG over Neo4j + voyage-law-2 embeddings | Traverses the legal knowledge graph to retrieve statutes, case law, standard clauses, and procedural guides that are relationally connected to the client's issue — not just semantically similar | Graph-RAG is critical here: a contract dispute case needs to retrieve the relevant statute, cases interpreting that statute, and standard contract clauses — which are graph relationships, not vector neighbours |
| Drafting Agent | Public LLM API or Private / On-Premise SLM — consistent with the Triage Agent deployment choice | Generates a structured draft response grounded in retrieved legal references. Includes source citations for every claim so the reviewing lawyer can verify instantly | All draft content is attribution-anchored to the knowledge base; hallucination risk is substantially reduced by retrieval grounding + citation enforcement in the prompt. Same LLM deployment choice as triage — avoid mixing public and private within one pipeline for consistency and auditability. |
| Embeddings | voyage-law-2 (Voyage AI) | Legal-domain-optimised embeddings for semantic search across the knowledge graph and case corpus | Outperforms OpenAI and Cohere general embeddings on legal retrieval benchmarks; drop-in replacement with standard API |
| Vector Store | Weaviate | Hybrid vector + keyword search; stores embedded knowledge base documents and case summaries | Native Graph-RAG support; multi-tenancy for firm-level data isolation |
| Knowledge Graph | Neo4j | Stores the legal knowledge base as a graph of entities and relationships (statutes → clauses → cases → procedures) | Enables multi-hop retrieval that flat vector search cannot perform; essential for accurate legal research |
| Reranking | Cohere Rerank | Re-scores retrieved knowledge graph results before feeding to the drafting agent | Improves draft quality by ensuring the most contextually relevant references are prioritised |
| Primary Database | PostgreSQL | Cases, users, messages, audit logs, document metadata | Row-level security for multi-tenancy; GDPR-compliant |
| Cache / Queue | Redis + Celery | Session cache; async task queue for agentic pipeline jobs | Agentic pipelines run as background tasks; WebSocket pushes status updates to lawyer dashboard in real-time |
| Notifications | AWS SES / Twilio / Firebase | Email, SMS, push alerts for clients and lawyers | SLA breach alerts, case status updates, lawyer assignment notifications |
| Document Storage | AWS S3 / Azure Blob | Encrypted secure document storage | Pre-signed time-limited URLs; no permanent public links |
| Infra / DevOps | Docker + Kubernetes (EKS / AKS) | Containerised, auto-scaling microservices deployment | CI/CD via GitHub Actions; LangGraph agents deployed as independent scalable services |
Client registers with basic KYC verification. Guided onboarding explains how to describe their issue and what documents to prepare.
Client uploads documents (legal notices, contracts) and/or describes their legal situation in plain language via a guided intake form.
The LangGraph Triage Agent takes over: it classifies the legal issue type and jurisdiction using the configured LLM (Public API or Private SLM) with structured output — no separate classifier needed. It identifies missing or required documents and dynamically prompts the client for anything needed before proceeding. The agent loops — asking follow-up questions and processing new uploads — until it has sufficient information to proceed. This is a stateful agentic loop, not a single-pass classification.
Two specialist agents run in sequence within the LangGraph pipeline. The Research Agent queries the Neo4j legal knowledge graph using Graph-RAG — traversing statute → case → clause relationships to retrieve grounded, citation-backed references. The Drafting Agent (powered by the same configured LLM — Public API or Private SLM) then generates a structured response draft anchored to those citations, with every claim traceable to a source in the knowledge base. Cohere Rerank ensures the most relevant references are prioritised before the draft is written.
The case — with AI-generated brief, source-cited draft, and full document set — is routed to an available lawyer via the Case Router (by specialisation, jurisdiction, and workload). The lawyer reviews in the Dashboard, uses the AI Research Assistant for ad-hoc queries, edits the draft in the inline editor, and approves. A human-in-the-loop checkpoint in LangGraph ensures no response reaches the client without explicit lawyer approval.
Lawyer approves the final response. Client receives it via the portal and email within the agreed SLA (e.g., 24 hours). Case is marked resolved; client can follow up if needed.
Paginated, filterable list of incoming cases. Each case shows AI-generated issue type, priority, client summary, SLA timer, and document count at a glance.
Lawyer can query the legal knowledge base in natural language ("What are the standard eviction notice requirements in California?") and get cited answers instantly.
Rich text editor pre-populated with the AI draft. Inline AI suggestions for clause improvements. Track-changes style editing with version history.
Personal stats: cases handled, average response time, approval rate. Helps lawyers track their performance and the platform track SLA compliance.
| Content Type | Description | Update Frequency |
|---|---|---|
| Standard Templates | Jurisdiction-specific templates for common document types (NDA, lease, employment) | Quarterly |
| Statutory References | Relevant legislation excerpts, regulations, and code sections | On law change |
| Case Law Summaries | Curated summaries of landmark and relevant case decisions | Monthly |
| Procedural Guides | Step-by-step guides for common legal procedures (filing, responding) | Quarterly |
| Clause Library | Pre-approved clauses for common legal situations, tagged by risk level | Monthly |
| Control | Implementation | Standard |
|---|---|---|
| Data Encryption | TLS 1.3 in transit, AES-256 at rest for all documents and PII | GDPR, HIPAA-ready |
| Multi-Tenancy Isolation | Row-level security in PostgreSQL; no cross-firm data access | SOC 2 |
| Role-Based Access | Strict RBAC: Client, Lawyer, Admin, Super-Admin roles with permission matrices | Least privilege |
| Document Access | Pre-signed, time-limited S3 URLs; no permanent public links | GDPR Art. 32 |
| Audit Trail | Immutable log of all document views, edits, approvals, and API calls | SOC 2 Type II |
| Infrastructure | VPC, WAF, DDoS protection, private subnets for databases | NIST CSF |
| Compliance | GDPR, state bar regulations (US), attorney-client privilege safeguards | Jurisdiction-specific |
GPU-equipped cloud instances for model fine-tuning and evaluation. Isolated staging environment mirroring production.
Kubernetes-orchestrated microservices on AWS EKS or Azure AKS. Auto-scaling based on active case volume. Multi-AZ deployment for high availability.
Geo-redundant encrypted storage for legal documents. Tiered storage: hot for active cases, cold archive for closed cases after 90 days.
Redis caching for frequent queries. Async Celery workers for AI processing (prevents blocking API responses). CDN for static frontend assets.
A side-by-side reference to clearly distinguish the two systems in scope, complexity, and deployment approach.
Transparent hourly rates by role and technology discipline, with phased project budgets for both products — sized for a solo full-stack / AI developer — plus guidance for ongoing maintenance billed by the hour.
| Role | Discipline | Rate (USD/hr) | Scope of Work |
|---|---|---|---|
| Solution Architect | Architecture & Technical Leadership | $105 – $135 | Overall system design, technology decisions, integration architecture, cloud infrastructure planning, client-facing technical review |
| AI / ML Engineer | LLM Integration, RAG, Agentic Pipelines | $95 – $125 | LLM orchestration (LangGraph), Graph-RAG implementation, embedding pipeline, LLM-as-Judge diff logic, agentic workflow design and evaluation |
| Knowledge Graph Engineer | Neo4j, Graph-RAG, Data Modelling | $88 – $118 | Legal knowledge graph construction, entity-relationship modelling, Graph-RAG traversal queries, Weaviate integration, knowledge base ingestion pipelines |
| Backend Engineer | Python — FastAPI / Django | $70 – $92 | REST API development, database schema, case lifecycle management, async task queues (Celery + Redis), authentication, multi-tenancy implementation |
| Frontend Engineer | React / React Native | $65 – $88 | Client portal, lawyer dashboard, diff report viewer, real-time WebSocket updates, responsive design, accessibility compliance |
| DevOps / Cloud Engineer | Kubernetes, AWS / Azure, CI/CD | $75 – $98 | Container orchestration, auto-scaling configuration, VPC setup, WAF, S3 storage lifecycle policies, CI/CD pipelines, monitoring and alerting |
| Legal Domain Consultant | Legal Knowledge & Content QA | $82 – $115 | Template corpus curation, knowledge graph content validation, diff output legal accuracy review, regulatory compliance guidance (GDPR, state bar requirements) |
| QA / Test Engineer | Testing & Evaluation | $52 – $72 | Automated test suites, LLM output evaluation (hallucination detection, citation accuracy), end-to-end workflow testing, security penetration testing coordination |
| Project Manager | Delivery & Client Coordination | $60 – $78 | Sprint planning, milestone tracking, client communication, risk management, change request management, documentation |
| Phase | Duration | Key Activities | Roles Engaged | Estimated Cost (USD) |
|---|---|---|---|---|
| Phase 1 Discovery & Architecture | 1 week | Requirements finalisation, system design sign-off, LLM deployment decision (Public API vs Private SLM), knowledge graph schema sketch, minimal infra plan | Solo developer — architect / PM / AI hat (per rate card) | $3,800 – $4,500 |
| Phase 2 Data & Knowledge Foundation | 2 weeks | Starter template set, Neo4j + Weaviate wiring, voyage-law-2 embedding path, first Graph-RAG slice — enough to prove retrieval for one doc family | Solo developer — KG + backend + AI | $4,800 – $5,600 |
| Phase 3 Core AI Pipeline | 3 weeks | Docling parse path, LLM classification + clause map, retrieval + rerank, LLM-as-Judge diff MVP, severity labels | Solo developer — AI / ML + backend | $6,000 – $7,000 |
| Phase 4 Product & Frontend | 2.5 weeks | React upload + diff report UI, auth shell, export basics — shippable client demo | Solo developer — frontend + backend | $4,600 – $5,400 |
| Phase 5 Security, Testing & Deployment | 1.5 weeks | Hardening pass (TLS, secrets, RBAC basics), smoke + LLM eval spot-checks, single-region deploy (Docker / small K8s or PaaS) | Solo developer — DevOps + QA + AI | $3,400 – $4,100 |
| Phase | Duration | Key Activities | Roles Engaged | Estimated Cost (USD) |
|---|---|---|---|---|
| Phase 1 Discovery & Architecture | 1.5 weeks | Role + journey map (client / lawyer / admin), LLM placement choice, tenancy sketch, LangGraph outline, notification + SLA skeleton | Solo developer — architect / PM / AI | $3,600 – $4,200 |
| Phase 2 Data & Knowledge Foundation | 2 weeks | Neo4j + Weaviate baseline, starter corpus ingest, voyage-law-2 pipeline, thin admin for KB refresh | Solo developer — KG + backend + AI | $4,800 – $5,400 |
| Phase 3 Agentic AI Pipeline | 3 weeks | LangGraph triage → research → draft graph, HIL stub, rerank + citations wired for one vertical slice | Solo developer — AI / ML + backend | $6,400 – $6,900 |
| Phase 4 Case Management Backend | 2 weeks | Case + user models, router + SLA timers, Celery/Redis jobs, email notifications, Postgres RLS first pass | Solo developer — backend + DevOps | $4,900 – $5,500 |
| Phase 5 Frontend — Portals | 2.5 weeks | Client intake + status UI, lawyer queue + draft review shell, basic WebSocket or polling — web-first (mobile wrapper deferred optional) | Solo developer — frontend + backend | $5,400 – $5,900 |
| Phase 6 Security, Testing & Deployment | 1.5 weeks | Secrets, RBAC pass, GDPR-minded defaults, smoke tests + targeted LLM eval, Docker deploy to single cluster / PaaS | Solo developer — DevOps + QA + AI | $3,700 – $4,100 |
Law is not static. Statutes are amended, case law evolves, regulatory requirements change, and new document types emerge. A legal AI product that is not actively maintained becomes unreliable — and in the legal domain, unreliable means liability. Post-launch work is billed by the hour at the role rates above — no standing monthly retainer is required.
| Maintenance Activity | Frequency | Roles (billed per rate card above) |
|---|---|---|
| Legal Knowledge Graph Updates Statute amendments, new case law, updated templates | Monthly | Legal Domain Consultant + Knowledge Graph Engineer rates |
| LLM Pipeline Re-evaluation Prompt tuning as new model versions release, hallucination rate monitoring | Quarterly | AI / ML Engineer rate |
| Security Patches & Dependency Updates Framework updates, CVE patches, library upgrades | Monthly | DevOps + Backend Engineer rates |
| New Jurisdiction / Document Type Onboarding Expanding the template corpus to new states, countries, or document categories | On-demand | Legal Consultant + Knowledge Graph + AI/ML as needed |
| Feature Enhancements & Bug Fixes | As needed | Backend + Frontend + AI/ML Engineer rates |