OpenQnABot - Project Story
📽️ Watch our full demo
🗳️ Support us in the hackathon – Vote now
🧠 Empower your community with AI agents that make contracts clear and fair.
Inspiration
In times of crisis, people are often left alone to decipher complex contracts — whether it's insurance after bushfires, rental agreements during housing instability, or legal clauses that feel impenetrable.
We were inspired by real events like the LA bushfire, where many property owners were unsure whether their insurance would cover fire damage.
We asked:
What if communities had an AI agent that could explain their rights, in plain language — right when they needed it most?
That’s how OpenQnABot and OpenQnALab were born: a platform to make legal and insurance contracts understandable and accessible through AI-powered agents.
What it does
OpenQnABot is a multi-agent platform powered by Salesforce Agentforce, designed for social good.
It provides:
- 🧠 A Contract Analysis Agent
Automatically builds a RAG (Retrieval-Augmented Generation) index in Salesforce Data Cloud from AWS S3, enabling contextual Q&A over their own documents. Users can even upload insurance or legal documents using the/contractcommand to inject those data into Data Cloud. - 📚 A Knowledge Article Agent
Answers questions about our hackathon, the Agentforce platform, and how others can build their own agents. - 🔁 A Community Agent Framework
Users can upload their own documents and metadata to easily spawn their personalized analysis agents. - 💬 Slack Integration
Accessible via Slack with the/askcommand to query documents and agents, and/contractto upload new contracts into Salesforce Data Cloud.
The entire flow is asynchronous, scalable, and extensible.
What’s Unique About Our Tech
- 🧩 Dual-Agent Architecture We combined a traditional Knowledge Agent with a custom Contract Analysis Agent, enabling hybrid support for both static knowledge articles and dynamic user-uploaded content.
- 🌐 Reusable Slack ↔️ Agentforce Bridge Our Slack integration is modular, scalable, and open-ended — other communities can plug in their own documents and spawn their own agents without writing code.
- 🛠️ Automated RAG Pipeline for Contracts Using the Slack command such as /ask and /contract , users inject documents into Salesforce Data Cloud, where they are automatically indexed and made queryable — no manual setup needed.
- 🔁 End-to-End Async Flow With AWS Lambda + SQS, we avoid Slack's 3-second timeout while maintaining high throughput and reliability.
- 🧠 LLM-Powered Answers with Policy-Aware Responses Our system doesn’t just echo text — it interprets contract logic, sections, and coverage rules to deliver context-aware advice in plain language.
How we built it
- Frontend Interaction:
Slack bot (using command such as/askand/contract) integrated with API Gateway + AWS Lambda. - Backend Processing:
openqnabot: receives the Slack request, verifies and pushes to SQS.openqnabot-async: consumes from SQS, queries Salesforce Agentforce Apex API, and posts back answers to Slack.
- Salesforce Integration:
- Used Agentforce Knowledge Agent (retrieves from Knowledge Articles).
- Built custom Contract Analysis Agent using the Invocable Apex Action
generateAiAgentResponse.
- Used Agentforce Knowledge Agent (retrieves from Knowledge Articles).
- Infrastructure:
- AWS Lambda + API Gateway
- AWS SQS for async scalability
- Slack App for user interface
- Salesforce Developer Org for agent creation and hosting
- AWS Lambda + API Gateway
Challenges we ran into
- 🧩 Salesforce Agentforce API was undocumented and required trial-and-error with Invocable Actions, Apex integration, and JSON double-escaping.
- 🔄 Agent responses were double-encoded JSON, needing two-level decoding and custom parsing logic.
- 🕒 Asynchronous processing in Lambda/SQS/Slack had strict timeout windows (e.g., Slack’s 3-second response limit), requiring careful architecture.
- 🔐 Slack signature verification and cross-platform auth in AWS added extra security complexity.
Accomplishments that we're proud of
- ✅ Successfully built a working multi-agent document analysis system end-to-end in just a few days.
- 📬 Live Slack demo with contract question answered by AI — fully integrated with Salesforce Agentforce.
- 🛠 Built a modular framework to allow anyone to plug in their own documents and spawn an AI explainer agent.
- 🧠 Deeply learned the inner workings of Salesforce's Agentforce platform and pushed beyond its standard use cases.
What we learned
- How to build AI-powered Q&A systems using Salesforce Agentforce and Slack.
- How to handle multi-agent orchestration across asynchronous cloud services.
- How to work with double-encoded JSON responses, Salesforce Apex, and invocable actions in the wild.
- The power of pairing LLMs with structured knowledge bases and contract documents to create real-world value.
What's next for Openqnabot
- 🚀 One-click Agent Builder UI for the community to create their own explainers
- 🧩 Plugin support for other Salesforce Communities and verticals
- 📈 Agent marketplace to discover and share contract explainer agents
- 🔒 Privacy-focused document upload service
- 🤖 Multi-turn contextual conversations with personalized session memory
- 💬 Open-source SDK to enable integration with other messaging platforms like MS Teams and WhatsApp
🧾 Final Note
No one should face a complex legal or insurance contract alone.
With OpenQnABot, we put clarity, confidence, and empowerment — right in your Slack.
This isn’t just a bot. It’s a platform for justice.
Built With
- agentforce
- amazon-web-services
- apex
- apigateway
- javascript
- lambda
- python
- slack
- sqs
Log in or sign up for Devpost to join the conversation.