Inspiration
Working closely with sales processes, I observed a common pain point - contracts often slow down deals late in the cycle. Sales teams rush to close, but Legal reviews are delayed or rushed, leading to missed risks or last-minute escalations.
When I discovered Agentforce and its ability to create intelligent internal agents, I saw an opportunity: Why not bring smart, real-time contract risk analysis directly into the sales workflow?
That’s how ContractIQ.AI was born—a solution that reviews contracts the moment they are uploaded, flags potential risks early, and bridges the gap between Sales and Legal for faster, safer deal closures.
What it does
ContractIQ.AI automatically analyzes any contract uploaded to an Opportunity in Salesforce.
The process starts the moment a sales user uploads a contract PDF.
Behind the scenes, the solution: - Extracts the text from the uploaded document - Retrieves relevant benchmark clauses from internal Salesforce records based on the industry. - Analyzes the contract using a Prompt Builder agent with RAG (Retrieval-Augmented Generation) to find missing or risky clauses - Calculates a risk score and categorizes the overall contract risk as High, Medium, or Low - Displays a full risk summary and clause-level insights directly inside the Opportunity record - Creates a task for the Legal team and sends a Slack notification if the contract is found to have Medium or High risks
This ensures that Legal is alerted proactively, without waiting for manual escalation - helping Sales and Legal work together to close deals faster, with fewer surprises.
How I built it
I started by identifying the key pain points around contract risk review in the sales cycle.
The technical solution was built fully inside Salesforce using: - Agentforce Prompt Builder to create the contract analysis agent -Flows and Apex triggers to automate the document extraction and RAG preparation -Custom LWC (Lightning Web Components) to display the analyzed results beautifully within the - Opportunity -Slack Integration to notify the Legal team automatically when a risky contract is detected -Python Flask API temporarily hosted to help with text extraction from PDFs during testing -I focused on keeping the user experience simple: the salesperson doesn't need to do anything special - just upload the document, and ContractIQ.AI handles the rest.
Challenges I ran into
- Handling large PDFs: Initially, larger files caused timeout issues. I had to optimize the text extraction
flow and error handling.
- Integrating RAG cleanly: Making the benchmark clause retrieval seamless with the Prompt Builder
agent took a few iterations to get right.
- UI polish: Building a meaningful risk gauge, accordion clause highlights, and Slack notifications that
feel natural in the Salesforce UI took extra care.
- Time management: Balancing building a solid backend, a friendly frontend, and an easy-to-demo
flow all within hackathon timelines was a real challenge.
Accomplishments that we're proud of
- Built a working end-to-end RAG-powered contract analyzer natively inside Salesforce
- Fully automated legal risk escalation without any manual work for Sales teams
- Created a professional, clean UI that fits Salesforce design best practices
- Integrated Slack notifications for real-time legal review visibility
- Managed to make it feel simple for users, even though the architecture is doing a lot behind the scenes
What we learned
Even with powerful tools like Agentforce, building a smooth end-to-end intelligent automation flow takes thoughtful design, especially when mixing AI, triggers, flows, and UI.
I learned how to leverage Prompt Builder effectively for structured clause analysis, and how important it is to feed it the right context using RAG (Retrieval-Augmented Generation).
Salesforce’s native capabilities are more powerful than expected. With the right use of metadata, flows, and LWC, we could build a fully functioning contract analyzer without relying on external AI platforms.
Designing a solution that works for both Sales and Legal personas taught us the importance of clear communication, both in the interface and in the actions triggered by the analysis.
We also realized the power of Slack integration and how a well-timed and informative message can replace long follow-up chains and manual alerts.
Lastly, this project reinforced how critical domain-specific benchmarks are in contract analysis - not every contract is the same, and industry context makes the AI far more reliable.
What's next for ContractIQ.AI
- Expand benchmark clause coverage across more industries and contract types
- Enhance existing clause redline suggestions to support multi-party negotiations
- Improve Agent Chat with deeper context awareness and contract-specific recommendations
- Fully optimize for mobile to support on-the-go contract review by Sales/Legal teams
- Introduce clause scoring history to prioritize frequently flagged risks from past deals
Built With
- agentforce
- apex
- apextrigger
- lightning-web-components-(lwc)
- prompt-builder
- python-(text-processing)
- retrieval-augmented-generation-(rag)
- salesforce-flow-builder
- slack-api

Log in or sign up for Devpost to join the conversation.