SupplyChainAI: Making Sustainability Accessible for Small Businesses
The Inspiration
My journey with SupplyChainAI began during my summer internship at a local manufacturing company. While helping with inventory management, I overheard a conversation between the operations manager and the CEO about their struggle to measure their environmental impact.
"We want to be more sustainable, but we don't have the resources that big corporations have," the CEO explained. "These enterprise sustainability platforms cost tens of thousands of dollars."
That moment stuck with me. Later that week, I attended a hackathon workshop about AI applications, and I realized: what if I could combine environmental data APIs with generative AI to create affordable sustainability tools for small businesses?
The statistics were eye-opening:
- Small and medium enterprises (SMEs) represent 95% of all businesses worldwide
- They contribute up to 70% of industrial pollution
- Only 13% of SMEs actively measure their carbon footprint
I knew I had found a problem worth solving.
What I Learned
Building SupplyChainAI pushed me far beyond classroom knowledge into real-world applications:
Environmental Science
I started with almost no knowledge about carbon accounting or supply chains. I spent weeks reading GHG Protocol documentation, watching sustainability webinars, and interviewing two environmental consultants who were kind enough to share their expertise.
I learned how to:
- Calculate Scope 1, 2, and 3 emissions according to international standards
- Apply emission factors to different transportation modes and materials
- Understand regulatory frameworks like CSRD and SB 253
AI Implementation
While I had basic experience with machine learning, working with LLMs in a practical application was new territory:
- I experimented with different prompt structures to generate meaningful sustainability recommendations
- I learned how to format complex supply chain data for AI analysis
- I developed techniques to ensure the AI's responses were grounded in the actual data
Full-Stack Development
- Building a reliable API integration layer that could handle service outages
- Creating interactive data visualizations that non-technical users could understand
- Implementing database operations for storing and analyzing supply chain data
How I Built It
Planning Phase
I started by interviewing five small business owners about their sustainability challenges. Their feedback shaped my priorities:
- "Keep it simple – we don't have time for complex tools"
- "Give us actionable steps, not just data"
- "Help us comply with regulations our large customers are imposing on us"
I mapped out the architecture on a whiteboard and created low-fidelity prototypes to validate the concept.
Core Data Processing
I built the foundation of the system:
- Created data models for supply chain components (procurement, logistics, suppliers)
- Implemented the emissions calculation engine using formulas from the GHG Protocol
- Set up API integration with Climatiq for emissions factors
- Built robust error handling and fallback mechanisms for API failures
This stage was challenging because environmental data can be sparse and inconsistent. I had to implement multiple fallback approaches to ensure the system could still provide value even with imperfect data.
AI Integration
Next came the "brain" of the system:
- Researched how to effectively use Claude and GPT for supply chain analysis
- Created specialized prompts for different analysis types (optimization, compliance, risk assessment)
- Built a context management system to provide the AI with relevant supply chain data
- Implemented validation to ensure AI recommendations were realistic and actionable
Dashboard & Visualization
With the backend working, I focused on making the data accessible:
- Built a Streamlit dashboard with intuitive navigation
- Created interactive charts that highlighted the most important insights
- Designed a step-by-step workflow for data upload and analysis
- Added the natural language query interface for non-technical users
Testing & Refinement
I invited three small business owners to test the system:
- Observed their interactions and pain points
- Collected feedback through structured interviews
- Iterated on the UI to address confusion points
- Optimized performance for larger datasets
Challenges I Faced
Technical Hurdles
API Integration Nightmares: The environmental APIs were often unreliable or returned unexpected data. After my third all-nighter debugging API responses, I completely redesigned my integration layer with comprehensive error handling, request retries, and fallback calculations when APIs failed.
JSON Serialization Issues: I hit a major roadblock when trying to pass pandas Timestamp objects to the AI models. The cryptic error "Object of type Timestamp is not JSON serializable" had me stumped for days until I implemented a custom JSON encoder that could handle datetime conversions.
Performance Bottlenecks: My initial implementation calculated emissions sequentially, which became painfully slow with larger datasets. I refactored to use vectorized operations and implemented caching for API responses, which reduced processing time by 85%.
Conceptual Challenges
Balancing Accuracy vs. Usability: There's an inherent tension between precise emissions calculations (which require extensive data) and creating a user-friendly experience. I ultimately designed a tiered approach that starts with simple estimates and allows users to add more detail as available.
Explaining Complex Concepts: Early testers were confused by terms like "Scope 3 emissions" and "emission factors." I redesigned the UI to include contextual explanations and visual guides to make these concepts accessible.
Making AI Recommendations Actionable: Initially, the AI would generate vague suggestions like "reduce transportation emissions." I spent a week refining the prompts to include specific, quantified recommendations with implementation steps.
The Result
The final product exceeded my expectations. SupplyChainAI can now:
- Calculate a company's carbon footprint across their entire supply chain
- Generate tailored optimization strategies with estimated cost and environmental impact
- Assess supplier sustainability risks
- Monitor compliance with environmental regulations
- Answer natural language questions about sustainability
More importantly, it makes these capabilities accessible to small businesses without environmental expertise or big budgets.
This project transformed how I think about technology's role in addressing climate change. While individual actions matter, empowering businesses to make sustainable choices can create impact at scale.
What started as a hackathon idea has become my passion project, and I'm excited to continue developing it with feedback from real-world users.
Built With
- carboninterfaceapi
- claude
- climatiqapi
- epaapi
- github
- gpt-4turbo
- langchain
- matplotlib
- numpy
- pandas
- plotly
- python
- scikit-learn
- sqlalchemy
- streamlit
Log in or sign up for Devpost to join the conversation.