Inspiration
I am from Pakistan and I have been facing this problem: we have some land disputes in our family. I was curious to know what the law says about those particular disputes but we don't know about the law. And I then thought that, the way technology is progressing, we should also use technology in that thing. Unfortunately the law of Pakistan was not available to me and this hackathon came then. I thought I should build something with American law or something like that because the logic will be the same but the official law site, which will be backing that agent, will be different. That's why I built this agent for the residents of California right now.
What it does
You basically describe your situation in your own words and then you send that to CalLaw and CalLaw tries to understand your particular situation. If it's not able to understand your situation well enough, it will ask you a few clarifying questions. Once you answer those clarifying questions, it will search the official California law site and will identify which laws apply to your particular situation. It will give you a response then and in the response it will also quote those laws and will even give you the links to those official site laws.
How I built it
For the frontend I use Next.js, TypeScript, and Tailwind CSS for the styling and stuff. For the backend I use Python and FastAPI and and my frontend is deployed on Vercel and my backend is deployed on Railway. I used Claude Code for the coding part.
Challenges we ran into
There were some challenges which I faced during building this:
- Finding the official constitutional site which my agent can rely on.
- Coding agents are good but you have to tell them what to do. That part took some time, like planning how it should approach this problem.
- The hallucination problem was very serious in agents so overcoming that was also quite a challenge for me.
Accomplishments that we're proud of
I'm literally proud of what I have built because the agent is responding in a very good way. I wish I could find Pakistan's law and then I can build this agent for Pakistani residents because it's a very good portfolio project #1. It can also become a business because the way the agent is quoting official law and not hallucinating and even asking clarifying questions to understand your particular situation, I think this is a very reliable thing. The market is open for this problem.
What we learned
Honestly I started this project 2 days ago and then I got distracted by other things but I learned this thing: if you have an idea and you put in the effort to make that idea into a product, you can make it. I was not sure I would be able to build this because I have no experience with this certain thing. I have built other projects but I didn't build this kind of project before. I learned that if you can think of an idea you can also build an idea into reality. You just have to be consistent and put in the effort. Secondly, I was thinking I should approach this project in a way where I should have all the constitutions in files and my constitution should be saved in my DB so I can query my DB every time for a particular constitution. I have learned, however, that this approach was not good from first-principles thinking. And then I came to this conclusion: instead of storing everything in my DB I should be able to build a product that can search on the official website. I haven't built a project like this before. Every time I build something everything is in my DB but this time I've learned you can build some project in a way that can scrape from that particular website. That was a technical learning for me.
What's next for CalLaw
I think I am based in Pakistan so I should build CalLaw for Pakistani residents. This product can then be marketed to individual citizens who have some cases and some issues. Particularly what I'm thinking now is that this can be a good product for lawyers too, junior lawyers or law firms, because they can describe the situation of the customer there. It will show them which laws apply to them and this can be very useful to them.
Built With
- fastapi
- next.js
- python
- typescript
Log in or sign up for Devpost to join the conversation.