How We Built LawHero: An AI-Powered Legal Research Platform
The Challenge
Hong Kong's legal industry relies heavily on case law research. Lawyers spend hours manually searching through thousands of court judgments to find relevant precedents. The process is tedious, time-consuming, and prone to human error — missing a key case can mean losing an argument in court.
Our client approached us with a clear vision: build a platform that uses AI to make legal research fast, accurate, and accessible to every lawyer in Hong Kong.
Our Approach
Discovery & Research
We started by shadowing lawyers during their research workflow. We observed how they searched for cases, what keywords they used, and where the existing tools fell short. Key findings:
- Lawyers often need to search by legal concepts, not just keywords
- Court judgments contain complex language that simple text search handles poorly
- Cross-referencing between related cases is a manual, error-prone process
- Most existing tools were designed decades ago with outdated interfaces
Architecture Decisions
We chose a modern tech stack optimized for AI-powered search:
- Next.js for the web platform — fast, SEO-friendly, and great developer experience
- Vector database for semantic search — enabling concept-based search, not just keyword matching
- OpenAI embeddings for understanding legal language and context
- PostgreSQL for structured data and metadata storage
Building the AI Pipeline
The core innovation was our semantic search pipeline:
- Data ingestion — We processed thousands of Hong Kong court judgments, extracting metadata, citations, and full text
- Embedding generation — Each judgment was converted into vector embeddings that capture legal concepts and relationships
- Smart indexing — We built a multi-layered index combining traditional keyword search with semantic similarity
- AI assistant — An intelligent chat interface that understands legal questions and returns relevant cases with explanations
The Results
LawHero launched to an enthusiastic reception from the Hong Kong legal community:
- Research time reduced by 80% — what took hours now takes minutes
- Higher accuracy — semantic search catches relevant cases that keyword search misses
- Growing user base — adopted by law firms across Hong Kong
- Positive feedback — lawyers report finding cases they never would have discovered manually
Key Learnings
- Domain expertise matters — working closely with lawyers throughout the process was essential
- AI augments, not replaces — the best results come from combining AI capabilities with human legal judgment
- Data quality is everything — the accuracy of the AI depends entirely on the quality of the underlying data
- Start simple, iterate — we launched with core search functionality and added features based on user feedback
Tech Stack Summary
- Next.js (App Router)
- PostgreSQL + Vector extensions
- OpenAI API (embeddings + chat)
- Tailwind CSS
- Vercel for deployment
LawHero demonstrates how AI can transform traditional industries when applied thoughtfully. The key is not just using AI for its own sake, but deeply understanding the problem and building a solution that genuinely helps users work better.

