Inspiration Small businesses and freelancers often sign contracts without reading them. Why? Because hiring a lawyer costs hundreds of dollars an hour, and they simply can't afford it.

This creates a massive "Legal Gap." We realized that millions of hard-working professionals are one bad signature away from a lawsuit or lost wages. We built ContractGuard Agent to give everyone access to legal safety, not just those with big budgets.

What it does ContractGuard Agent acts as your automated legal assistant. It turns a scary contract into a simple, safe process:

Upload: You drop in your contract (PDF or Word doc).

Review: The AI scans it instantly for dangerous terms—like hidden fees, unfair fines, or intellectual property theft.

Action: It doesn't just tell you what's wrong; it automatically writes a professional email to the other party to negotiate better terms.

Send: You review the email, click one button, and the agent sends it for you.

How we built it We focused on speed, reliability, and accuracy.

The Brain: We used Groq to power the AI. It is incredibly fast, allowing us to analyze long documents in seconds.

The Workflow: We used LangGraph to organize the AI's tasks. It ensures the AI follows a strict step-by-step process: ( \text{Read} \rightarrow \text{Analyze} \rightarrow \text{Draft Email} ).

The Safety Net: We used ChromaDB to compare the contract against real legal examples (Retrieval Augmented Generation), ensuring the AI doesn't make things up.

The Website: We built the user interface with Streamlit and deployed it to the cloud so anyone can use it immediately.

The Delivery: We integrated Resend to handle the actual sending of emails.

Challenges we ran into Keeping the AI Honest: Early on, the AI would sometimes invent legal terms. We fixed this by forcing it to check its work against a database of real legal standards.

The "Human" Step: Most AI runs from start to finish without stopping. We had to build a special "pause" button into the code so a human user could review and approve the email before it was sent.

Handling Big Files: Legal documents are long. We had to write efficient code to break them down so the AI could understand the whole picture without getting confused.

Accomplishments that we're proud of It's Live: We didn't just build a prototype on our laptop; we deployed a fully functional web app that works right now.

It Takes Action: Our project doesn't just chat; it actually does work (sending emails) to solve the user's problem.

Speed: We reduced a process that usually takes days (waiting for a lawyer) down to less than a minute.

What we learned Action > Chat: We learned that AI is most useful when it performs tasks for you, rather than just answering questions.

Simplicity Wins: Users don't want complex legal dashboards; they just want to know "Is this safe?" and "How do I fix it?"

Real-World Impact: We realized how many people are desperate for a tool like this to protect their livelihood.

What's next for ContractGuard Agent Custom Rules: Letting users set their own "deal-breakers" (e.g., "Never accept payment terms longer than 30 days").

Slack Integration: Adding the bot to team chat apps so you can check contracts where you work.

Auto-Negotiation: Allowing our AI agent to talk directly to the other party's AI to settle the details automatically.

Built with python

streamlit

langgraph

groq

chromadb

resend

llama-3

Built With

Share this project:

Updates