Building with LLMs: A Hands-On Experiment with Legal Research and Drafting
Introduction
Legal research has always been a text-heavy discipline. Lawyers spend a large portion of their time reading statutes, studying judgments, identifying precedents, and translating legal reasoning into structured documents such as petitions and briefs. Even with modern legal databases, the core workflow still involves navigating large volumes of text.
Over the past few months, we experimented with using Large Language Models (LLMs) to assist with parts of this process. The goal was not to automate legal work or replace legal judgment. Instead, we wanted to see whether AI could function as a practical research assistant during legal analysis and drafting.
Rather than building a full platform or complex legal AI system, we took a simpler approach. We used an LLM conversationally while working through legal problems. We described factual scenarios, explored possible legal issues, requested explanations of legal doctrines, summarized judgments, and gradually structured the arguments required for petitions.
What stood out during this experiment was not the model’s ability to generate text. That was expected. What surprised us was how useful it became as a thinking aid during research. It helped organize ideas, suggested possible legal angles, and accelerated the process of reviewing legal materials.
For developers and QA engineers, the broader insight is that many professional workflows are fundamentally language driven. Legal research involves understanding facts, identifying issues, retrieving relevant knowledge, and structuring arguments. These are precisely the kinds of tasks where LLMs can provide meaningful assistance when used carefully. Below is the workflow we ended up using.
Our AI Workflow
We quickly discovered that asking the AI to simply “write a petition” produced inconsistent results. Legal drafting requires structured reasoning, and the best outputs came when we followed a process similar to how lawyers actually approach problems.
We broke the work into stages.
1. Start with the Facts
The first step was to describe the factual situation and ask the AI to identify possible legal issues.
Example prompt:
A government authority has delayed issuing a license despite the applicant meeting all regulatory requirements.
What legal issues may arise under administrative law?
The AI typically highlighted issues such as arbitrary administrative action, procedural unfairness, delay in decision making, and possible violation of constitutional protections. This helped frame the direction of the research.
2. Identify Relevant Legal Principles
Once the issues were clear, we asked the AI to explain the legal doctrines that might apply.
Example prompt:
Explain the legal principles that apply when a public authority delays making a decision affecting a citizen’s rights.Discuss doctrines such as arbitrariness and legitimate expectation.
This stage provided a conceptual foundation before diving into case law.
3. Explore Relevant Case Law
After identifying the legal principles, we asked the AI to surface and summarize relevant precedents.
Example prompt:
Summarize important Supreme Court judgments dealing with arbitrary administrative action by government authorities. Focus on the legal principles established.
The responses usually included summaries of facts, issues before the court, and the reasoning adopted by the judges. This helped us identify which cases were worth reviewing in full.
4. Summarize Long Judgments
Court judgments can easily run into dozens of pages. AI proved particularly useful for condensing them into structured summaries.
Summarize this judgment under the following headings:
1. Facts
2. Legal Issue
3. Court’s Reasoning
4. Final Holding
This reduced the time required to understand whether a case was relevant to the petition we were drafting.
5. Draft Petition Sections
Instead of generating a full petition in a single step, we used the AI to draft individual sections.
Example prompts:
1 – Draft the facts section of a writ petition based on the following scenario.
2 – Draft the legal grounds challenging arbitrary administrative delay by a public authority.
6. Iterate and Refine
The most useful part of the workflow was the iterative interaction with the AI.
We frequently asked the system to clarify reasoning, reorganize arguments, simplify explanations, or convert analysis into formal legal language. The process resembled a conversation with a research assistant rather than a single query.
Lessons for Developers Building Legal AI Systems
Working through this experiment also revealed several lessons that may be useful for developers building AI systems for knowledge work.
1. LLMs Should Support a Workflow
LLMs perform better when they assist with individual tasks rather than attempting to generate an entire document at once. Legal analysis involves multiple steps such as identifying issues, researching precedents, and structuring arguments. Designing workflows around these stages improves results significantly.
2. Prompt Design Acts as an Interface
Prompts effectively serve as the interface between the user and the model. Clear instructions and structured requests produce more reliable outputs.
For example:
Analyze the following legal scenario and respond with:
1. Legal Issues
2. Applicable Legal Principles
3. Relevant Case Law
4. Possible Legal Remedies
3. Iterative Conversations Improve Accuracy
Complex tasks benefit from incremental interaction. Instead of relying on a single prompt, it was more effective to ask a sequence of smaller questions that gradually built the final output.
4. Verification Is Essential
Legal work requires high accuracy and traceability. LLMs can occasionally produce incorrect citations or overconfident interpretations. Every legal argument and case reference still needs to be verified against actual legal sources. Any production system in this space must include strong verification steps and human oversight.
5. Structured Outputs Improve Usability
Free-form text is harder to review and integrate into workflows. Requesting structured outputs such as labeled sections or bullet lists improves readability and makes it easier to refine the results.
6. Domain Expertise Still Matters
LLMs are strong language tools, but they are not substitutes for professional expertise. The best results came from collaboration between legal professionals who understood the domain and engineers who structured the interaction with the model.
7. The Value Lies in Augmentation
The most important insight from this experiment is that the real value of AI lies in augmentation rather than automation. The model helped accelerate research, summarize complex materials, and provide initial drafts. Human expertise remained essential for analysis, interpretation, and final decision making.
Key Takeaways
AI can function as a useful research assistant in legal workflows. Breaking complex tasks into smaller steps improves output quality. Summarizing judgments and extracting legal principles significantly reduces research time. Drafting becomes easier when AI provides a structured starting point, though human verification remains essential.
More broadly, this experiment highlights an important trend. Many professional workflows rely heavily on language, reasoning, and structured writing. With thoughtful design, LLMs can become valuable assistants in these environments.
Our experiment did not replace the legal process. It simply helped move through it faster and with less friction. For engineers exploring AI applications, that kind of augmentation may be where the most practical opportunities lie.
