Cost Engineering Multi-Agent System
Professional Work | 2025 - Present
Note: This work is confidential under NDA. Details presented focus on general engineering skills and publicly available technologies without disclosing proprietary information or client identity.
Overview
Built and deployed a production 10+ node multi-agent system using LangGraph, serving the cost control department of a large global engineering consultancy. The system allows cost engineers to query decades of historical project cost data through natural language, analyze Bills of Quantities (BoQs), and generate reliable, SQL-grounded cost estimates for major infrastructure projects.
The client operates at the scale of some of the world's most complex infrastructure programs. Their cost control team manages data across a vast portfolio of completed and active projects globally. This agent brings that accumulated knowledge to engineers' fingertips, replacing manual database queries and spreadsheet hunting with a reliable, conversational interface backed by verifiable SQL results.
My Role
Lead AI Engineer — Designed the full multi-agent graph topology, implemented all reasoning nodes and tool integrations, established the SQL query validation pipeline, and deployed the system to serve the cost control department.
Agent Architecture
The system is built as a directed graph of 10+ specialized LangGraph nodes, each responsible for a distinct reasoning or execution step. The topology ensures that every final answer is grounded in verifiable data, not model hallucination.
Core Agent Nodes
- Query Router: Classifies incoming questions and routes them to the appropriate sub-agent pipeline (SQL, API, BoQ analysis, or estimation)
- Text-to-SQL Generator: Translates natural language cost queries into precise SQL statements against the historical cost database
- SQL Validator: Verifies generated queries for correctness and safety before execution, preventing malformed or destructive operations
- SQL Executor: Runs validated queries and returns structured result sets
- BoQ Parser: Extracts, structures, and analyzes Bill of Quantities data, mapping line items to cost categories and unit rates
- Cost Estimator: Synthesizes historical unit rates, quantities, and market data to generate project cost estimates with confidence indicators
- API Integration Node: Fetches real-time pricing and reference data from external APIs to supplement historical database figures
- Answer Verifier: Cross-checks generated estimates against multiple data sources to flag inconsistencies before surfacing results to the user
- Response Synthesizer: Composes final responses that clearly cite sources, SQL results, and confidence levels, ensuring engineers can trust and audit every number
Model Strategy
- Mixture of Models: Different nodes use models optimized for their task, balancing reasoning quality, latency, and cost across the agent graph
- Fine-tuning Roadmap: Active research toward a domain-specific fine-tuned model trained on the organization's cost engineering vocabulary, BoQ formats, and SQL patterns, to improve accuracy on specialized queries
Key Capabilities
Cost Intelligence
- Query the historical cost SQL database in plain English: "What was the unit cost for structural steel in metro station projects in the Gulf region?" or "Show me concrete costs across our last 10 airport projects"
- Analyze and parse uploaded BoQ documents, mapping quantities to historical benchmarks
- Estimate budget ranges for new project scopes based on comparable historical work
- Retrieve real-time pricing data from integrated APIs for current market rates
Trustable Numbers
- Every cost figure is SQL-grounded: the agent shows the underlying query and result set alongside its answer, making estimates fully auditable
- Confidence indicators flag when estimates are based on limited historical data or when market conditions may have shifted significantly
- Multi-source validation cross-references database results with API data to surface discrepancies
- Designed to replace "I think it was around this much" with "Based on 23 comparable projects, the average unit cost was X, with a range of Y to Z"
Scale and Context
- Database scope: Querying across historical cost data from a large portfolio of completed global infrastructure projects spanning multiple decades
- BoQ scale: Individual projects can carry BoQs with thousands of line items across dozens of work packages
- Users: Serving cost engineers and project controllers responsible for budget management across an extensive active and pipeline project portfolio
- Domain coverage: Transportation, aviation, metro systems, water infrastructure, buildings, and urban development sectors
Technical Skills Demonstrated
Engineering Learnings
The core challenge in a cost engineering agent is not accuracy in isolation, it is trust. A cost engineer staking a project budget on an AI-generated figure needs to know exactly where that number came from. Designing the answer verification and source attribution nodes was as important as the reasoning capability itself.
Managing a 10+ node graph requires deliberate topology design. Early cycles revealed that routing quality at the entry node had outsized impact on the entire pipeline. An incorrectly routed query that reaches the wrong sub-agent produces plausible-looking but wrong answers. The query router was the node that received the most iterative refinement.
The transition from a mixture of models toward a fine-tuned specialist model is driven by the same principle: general-purpose LLMs work, but they occasionally struggle with domain-specific BoQ terminology, project type classification, and the structured SQL patterns that the cost database requires. A fine-tuned model should close that gap significantly.