Sefism is free for learners. We are here to help you grow, one step at a time.Join for free
Sefism.
Web

Legal Document Assembly with Guided Interviews for Small Law Chambers

A web app for small law chambers and solo lawyers that turns their Word templates (rent agreements, affidavits, legal notices, partnership deeds) into guided question flows and generates finished documents in DOCX and PDF. An intermediate final year project in legal tech and document automation.

Difficulty

Intermediate

A small team, or one strong student willing to learn something new.
Effort

2 semesters · 2 to 3 students

Deliverables

7 to ship

3 optional extras

Suggested stack

React with TypeScriptNode.js or Python (FastAPI)PostgreSQLdocxtemplater or python-docxLibreOffice headless for PDFVitest or Pytest
A suggestion, not a requirement. Swap anything for what you already know.

What you should ship

  • Template upload: a DOCX with placeholders, conditionals and repeating sections written in a small documented syntax
  • Template parser that extracts variables, their types and conditions, and reports syntax errors with line context
  • Automatically generated guided interview that asks only the questions needed, skipping sections whose conditions are false
  • Document generation to DOCX and PDF that keeps the original formatting, numbering and fonts
  • Clause library: reusable clauses (arbitration, jurisdiction, notice period) inserted into many templates and versioned
  • Client matter records so answers are reused across documents for the same client
  • Template version history with a diff of changed clauses and which documents used which version

If you have time left

  • Bilingual templates with Urdu or another right-to-left language sections rendered correctly in DOCX
  • Client-facing intake link where a client answers the factual questions before meeting the lawyer
  • Numbers and dates to words (amounts in words for agreements) in more than one language

The problem small law chambers have with repetitive drafting

A solo lawyer or a small chamber drafts the same kinds of documents every week: rent and lease agreements, affidavits, legal notices, partnership deeds, powers of attorney. The usual method is to open last month's file, change names and amounts, and hope nothing from the old client survives. A missed pronoun or an old CNIC number in a notice is embarrassing; a wrong clause in an agreement is worse. Junior associates spend hours on this instead of legal work.

What already exists and the gap

  • Docassemble is a free, open source expert system for guided interviews and document assembly. It is powerful, but templates are written in YAML and Python, so it usually needs a developer.
  • HotDocs is an established template automation product aimed at larger firms with high document volume.
  • Clio Draft (formerly Lawyaw) automates court forms and documents from Clio matter data, best for firms already on Clio.
  • Local practice management tools such as WakeelDesk and Case Mate focus on hearings, reminders and fees rather than drafting.

The gap is document automation a non-technical lawyer can set up by editing a Word file they already have, priced for a solo practice, and able to handle local formats such as amounts in words and bilingual documents.

What you build

Roles: lawyer or template author (uploads and edits templates, manages the clause library), associate (runs interviews, generates documents), and optionally the client (answers intake questions).

Flow: the author marks placeholders in a DOCX, for example landlord name, monthly rent, a condition such as "if furnished, include the inventory schedule", and a repeating block for multiple tenants. The system parses the file, shows the variables it found and any errors, and generates a step-by-step interview. The associate answers, previews, and downloads the finished DOCX and PDF.

The technically interesting part

This is a small compiler project wearing a legal suit.

  • Parsing. DOCX is XML split into runs, so a placeholder can be broken across several runs by Word's formatting. You must normalise runs before tokenising, then parse a tiny language with variables, conditionals, loops and filters (uppercase, date format, amount in words).
  • Dependency analysis. From the syntax tree, compute which questions are needed given earlier answers. If "is furnished" is false, the inventory questions never appear. This is a dependency graph with conditional edges, and the interview order must be stable and sensible.
  • Rendering with fidelity. Output must keep numbering, styles and page breaks. Write golden-file tests that compare generated documents against expected outputs.

Show your evaluators the grammar, the error messages for bad templates, and the golden tests.

How to evaluate it

  • Coverage: convert at least 10 real templates from a cooperating chamber. Report how many worked without modification and what syntax you had to add.
  • Time saved: have 5 lawyers or law students draft the same agreement manually and with the tool; compare time and count errors such as leftover names.
  • Interview efficiency: for each template, compare the number of questions asked against the total variables, showing conditions skipping irrelevant ones.
  • Parser quality: a fuzz or property test that feeds malformed templates and checks for clear errors and no crashes.

Suggested plan

  1. Weeks 1 to 3: collect templates from a chamber, write the template syntax spec.
  2. Weeks 4 to 9: DOCX run normalisation, tokeniser, parser and error reporting.
  3. Weeks 10 to 13: renderer with golden tests.
  4. Semester 2, weeks 1 to 5: interview generation from the dependency graph, matter records.
  5. Weeks 6 to 9: clause library and versioning.
  6. Weeks 10 to 14: user study with lawyers, evaluation, report.

Path to a product

Your first customer is a solo lawyer or small chamber you can reach through a law faculty or a family contact. Sell a monthly subscription per lawyer with a starter pack of common templates. A second channel is template packs: well-drafted, reviewed templates sold per document type, reviewed by a practising lawyer you partner with.

Scope warning

Do not generate legal content with a language model and present it as advice. Do not build case diaries, court date tracking or billing, which existing tools cover. Do not attempt full Word feature support; document the subset you support. Always keep a qualified lawyer as the author of the legal text.

Learn what you need on Sefism

Get help with this idea

The template language is where teams either shine or drown, so agree its limits early. Tauseef can help you tighten the scope, choose a stack your team can finish with, and design an evaluation your examiners will respect. If you are new here, create a free account first.

Ideas and guidance, not finished projects

These are project ideas and scoping guidance, published free for students to use as a starting point. I do not build, write, or sell final-year projects, and I do not complete coursework for anyone. Take an idea, make it yours, and build it.

Not sure this one fits you?

I help students pick an idea that matches their skills and their deadline, then scope it down until it is finishable. Guidance only, never done for you.

Discuss this idea
Work with me

Stuck on something specific?

Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.