Legal contract analyzer
Automation, analysis and summary of complex legal documents, acts as an AI assistant for lawyers, managers, and anyone who needs to quickly understand the key points of a contract.
graph TD
%%{init: {'theme': 'mc','layout': 'elk'}}%%
GDriveFilesComponent-om3qs[<div><img alt="logo" src="/_astro/google_drive.wKmDsV2c.svg" style="height: 20px !important;width: 20px !important"/></div>Google Drive]
style GDriveFilesComponent-om3qs stroke:#a170ff
ParseData-bpxzj[<div><img alt="logo" src="/_astro/braces.Djq0PW4_.svg" style="height: 20px !important;width: 20px !important"/></div>Parse Data]
style ParseData-bpxzj stroke:#a170ff
OpenAIModel-83xm1[<div><img alt="logo" src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>Asistente Legal]
style OpenAIModel-83xm1 stroke:#a170ff
TextInput-9vw0r[<div><img alt="logo" src="/_astro/type.Dy26vmDy.svg" style="height: 20px !important;width: 20px !important"/></div>Url del documento]
style TextInput-9vw0r stroke:#a170ff
TextOutput-c58r1[<div><img alt="logo" src="/_astro/type.Dy26vmDy.svg" style="height: 20px !important;width: 20px !important"/></div>Text Output]
style TextOutput-c58r1 stroke:#a170ff
GDriveFilesComponent-om3qs -.- ParseData-bpxzj
linkStyle 0 stroke:#a170ff
ParseData-bpxzj -.- OpenAIModel-83xm1
linkStyle 1 stroke:#a170ff
OpenAIModel-83xm1 -.- TextOutput-c58r1
linkStyle 2 stroke:#a170ff
TextInput-9vw0r -.- GDriveFilesComponent-om3qs
linkStyle 3 stroke:#a170ff
🧩 Overview
The workflow automates the extraction and summarization of legal contracts. A user supplies a document URL, the system retrieves the file from Google Drive, parses its textual content, and uses an OpenAI model to generate a concise, point‑based summary. The final text is displayed for immediate review.
⚙️ Main Features
- Retrieves documents from Google Drive using a provided URL.
- Extracts plain text from various file formats.
- Summarises contracts in clear, bullet‑point form.
- Employs an OpenAI language model with a custom system prompt.
- Delivers the summary directly to the user interface.
🔄 Workflow Steps
| Component | Role in the Workflow | Key Inputs | Key Outputs |
|---|---|---|---|
| Document URL | Accepts the location of the contract. | URL of the document. | URL text. |
| Google Drive File Retriever | Downloads the specified file from Google Drive. | Document URL. | File data. |
| Parse Data | Converts the file data into plain text. | File data. | Extracted text. |
| Legal Assistant | Generates a structured summary of the contract. | Extracted text. | Summary text. |
| Result Display | Shows the summary to the user. | Summary text. | Visible output. |
🧠 Notes
- The Google Drive component requires that the file URL be publicly accessible or that the user has appropriate sharing permissions.
- The OpenAI model depends on a valid API key and may incur usage costs.
- The system prompt guides the model to focus on contract purpose, parties, obligations, dates, and risk clauses, producing a concise list.
- The parsing step handles common document types (PDF, DOCX, TXT, etc.) but may miss information if the file contains non‑text elements.
- Output formatting is controlled by the system prompt; no further post‑processing is performed.