# DSCons Agent Role Analysis

## Objective

This document identifies the **three highest-priority business positions** to map to the first three AI agents in a construction company using the DSCons stack.

Deployment target:
- **1 shared model serves 3 agents**
- one local `llama-server`
- Qdrant for retrieval
- DSCons API as orchestration layer

The goal is not to maximize the number of agents. The goal is to place the first three agents where they create the **largest operational and financial impact**.

---

## Executive summary

The three most important agent positions to deploy first are:

1. **Contract Tender Agent**
2. **BOQ Procurement Agent**
3. **Site Safety Agent**

These three positions were selected because together they protect the three highest-value control points in a construction company:

- **Revenue intake** → tendering and contract review
- **Margin protection** → BOQ, procurement, and cost control
- **Operational risk reduction** → site safety and field reporting

In simple terms:

- Agent 1 protects whether the company wins the right jobs
- Agent 2 protects whether the company makes money on those jobs
- Agent 3 protects whether the company can execute safely and continuously

---

## Why these three positions matter most

A construction company usually loses money or suffers damage in one of three places:

1. before contract award because the team misses risks in tender or contract documents
2. during purchasing and quantity control because material, scope, or pricing errors reduce margin
3. on site because unsafe execution causes incidents, delays, claims, or shutdowns

That is why the first three agents should not be generic assistants. They should be attached directly to the business functions with the highest leverage.

---

## Agent 1 — Contract Tender Agent

### Primary users
- tender department
- internal legal reviewer
- bid manager
- preconstruction/project manager
- directors who need fast decision support

### Business purpose
This agent helps the company review tender documents and contract terms faster, with better consistency and lower risk.

### Highest-value tasks
- summarize invitation-to-bid packages
- extract key commercial and legal clauses
- identify payment, retention, warranty, LD, and schedule risks
- detect missing documents, ambiguities, and conflicting terms
- generate bid submission checklists
- draft clarification questions and RFI items
- compare addenda and contract revisions

### Why this agent is essential
This is one of the most important front-end control points in the company.

If this function is weak:
- the company may bid on bad opportunities
- critical contract risks may be missed
- cash flow terms may be accepted without proper review
- teams may submit incomplete tender packages

If this function is strong:
- bid/no-bid decisions improve
- submission speed improves
- contract exposure decreases
- executives get faster visibility into project risk

### Example outputs
- tender risk summary
- contract clause checklist
- missing submission item list
- clarification question draft
- payment-term risk memo

### KPI suggestions
- time to review one tender package
- number of contract risks identified before submission
- tender submission completeness rate
- time saved per bid
- number of RFIs/clarifications prepared automatically

### DSCons data sources to connect
- tender documents
- contract templates
- previous contract redlines
- addenda and clarifications
- bid/no-bid internal criteria
- payment and warranty policy documents

### Recommended Qdrant knowledge namespace
- `contracts`
- `tenders`
- `legal_templates`

---

## Agent 2 — BOQ Procurement Agent

### Primary users
- QS team
- procurement team
- project accountants
- site command team
- cost control staff

### Business purpose
This agent helps the company reduce leakage in quantity, material planning, request-for-quotation preparation, and supplier comparison.

### Highest-value tasks
- normalize BOQ structures
- compare BOQ items against drawings and scope notes
- group procurement packages by material category
- generate RFQ-ready material lists
- summarize and compare supplier quotations
- detect abnormal unit-price gaps
- flag possible quantity mismatch or duplicate line items
- prepare quick procurement recommendations

### Why this agent is essential
This is the strongest profit-protection position among the first three.

In many construction businesses, margin is lost through:
- quantity errors
- purchasing delays
- duplicate requests
- wrong specifications
- uncontrolled price differences
- poor comparison between vendors

A BOQ/procurement agent directly reduces these issues.

### Example outputs
- BOQ normalization sheet
- quantity mismatch alert
- RFQ package summary
- supplier comparison table
- abnormal pricing warning
- procurement action list

### KPI suggestions
- turnaround time from BOQ/request to RFQ draft
- number of quantity mismatches detected
- number of abnormal vendor quotes flagged
- time saved in quotation comparison
- procurement cycle-time reduction

### DSCons data sources to connect
- BOQ files
- drawing notes and specifications
- approved vendor list
- historical material pricing
- purchase request templates
- supplier quotations
- variation/change order records

### Recommended Qdrant knowledge namespace
- `boq`
- `procurement`
- `suppliers`
- `cost_control`

---

## Agent 3 — Site Safety Agent

### Primary users
- HSE officer
- site manager
- field supervisors
- construction manager
- operations leadership

### Business purpose
This agent helps the company standardize safety reporting, surface risk faster, and reduce operational incidents on site.

### Highest-value tasks
- generate daily and weekly safety checklists
- summarize incident and near-miss reports
- standardize toolbox talk content
- detect recurring safety issues from field reports
- generate corrective action lists
- remind teams about PPE, scaffolding, lifting, temporary electrical, and work-at-height controls
- prepare site safety summaries for management

### Why this agent is essential
Safety is not only a compliance topic. It is an operational continuity topic.

If safety control is weak:
- incidents increase
- work interruptions increase
- claims and delays increase
- leadership visibility drops
- insurance and reputation costs rise

If safety control is strengthened:
- reporting becomes faster
- near-miss learning improves
- corrective actions are more visible
- site teams work from clearer checklists

### Example outputs
- daily safety checklist
- incident summary
- corrective action tracker
- near-miss pattern report
- toolbox talk draft
- weekly site safety summary

### KPI suggestions
- time to prepare safety reports
- number of early warnings surfaced
- near-miss closure speed
- number of repeated safety findings reduced
- response time after incident logging

### DSCons data sources to connect
- safety manuals
- HSE procedures
- incident and near-miss forms
- inspection checklists
- toolbox talk templates
- site diary content
- corrective action logs

### Recommended Qdrant knowledge namespace
- `safety`
- `site_reports`
- `hse_procedures`

---

## Why these three are better than other possible first agents

Other roles such as QA/QC, planning, HR, payroll, or executive reporting are also useful. However, they are less urgent than the first three if the company is at an early stage of AI deployment.

### Lower-priority phase-2 candidates
4. Planning / PMO Agent  
5. QA/QC Inspection Agent  
6. Workforce / manpower coordination agent  
7. Management reporting / owner communication agent  

### Why they come later
- planning value is real, but many planning tasks depend on cleaner contract and quantity data first
- QA/QC is important, but early ROI is usually lower than contract risk + procurement savings + safety control
- HR/admin use cases help efficiency, but they usually do not protect core project margin as directly
- executive reporting becomes stronger only after source workflows are stabilized

---

## Recommended mapping of real business owners

### Agent 1 — Contract Tender Agent
Assign primary ownership to:
- head of tender
- legal reviewer
- preconstruction lead

### Agent 2 — BOQ Procurement Agent
Assign primary ownership to:
- QS lead
- procurement lead
- cost control lead

### Agent 3 — Site Safety Agent
Assign primary ownership to:
- HSE lead
- site manager
- field supervision lead

This is important because AI agents only work well when a real department owns the workflow, validates outputs, and defines acceptable quality.

---

## Recommended input/output design for each agent

## 1. Contract Tender Agent

### Typical inputs
- HSMT package
- draft contract
- addenda
- owner clarifications
- payment schedule
- bid instructions

### Typical outputs
- risk summary
- compliance checklist
- missing-item list
- clarification draft
- executive decision memo

## 2. BOQ Procurement Agent

### Typical inputs
- BOQ spreadsheet
- material takeoff
- specs
- vendor quotes
- purchase requests
- budget references

### Typical outputs
- normalized BOQ
- quote comparison summary
- procurement checklist
- outlier alert
- recommended RFQ package

## 3. Site Safety Agent

### Typical inputs
- daily site logs
- inspection forms
- incident reports
- photos with descriptions
- toolbox talk topics
- HSE procedures

### Typical outputs
- safety checklist
- incident summary
- action tracker
- recurring issue summary
- management report

---

## Recommended system design with 1 model serving 3 agents

The current deployment objective is:

- **one shared model**
- **three logical agents**
- **one orchestration API**
- **Qdrant retrieval per domain**

### Recommended implementation pattern
Use:
- one shared `llama-server` endpoint
- one DSCons API
- three separate system prompts
- three domain-specific retrieval paths
- either:
  - one route with `agent_type`, or
  - three dedicated API routes

### Example routing model
- `/agent/contract-tender`
- `/agent/boq-procurement`
- `/agent/site-safety`

or

- `/agent/run` with:
  - `agent_type=contract_tender`
  - `agent_type=boq_procurement`
  - `agent_type=site_safety`

### Why this architecture is preferred
It keeps:
- memory usage lower
- deployment simpler
- maintenance easier
- model governance centralized

It also fits a 16 GB workstation much better than launching three dedicated model runtimes.

---

## Recommended rollout order

### Phase 1
Deploy:
1. Contract Tender Agent
2. BOQ Procurement Agent
3. Site Safety Agent

### Phase 2
Measure:
- usage frequency
- user adoption
- time saved
- error reduction
- decision quality improvement

### Phase 3
Add:
- planning/PMO
- QA/QC
- management reporting
only after phase-1 data proves stable workflows

---

## Final recommendation

If DSCons must start with only three agents, the strongest business allocation is:

1. **Contract Tender Agent**
2. **BOQ Procurement Agent**
3. **Site Safety Agent**

This is the best first deployment because it covers:
- contract and bid risk
- margin and purchasing control
- field safety and operational continuity

For a 16 GB local machine and the current DSCons architecture, the right technical strategy remains:

- **1 shared local model**
- **3 logical agents**
- **domain-specific retrieval in Qdrant**
- **FastAPI orchestration layer**

That is the highest-leverage starting configuration for a construction company.
