About Building Code Assistant
Learn how AI technology makes building codes accessible and searchable for everyone.
RAG (Retrieval-Augmented Generation) is an AI technique that combines the power of information retrieval with text generation. Instead of relying solely on pre-trained knowledge, RAG systems can access and reference specific documents to provide accurate, up-to-date answers.
Here's how it works in our Building Code Assistant:
1. Search
Your question is used to find relevant sections in building codes
2. Retrieve
Exact code sections and regulations are pulled from our database
3. Generate
AI creates a clear answer using the retrieved code information
LLM (Large Language Model) is an AI system trained on vast amounts of text to understand and generate human-like language. Think of it as a very sophisticated reading and writing assistant that can understand context and provide helpful responses.
Why LLMs are Perfect for Building Codes
- • Complex Language: Building codes use technical legal language that LLMs can interpret
- • Context Understanding: They can understand what you're asking even with incomplete information
- • Plain English: They can translate complex code language into easy-to-understand explanations
- • Precise Citations: They can point you to exact code sections and requirements
Our system uses Claude by Anthropic, one of the most advanced and safety-focused LLMs available, ensuring accurate and helpful responses to your building code questions.
You might wonder: if modern LLMs can search the internet in real-time, why use RAG? The answer lies in precision, reliability, and control — especially critical when dealing with legal documents like building codes.
RAG Advantages
- • Guaranteed Accuracy: Curated, verified documents only
- • Consistent Results: Same question = same authoritative answer
- • Local Amendments: City-specific codes and interpretations
- • Exact Citations: Precise section references with confidence
- • Less Hallucinations: Answers come from real code text
- • Offline Capability: Works without internet dependency
Web Search Limitations
- • Outdated Information: Cached or stale building codes
- • Unreliable Sources: Mixing official codes with commentary
- • Missing Context: Local amendments may not be indexed
- • Broken Links: Government sites frequently reorganize
- • Variable Quality: Results depend on search engine indexing
- • Cost & Speed: Real-time search is slower and more expensive
Perfect Use Case: California Building Codes
Building codes are updated every 3 years, have specific local amendments, and require exact legal citations. RAG ensures you're always working with the correct, official version — something web search cannot guarantee. When compliance and safety are on the line, precision matters more than real-time information.
This Building Code Assistant was created by Christopher Kurdoghlian, an Electrical Engineering student and Computer Science minor at Cal Poly Pomona with experience in AI, web development, and AWS cloud services.
The project combines cutting-edge AI technology with practical civic utility, making building codes more accessible to contractors, architects, homeowners, and city planners.
AI services have raised concerns about energy consumption and computational costs. Here's a complete breakdown of what each question actually costs to process:
Cost Per Question Breakdown
Converting your question to vector format
Finding 7 most relevant code sections
~1,000 input + 300 output tokens
Rate limiting, logging, hosting
Energy Efficiency
- • Optimized Processing: RAG is more efficient than web crawling
- • Cached Vectors: Building codes are pre-embedded (one-time cost)
- • Targeted Search: Only searches relevant community codes
- • AWS Green Energy: Running on renewable-powered data centers
- • Minimal Compute: ~2-3 seconds total processing time
Cost Context
- • Less than a penny per question
- • 100x cheaper than traditional legal research
- • Eliminates printing: No paper code books needed
- • Reduces travel: Less trips to city planning offices
- • Saves time: Instant answers vs. hours of manual searching
Why We Limit to 100 Questions/Day
At ~$0.008 per question × 100 questions = ~$0.80/day in computational costs. This sustainable limit allows us to provide free access while maintaining quality service. It also encourages thoughtful questions rather than excessive casual browsing.
Environmental Impact Comparison
• Digital Query: ~0.004 kWh (equivalent to 2 minutes of LED bulb)
• Driving to City Hall: ~2-3 kWh (500x more energy)
• Printing Code Book: ~15 kWh (3,750x more energy)