Green-Agent
Picking a freight carrier on cost and carbon at once, with agents that bid and an LLM that explains the choice
Team
Solo project
My role
Full-Stack Engineering
Algorithm Design
Tools
Python
FastAPI
Fetch.ai uAgents
React
PostgreSQL
Duration
Personal project
Overview
Green-Agent lets a shipper pick a freight carrier on cost and carbon at once, instead of defaulting to the cheapest quote. Each shipment request goes out to carrier agents, which reply with price, ETA, and CO2e bids. A scoring engine ranks them using weights the shipper sets, an LLM explains why the top carrier won, and the shipper approves the choice before it's booked.
Problem
Shippers choose carriers mostly on price, because emissions data is scattered and hard to compare. Even a shipper who wants to cut emissions makes the cost-versus-carbon call by hand, shipment by shipment. Three gaps make this hard:
No common format
Carriers report price, delivery time, and emissions differently, so quotes can't be compared side by side.
No visible impact
Shippers can't see how much CO2e their choices saved, so sustainability goals are hard to track.
No consistent tradeoff
Without a scoring rule, the same shipper makes different cost-versus-carbon calls from one day to the next.
Goals
The MVP proves that agents can collect comparable bids and that a transparent score can trade cost against carbon. Real carrier integrations, certified emissions accounting, payments, and fully autonomous booking are out of scope.
Bid collection
Every carrier bids in one format
Shipment 104 · 3 bids in 1.4s
Scoring
One rule ranks the bids
60% cost · 40% CO2e
Rationale
Every pick comes with a reason
Why Carrier B
Impact
CO2e saved, per shipment and in total
Versus the cheapest option
Total saved: 200 kg CO2e
Users
The primary user is a logistics coordinator at a small or mid-sized shipper with a sustainability target. They want one request to gather bids from several carriers, rankings that reflect their company's priorities, and a clear reason for each pick. The secondary user is the sustainability lead, who reports CO2e saved versus the cheapest option.
Scoring
Each bid gets a single score from 0 to 1, and the lowest score wins. Price and CO2e are min-max normalized within the current bid set, so a $50 difference and a 10 kg difference become comparable, then combined with the shipper's weights.
- Normalization runs per bid set, so scores only compare bids for the same shipment.
- If every bid has the same value for a field, that field normalizes to 0, which avoids dividing by zero.
- Weights are read at scoring time, so a change on the dashboard applies to the next request without a restart.
- ETA is a hard filter: bids that miss the deadline are excluded before scoring.
Architecture
The React dashboard sends a request with the current weights to a FastAPI backend, which asks every carrier for a bid at once. Bids that miss a 2-second timeout or are missing a field are excluded and logged. Valid bids go to the scoring engine, and the LLM writes a rationale for the top result, falling back to a template if the call fails. The dashboard shows the rationale beside the bid table with Approve and Reject actions.
Agents collect bids, then scoring and the LLM turn them into one pick
Set weights. The dashboard tells the buyer agent how much price, ETA and CO₂e should count.
Success metrics
The MVP succeeds if the full request-to-approval loop runs reliably and shows measurable savings: every carrier responds before the timeout in demo runs, a ranked result with rationale arrives in under 10 seconds, average CO2e saved is positive at a balanced weight, and new weights apply on the very next request.
Risks
The biggest risk is trust: if CO2e numbers or explanations look wrong, shippers fall back to the cheapest bid. CO2e figures are labeled as carrier-reported, the LLM only sees the bid table and weights so it can't invent facts, and raw price and CO2e sit next to every score because min-max can mislead with only a few bids.
Next steps
The core loop works end to end: scoring engine, API, mock carriers with timeout handling, LLM rationale, dashboard, and CI. Next are carrier messaging over Fetch.ai uAgents, weight presets, CSV emissions reports, and real emissions data from Climatiq or GLEC.