Inspiration

Legal disputes often arise from misunderstandings or misinterpretations of contract clauses, which can lead to a range of serious issues: financial loss, broken business relationships, legal penalties, or even personal liabilities. One of the key problems is the lack of thorough analysis before signing contracts. In many cases, individuals and businesses fail to fully review and comprehend the legal language involved. For instance, employees often rush through lengthy company policies, startups hesitate to invest in legal professionals for contract review, and even legal experts can become fatigued from analyzing repetitive, standard documents.

Every morning when I read the news, I see stories about contract disputes, businesses in trouble over overlooked clauses, or individuals facing issues because they didn't understand what they signed.

This led me to think: what if we had an intelligent agent that could read through any contract, analyze it thoroughly, and present the terms in a concise, easy-to-understand format, free from confusing legal jargon? What if this agent could also assess the legality of the clauses and suggest potential counteractions? That’s how the idea for LegalLens was born.

LegalLens is designed to empower individuals and businesses by simplifying the contract review process, ensuring that no critical detail is overlooked and that every clause is fully understood before signing.

What it does

LegalLens offers a comprehensive and thorough analysis of any contract, regardless of its length—whether it's 10 pages, 20, 30, or even 40. The app meticulously scans the entire document and identifies the key clauses that are crucial for you to review. These are the clauses that could have significant legal or financial implications, and they must not be overlooked.

Once the important clauses are highlighted, LegalLens provides clear, concise explanations, simplifying complex legal language into easy-to-understand terms. This ensures that you fully comprehend the content, without being bogged down by technical jargon.

Next, LegalLens goes beyond just analysis by performing a legality check. It searches the web for relevant legal references to determine whether the clauses fall within accepted legal boundaries. If any clauses raise concerns or could benefit from modification, LegalLens will identify these issues and suggest counteractions or recommendations to protect your interests and ensure clarity.

How we built it

Contract Upload: The user begins by simply uploading the PDF of their contract . No complex configurations or manual parsing required—just a straightforward upload.

Preliminary Analysis with LLaMA 3.2 Vision Model: To extract key terms, conditions, obligations, clauses, and more, directly from the pdf document we use the LLaMA 3.2 Vision Model from SambaNova Cloud. When it encounters generic clauses or terms, it generates concise summaries of them which it does amazingly good. For more complex or legally nuanced terms, it extracts the exact text, allowing the larger model to process them in detail. This approach ensures that we don't miss any important aspects, whether simple or intricate.

Detailed Analysis with LLaMA 3.1 405B Model: For a deeper understanding and interpretation, we use the LLaMA 3.1 405B Model (also hosted on SambaNova Cloud), one of the largest and most advanced models in the industry. This model processes the extracted clauses and terms from the preliminary analysis and provides clear, concise explanations of each section. What truly amazes me is how SambaNova Cloud can provide inference at an almost lightning-fast speed, even for a model of this size—it's truly remarkable. The performance, speed, and scale they provide are unparalleled, enabling us to analyze and explain every detail of the contract with exceptional efficiency.

Legality Check with Crewai Agent: Once the key clauses are extracted and explained, we deploy the Creai Agent to perform an in-depth legality check. Using SerperDevTool, the agent searches through relevant legal forums, documents, and databases to cross-check each clause and ensure it is within legal boundaries. The agent also assesses whether any clauses require further modifications, additional recommendations, or counteractions.

Recommendations and Counters: Based on the legality check, LegalLens offers actionable recommendations for modifications and counteractions if any clauses are found to be imbalanced or lacking key legal protections. This helps users refine their contracts, ensuring they are not only legally sound but also balanced and fair.

What's next for LegalLens

LegalLens is just the beginning, and I’m fully committed to taking it to the next level. While I’ve launched the MVP, the real work starts now. My plan is to refine the user interface and strengthen the app’s overall robustness to ensure a seamless experience for users. The next step will ofcourse be to add one or two members into the team that truly understand the vision and then deploy the application and closely monitor user feedback to understand their needs and preferences. Based on that, we’ll scale the product, adding new features while keeping contract analysis as the core function. As we grow, we’ll expand beyond contract analysis and address other legal challenges, building LegalLens into a comprehensive tool that can truly make a difference in the way people engage with legal documents. This is just the start, and I’m determined to take LegalLens from an MVP to a fully-fledged, impactful startup.

What Does SambaNova Cloud Bring to the Table for These Products?

What I've realized while building these products is that both of these products will be somewhat useless and cannot reach their full potential if they're slow. For example , Let's take our browser extension. When a user faces any Terms & Conditions, they won't wait 2 minutes for analysis - they'll just click "Accept" and move on because everyone is busy and want fast solutions. That's why SambaNova Cloud is crucial. With their infrastructure, we analyze T&Cs within 3-4 seconds. That's not just an improvement - it's a transformation in user experience. Similarly for Legal Lens, if it takes 10 minutes to analyze a 40-page contract, we won't have any users. It's simply not practical for professional workflows. With SambaNova Cloud, we complete this analysis in 2-3 minutes, making it a solution professionals will actually use.

Built With

  • crewai
  • llama
  • python
  • sambanova
  • streamlit
Share this project:

Updates