When multiple attachments are added to a case, it would be extremely helpful if AI could automatically compare the documents and highlight key differences. Has anyone successfully used Pega Doc AI for a document comparison use case like this? I’ve tested a couple different ways, but haven’t been able to get this working, so I’m curious how others have approached this—what worked, what didn’t, and whether there are recommended patterns or configurations.
Hi Elaine,
You might find the below article interesting. Designing GenAI Connect for Document Analysis
@Murali.Krishnan.D Thank you for sharing. This is a helpful article on setting up Doc AI to evaluate and summarize a document; however, it does not address document comparison. My use case specifically involves using AI to compare two documents. Have you implemented a similar approach?
We can attach one document at a time using Attachment field and we can source only ONE attachment in GenAI connect rule. As a workaround, we can merge the both documents in a single document to do the comparision. Alternatively, we can send the base 64 code from both documents to Agents to do the analysis.
I have an idea we could test. attach both docs to a single attachment field, the attachment field can accept more than one doc. then ask the genai connect to compare them and for your properties have a page list that represents changes , difference type and description and some other fields. then prompt to compare the two. Lets try it.
@STEWJ This is one of the methods I tried before I posted. My initial attempt was not successful. Merging the documents will not be an option. In my use case, we want to see the discrepancies between two documents. I will keep trying. Has anyone done this before? Please reply if you have.
It would be great if you can provide some insight about the documents. What exactly we’re try to compare?
Thanks for raising a common but nuanced requirement.
As of current Version, Pega Doc AI and GenAI Connect are used for single-document analysis with structured outputs, so this requirement has to be designed differently. Stay tuned to the new versions and their features.
One approach is to retrieve/extract the attachment content, normalize inputs into a controlled representation for each attachment. Then in another agent step run a bounded analysis that produces a structured list of differences between the two attachments, with optional human review before any downstream action.
Merging documents or sequential comparison can work in limited scenarios, but teams should be cautious about token size, determinism, and explainability. This very much depends on the context, accuracy needs and downstream processing ways.
I’d encourage others to share any production-safe comparison patterns they’ve validated, especially how they constrained output schemas and handled review.
@garce I created a post and a video walkthrough outlining a possible approach for doing some of this. Basically replicating how conversational agents handle documents in the context of a case with a GenAI Connect rule;