⚖️ MyPropLex

AI-powered Malaysian Property Law Research Assistant

Python Claude Sonnet 4.6 Tavily Search Streamlit Legal Tech

📋 Project Overview & Problem Statement

Challenge: Malaysian property lawyers and conveyancing clerks spend 2–4 hours every working day on manual legal research — searching case law databases, reading legislation updates, and cross-checking multiple sources before advising a single client. This is slow, expensive, and error-prone.

Solution: MyPropLex is an AI-powered research assistant that specialises exclusively in Malaysian property law. It searches the web for relevant legislation, case law, and legal updates, then delivers a clear, cited answer in plain language — in under 2 minutes.

Key Benefits

🖥️ Application Features

⚖️ Legal Question Answering

Ask any Malaysian property law question in plain English. The assistant searches current legislation and case law, then replies with a 3-sentence cited answer — no jargon.

🔍 Live Web Search

Powered by Tavily Search API, the assistant fetches real-time results from the AG Chambers website, Bar Council publications, CommonLII, and Malaysian legal journals.

📋 10 Preset Questions

New users see 10 common property law questions in the sidebar. One click sends the question — no typing needed. Covers NLC transfers, RPGT, HDA obligations, MOT requirements, and more.

📥 Copy & Download

Every answer has a one-click copy button. The full conversation can be downloaded as a .txt file for record-keeping or sharing with colleagues.

🧠 Conversation Memory

The assistant remembers earlier questions in the same session, so lawyers can ask follow-up questions without repeating context. Session resets with one click.

🌐 Web Interface

Built with Streamlit — accessible from any browser with no installation needed. Navy and gold color scheme designed for a professional legal tool feel.

Malaysian Property Acts Covered

National Land Code
HDA 1966
Strata Titles Act
RPGT Act
RERA
Contracts Act
Specific Relief Act
Land Acquisition Act

🤖 AI Integration & Intelligence

🧠 Claude Sonnet 4.6 (Anthropic)

The core reasoning engine. Claude reads Tavily search results, cross-references relevant acts, and synthesises a 3-sentence answer with citations. It is instructed to flag recent amendments and avoid giving formal legal opinions.

🔎 Agentic Search Loop

Uses the Anthropic tool-use API in a ReAct loop — Claude decides what to search, calls the search tool, reads results, and repeats until it has enough information to answer confidently.

📝 Niche System Prompt

The system prompt restricts Claude to Malaysian property law only, enforces the 3-sentence format, and requires plain language free of legal jargon. This is what makes responses consistently useful to non-lawyers too.

⚡ Targeted Search Sources

Tavily is instructed to prioritise agc.gov.my (AG Chambers), malaysianbar.org.my (Bar Council), commonlii.org (case law), and Malaysian legal journals — giving higher-quality results than generic web search.

🛠️ Technical Architecture & Implementation

Frontend Stack

Streamlit 1.32+ Custom CSS (Navy + Gold theme) HTML Components

Backend Stack

Python 3.10+ Anthropic SDK Tavily Python SDK python-dotenv

Deployment

Streamlit Community Cloud Local (Windows .bat launcher)

System Architecture

📖 Development Setup & Installation Guide

Prerequisites

Quick Start

# Clone from portfolio git clone https://github.com/lyven81/ai-project.git cd ai-project/projects/myproplex # Install dependencies pip install -r requirements.txt # Set up API keys copy .env.example .env # Edit .env and add your ANTHROPIC_API_KEY and TAVILY_API_KEY # Run web interface streamlit run web_app.py # Or run CLI version python app.py

Environment Configuration

ANTHROPIC_API_KEY=your_anthropic_api_key_here TAVILY_API_KEY=your_tavily_api_key_here

Windows One-Click Launch

🚀 Deployment on Streamlit Community Cloud

# 1. Push project to GitHub # 2. Go to share.streamlit.io and connect your repo # 3. Set main file as: web_app.py # 4. Add secrets in the Streamlit dashboard: # ANTHROPIC_API_KEY = "your_key" # TAVILY_API_KEY = "your_key" # 5. Deploy — live URL generated automatically

Production Notes

📊 Key Metrics

8
Property Acts Covered
10
Preset Questions
3
Sentences Max Per Answer
< 2 min
Research Time Per Query

Business Value