Behind LAGDA: How lawyers verify and keep legal AI accurate
Tyra Delos Reyes
In this interview, Atty. Sandro Perez, Legal Intelligence Lead at Anycase, explains why lawyers have always been central to how we develop and evaluate our AI system. We discuss the common failures we've observed in legal AI, why human oversight matters, and how our proprietary LAGDA system allows lawyers to guide AI toward more accurate legal answers.
Tyra Delos Reyes: I guess let's start with an introduction. Let me know what you do at Anycase.
Atty. Sandro Perez: Right. Good morning, Tyra. I'm Attorney Sandro Perez. I currently lead the Legal Intelligence team at Anycase.ai.
What we primarily do in our team is to make sure that all information at Anycase is accurate. So what that means is checking actual legal documents, verifying the source documents of our answers, and ultimately making sure that the answers our users get are accurate.
Tyra Delos Reyes: Awesome. A big role of your team has been evaluating our AI system, and part of that is using the LAGDA system.
So could you briefly describe what LAGDA is and what it does?
Atty. Sandro Perez: Yeah, sure. LAGDA is short for Lawyer-Annotated and Governed Data Architecture.
So basically, it's a tool that we use internally that lets my team, the Legal Intelligence team, help maintain the quality of the legal data.
It does two main things. First, adding and vetting legal documents, and second, lawyer annotations and verification.
So let's start first with adding and vetting legal documents.
We have a data roadmap at Anycase where we identify all of the documents that we want to add to our system. But of course, there comes a time when you have to prioritize some documents, or we have identified through evaluations that some documents are missing.
So adding and vetting legal documents through LAGDA is very useful because the turnaround time is very quick. It's available already within 24 hours when our user requests it.
But I think the more important, or I wouldn't say important, but more interesting, one is the lawyer annotations and verification.
Because the LAGDA tool essentially allows lawyers from Anycase to review the documents that we have in our system and provide annotations where necessary.
So for example, the answer given by Anycase for this particular question doesn't make reference to another important document.
Through LAGDA's annotation, the lawyers of Anycase are able to steer Anycase towards a direction of understanding the relationship between these two documents, and in turn, we'll be able to give an accurate answer to our users because of that annotation.
So yeah, that's what it's for.
So why is it important for an AI system to have humans in the loop?
Tyra Delos Reyes: I know that you've been working with the Anycase system since, like, 2023 or 2024, right? When you first started, and you've been at the helm, essentially, of making sure its answers are accurate. So you've been working with Anycase, you've been evaluating Copilot, GPT, Gemini. Am I missing something else? I think Claude as well, right?
Atty. Sandro Perez: Yeah.
I'm curious, in those evaluations, why do you think it's important for an AI system to have humans in the loop?
Atty. Sandro Perez: Right. That's right.
Our guiding philosophy at Anycase is trust starts before the answer.
And what does that exactly mean?
So before an answer even reaches the user, we want to know that the system is actually being tested on the kinds of legal questions that it's supposed to answer.
You know, so for instance, before we made documents from our Banking and Finance cluster—BSP, CIC, Insurance Commission, and AMLC—available in our system, our team of lawyers already ran evaluations using actual banking and finance questions.
So we were looking at things like: Can the AI answer this correctly? Is it finding the right legal basis to ground its answers? And is it actually applying the source properly?
So for us, it's not enough to just put the documents into the system and assume that the AI will already know what to do with them.
Because even if the right document is there, there is still a possibility that AI can miss it, and it can prioritize the wrong source or use it incorrectly.
So that's really where the human-in-the-loop part comes in. We in the Legal Intelligence team test the answers, look at where the system is getting the answers incorrectly, and make sure that the sources are actually translating into accurate and useful legal answers.
Tyra Delos Reyes: Yeah, we've been talking about how your team has tested Anycase against ChatGPT, Copilot, against the Philippine Bar exams, like Philippine Bar questions. Am I getting that right?
Atty. Sandro Perez: Yes.
What's the difference between an AI system that has humans in the loop versus something that doesn't have that level of involvement?
Atty. Sandro Perez: Yeah. So like I mentioned a while ago, Tyra, evaluations are really non-negotiable for us at Anycase.
And when we run these evaluations, what we find is that time and time again, Anycase can outperform general-purpose AI tools like ChatGPT and Claude Sonnet.
And from what we've seen, that really boils down to two things.
First, the data, and second, the fact that AI systems still need human evaluators or humans in the loop. So I'll speak more on the latter.
Because even when you have data, even with the available sources, AI will still get things incorrectly. There is still a chance, of course, that AI can give you the incorrect answer.
And that's a reality we embrace at Anycase, that AI is simply not more capable than lawyers for legal tasks, and you really need lawyers vetting the answer before it reaches the user.
And I guess I'll speak more into the common issues that we find. So for example, there were some instances where we found that the AI prioritizes an outdated ruling. So when you search for a case, it cites a case that isn't actually controlling for that particular doctrine, or just doesn't cite the correct references at all.
And I think that's where us, the lawyers, come in.
Instead of just letting the AI dictate the answer, we evaluate those answers and say, "Oh, those aren't the cases that you should be prioritizing," or when the AI retrieves those cases, "Actually, this is the governing doctrine you need to consider."
And I think sometimes that one correction can, and as I have experienced, just putting those kinds of corrections can completely change the quality of the answer.
So could you give me an example of the impact of LAGDA on an AI system? Like an example where you made an annotation or a change, and then it has affected the answer quality, the answer accuracy?
Atty. Sandro Perez: Actually, recently we just found one during our evaluations, and it's for the query: When is preliminary investigation mandatory?
So previously, there were instances where the system was answering that preliminary investigation was mandatory for four years, two months, and one day, because the system was relying on Rule 112 of the Rules of Criminal Procedure, or Revised Rules on Criminal Procedure.
And so when our team reviewed that answer, we flagged it because it should already be citing the 2024 DOJ Rules on Preliminary Investigations and Inquest Proceedings. So that was released in 2024.
So we basically told the AI, "Hey, for this query, you should be referring to the rule from the 2024 DOJ issuance to answer the question correctly."
And so after that, we ran the query again. It already correctly answered the question on preliminary investigation: When is it mandatory?
And it gave the correct answer, which is six years and one day of imprisonment, regardless of the fine. Yeah. On that note, another thing that's important to us is transparency. We don't want the answer to just suddenly change without any context.
So for this particular example, the system also explains that there was a previous threshold under Rule 112, and this was subsequently changed by the newer DOJ issuance.
So the user can actually see why the answer is different and open the relevant documents. And it's going to be the same for all documents where there have already been modifications because of the annotations from LAGDA.
And if you look at the annotation itself, we're not creating a new rule or stating anything that isn't already in the legal sources. What we're simply doing is guiding how the AI understands and uses those as resources.
Tyra Delos Reyes: Okay. So there's obviously a lot of judgment involved in legal research.
So when your team reviews an answer, how do you determine whether the AI needs an annotation, and what principles guide you in making that kind of correction?
Atty. Sandro Perez: Right. Yeah. I think that's a really important discussion, Tyra.
So I guess to emphasize first and foremost, annotation doesn't mean that we're rewriting the law or changing the contents of the cases.
As lawyers, we treat our canonical documents as sacred. We don't alter what the law or the jurisprudence or any legal documents say. Annotation really is about helping the system understand the legal material properly.
So again, to give you an example, we might flag that a source the AI is prioritizing is already outdated, or it might point toward a controlling authority or landmark case that it might have missed.
You know, sometimes it's also about the relationship between two documents. Maybe there's a newer issuance that amended an older rule or a later case that clarified an earlier ruling by the Supreme Court.
So those are things that a lawyer would naturally look for when doing legal research. But the issue, or the problem, or the challenge is that an AI system might not always prioritize them correctly on its own.
And we're not deciding what AI should or should not say based on our personal opinion or what we think it should prioritize. So we stay completely neutral in that process. We're basically applying the same standards you would expect from proper ethical legal research.
So what is the current law? What is controlling? What is actually relevant to the question? So really, the annotation follows the legal sources.
Could you tell me a little bit about our legal data infrastructure? How does Anycase go from source to answer?
Atty. Sandro Perez: Oh, okay. Yeah. So the first step is actually identifying first the documents that we need to add to our Anycase library, and then actually getting the files.
So sometimes you can retrieve them digitally from publicly available sources, but sometimes you have to get data runners, and that alone can already be a challenge.
So to give you an example, there was this one time where we were quoted ₱500 per page for a legal document. So that's really expensive considering how many pages, how many documents you have to get from them. Yeah. So access itself can already be difficult.
So once we have those documents, the next step is vetting them.
So what that means is that our team checks the document, makes sure that the title, citation, date, all of the contents are complete and accurate. So what we do is that we add one source at a time. So for instance, we're going to add BI this week.
We'll look first at what's available online on the BI website, get all of the information, again check those documents, and then when we have identified that some issuances or some decisions from the BI are missing, that's when we send letters to them via our data runners to get those documents.
And the process just repeats itself. We get the documents, verify them, make sure that everything's complete. So once we're done with the process of collection, the documents that we need to get from these agencies are already complete.
We then turn to our Data Engineering team, who then cleans and structures the documents before they are available to our users. So what that means is making sure that, again, the title, the citation, all the metadata are accurate based on the information that is provided by the Legal Intelligence team.
You mentioned a criterion. Can you speak more to the criteria for approving the release?
Tyra Delos Reyes: I am specifically interested in knowing how you determine that an evaluation round is complete and this update is ready to be released to the users.
Atty. Sandro Perez: Yeah. So I guess to sum it up, if the system performs below a certain level, we investigate first where exactly the problem is coming from.
Is there a document missing? Is it the retrieval that's failing? Is the system classifying the wrong material, et cetera?
And then we fix all of these identified issues before the document goes live. We don't expect Anycase to be perfect during the evaluation period. But whenever we release it to our users, the answers that are incorrect, we're able to still identify where we got the answer incorrectly.
And there should be at no point answers that are totally or manifestly incorrect that would lead a user, when a user relies on this answer, it could materially affect his professional life.
So I know that we have an internal goal of adding a new government source within one to two months. 'm curious if there are times where that's been delayed.
Atty. Sandro Perez: Yeah. Yeah, for sure.
Because like I mentioned a while ago, trust starts before the answer, and that's really our CEO's philosophy.
And I guess I'll give you a specific example of when ingesting new sources got delayed because we want to prioritize evaluation.
When we were adding Bureau of Customs documents, during testing talaga, we already saw that Anycase accuracy for queries involving BOC was only around 60%. And for us, that's unacceptable.
And so the Legal Intelligence team, which is the team I lead, we had to investigate why we're performing only at 60%. And I think that's really the lawyer-in-the-loop part of the system, you know, saying, okay, we want to understand also why the answer is wrong.
And through the evaluation process, we guide Anycase toward the correct legal basis, para in the next instances that the user asks this question for their own legal matter, we make sure that Anycase is already able to support a lawyer's actual query for their actual case.
And we do it this time correctly. So yeah, sometimes that means a source takes longer to release.
We have a lot of data requests from our users, but we'd rather hold something back and investigate first if there are going to be any errors, than release it when we already know the answers aren't meeting the standards of our lawyers.
FAQ and interview recap
Why are lawyers involved in developing Anycase?
Through rigorous evaluations, we've observed that AI systems can still make significant errors, even when they have access to the right legal sources. Common failure modes include citing outdated rulings, missing controlling authorities, and incorrectly applying legal provisions. We've documented these patterns in our evaluations.
These findings reinforce a philosophy we've held from the beginning: lawyers need to be directly involved in developing, testing, and improving legal AI. This approach also reflects the principles of human oversight and accountability emphasized in the Supreme Court's Governance Framework on the Use of Human-Centered Augmented Intelligence in the Judiciary (A.M. No. 25-11-28-SC).
What is LAGDA, and how does it work?
LAGDA (Lawyer-Annotated and Governed Data Architecture) is Anycase's proprietary system that allows real lawyers to guide how AI understands and uses Philippine legal sources.
We've been doing this through our Data Engineering team but operationalized it as early as May 2026 so Anycase's in-house lawyers could easily integrate into the data verification process.
Through LAGDA, our Legal Intelligence team can verify legal documents, annotate relationships between authorities, and flag outdated or non-controlling sources. These annotations help the system retrieve and apply the appropriate legal basis without changing the underlying laws or jurisprudence.
How does Anycase use human-in-the-loop evaluations to improve accuracy?
Our lawyers regularly test Anycase using actual legal questions, review its answers, and investigate where the system makes mistakes. They identify whether errors come from missing documents, incorrect retrieval, or the misapplication of legal authorities.
These findings inform improvements to the system, which undergoes further evaluation before new legal sources are released to users. As Sandro explains, our guiding philosophy is simple: "Trust starts before the answer."

