Island Code: AI-Powered Caribbean Case Law Database
Inspiration
As an attorney, I've experienced firsthand the challenges of legal research in the Caribbean. Finding the right case from various courts often feels like searching for a needle in a haystack. The limited free online resources lack robust search functionality, making it difficult to perform full-text searches. Moreover, analyzing a case is a time-consuming task, often taking hours and involving redundant, repetitive work. I was inspired to create a tool that would streamline this process and make legal research more efficient and accessible.
What it does
Island Code is a growing database of Caribbean case law. It offers powerful full-text search capabilities, along with useful filtration tools, allowing users to easily find relevant cases quickly. This marks a significant improvement over previous systems with limited search functionality. On top of that our advanced RAG (Retrieval Augmented Generation) component analyzes cases with the precision of an experienced attorney, extracting highly accurate data and insights.
How we built it
We built Island Code using a robust tech stack designed for performance and reliability:
- Database: We use a MySQL database hosted on Digital Ocean to store case PDFs and structured data.
- Framework: Our application is built with Next.js, providing a fast, server-side rendered experience.
- AI Integration: We leverage OpenAI's structured output feature to ensure 100% guaranteed and reliable output structures.
- RAG System: Our Retrieval Augmented Generation system includes a confidence ranker component, categorizing results as high, medium, low, or unknown confidence, allowing for human intervention when necessary.
- Multi-pass Analysis: The RAG system first reads the case to find info, then refines it again, dramatically reducing errors and missed information.
- Flexible Architecture: We intentionally kept the analyse-case route less DRY to allow for greater flexibility and a more fine-tuned approach when needed.
- Full-text Search: We implemented a powerful full-text search capability, making it easy to find relevant cases using keywords.
Challenges we ran into
- Reliable PDF Text Extraction: Extracting text from PDFs consistently and accurately proved to be a significant challenge.
- Cost Management: Managing the costs associated with OpenAI API usage and Digital Ocean hosting required careful planning and optimization.
- Prompt Engineering: Tweaking prompts to ensure the AI understood the nuances of each section in the RAG system and consistently produced accurate results was a complex process.
Accomplishments that we're proud of
- Superior Case Analysis: Our refined RAG system produces significantly better case analyses compared to using a standard LLM approach. The multi-pass refinement process has made a substantial difference in accuracy and completeness.
- Improved Accessibility: We're making it easier for Caribbean nationals to access and understand legal precedents, potentially improving access to justice.
What we learned
- OpenAI Structured Output: We gained valuable experience working with OpenAI's new structured output formats.
- Full-text Search Implementation: We learned how to create meaningful full-text search capabilities with MySQL for large datasets.
- PDF and DOCX Text Extraction: We explored various methods for extracting text from PDFs and DOCX files on both client and server-side.
What's next for Island Code
- Natural Language Queries: Implement natural language query capabilities for the entire database.
- AI Assistant Researcher: Develop an AI assistant that can leverage embedded case knowledge, fact patterns, and legislation to assist with legal research.
- Expanded Database: Add more cases and legislation to the database, covering a wider range of Caribbean jurisdictions.
Built With
- mysql
- nextjs
- openai

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