Back to Home

WA Mining Legislation AI Assistant

Live demo of AI-powered chatbot for Western Australian mining legislation. Built with RAG (Retrieval-Augmented Generation) technology.

WA Mining Legislation AI

Powered by RAG + GPT-3.5

Hello! I can answer questions about Western Australian mining legislation, including the Mining Act 1978, Mining Regulations 1981, Environmental Protection Act 1986, and Mining Rehabilitation Fund Act 2012. What would you like to know?

3:44:01 PM

Suggested questions:

AI responses based on official WA legislation. Always verify critical information.

Example Questions to Try:

  • What environmental approvals do I need for exploration drilling in WA?
  • What are the tenement renewal requirements under the Mining Act 1978?
  • How does the Mining Rehabilitation Fund Act 2012 work?
  • What are the reporting obligations for native vegetation clearing?
  • What are the safety requirements for mine site operations?

Technical Stack

Frontend

Next.js 14, TypeScript, Tailwind CSS

Backend

Python FastAPI, Docker

AI/ML

LangChain, OpenAI GPT-3.5

Vector Database

ChromaDB with OpenAI Embeddings

Deployment

Vercel (Frontend), Render (Backend)

Legislation Covered

  • Mining Act 1978 (WA)

    305 pages • Core mining operations

  • Mining Regulations 1981 (WA)

    333 pages • Operational compliance

  • Environmental Protection Act 1986

    371 pages • Environmental approvals

  • Mining Rehabilitation Fund Act 2012

    33 pages • Rehabilitation funding

Total: 1,042 pages of legislation processed

How It Works

  1. 1.Your question is embedded into a 1536-dimension vector
  2. 2.ChromaDB finds the 5 most relevant legislation excerpts
  3. 3.GPT-3.5 generates an answer citing specific sections
  4. 4.Response includes act names and page numbers

System Performance

Response Time:2-4 seconds
Accuracy:Citation-backed
Vector Chunks:~2,500+
Uptime:99.9%

Important: This AI assistant provides information based on WA mining legislation but should not be considered legal advice. Always consult qualified professionals for compliance matters.

Technical Implementation

RAG Pipeline Architecture

This chatbot uses a Retrieval-Augmented Generation (RAG) pipeline to provide accurate, citation-backed answers about Western Australian mining legislation. Here's how the system works:

1. Document Processing

  • Official WA government legislation PDFs are processed using PyPDFLoader
  • Documents are split into 1000-character chunks with 200-character overlap
  • Metadata extraction captures act titles, versions, and publication dates
  • Each chunk preserves source file and page number information

2. Vector Store Creation

  • OpenAI's text-embedding-ada-002 model generates 1536-dimension vectors
  • ChromaDB stores vectors with cosine similarity search
  • Separate collections for each act enable targeted retrieval
  • Persistent storage allows instant loading without re-processing

3. Query Processing

  • User questions are embedded using the same OpenAI model
  • Semantic search retrieves top 5 relevant chunks across all 4 acts
  • Context is assembled with source citations and page numbers
  • GPT-3.5-turbo generates responses grounded in retrieved context

Development Timeline

This MVP was built in approximately 2-3 weeks by adapting an existing StrataBot RAG architecture:

  • Week 1: PDF acquisition, validation, and OCR processing (where needed)
  • Week 2: RAG pipeline configuration, vector store generation, and API endpoint creation
  • Week 3: Frontend chat widget development, demo page creation, and deployment

Portfolio Value

This project demonstrates proficiency in production AI systems, including vector databases, RAG pipelines, API design, full-stack development, and cloud deployment. The system processes over 1,000 pages of complex legal documentation and provides accurate, citation-backed responses in real-time.