Procurement shouldnβt be a spreadsheet marathon. Swerve turns inventory, orders, and supplier data into fast, agent-guided decisions.
- What is Swerve?
- The Problem
- The Solution
- Traction & Awards
- π Current Project Overview
- π₯ Demo Video
- π€ AI-Assisted Automation Workflows
- π§ LangChain Agents (What We Actually Built)
- Accuracy and Guardrails
- Data Handling and Security
- π οΈ Tech Stack at a Glance
- π§± System Architecture (High Level)
- π₯ Core Features
- ποΈ Firebase Database Schema
- π§ͺ Getting Started (Dev)
- π Project Structure
- Contributing
- License
Swerve is an agentic AI co-pilot for industrial procurement and inventory operations, built as a comprehensive Voltway electric scooter procurement management system.
It helps teams:
- manage parts inventory
- track purchase orders
- analyze sales signals
- monitor supplier reliability
- automate low-stock and reordering workflows
Swerve is designed for operational realismβnot just βchat with your database.β It combines dashboard-first visibility with LangChain-powered agents that can reason over inventory and supply constraints and produce actionable, auditable recommendations.
Procurement teams face a familiar grind:
- inventory data is fragmented
- stock checks are manual
- reorder timing is inconsistent
- supplier reliability is hard to quantify quickly
- notifications arrive late (or not at all)
Even in smaller industrial settings, these gaps create:
- preventable downtime
- over-ordering or under-ordering
- long lead-time surprises
- reactive rather than proactive planning
Enter Swerve.
A unified procurement workspace that couples:
- Operational dashboards (inventory, sales, suppliers, orders)
- Automation triggers (low stock, blocked parts, lead-time risk)
- AI-assisted workflows that guide decision-making step-by-step
The result is a system that reduces human overhead while preserving operator control.
- 1st Place β Dryft AI Challenge @ HackTech 2025 (Caltechβs hackathon)
- Built as the Swerve β Voltway Procurement Management System
- Post-hackathon, we were flown out by the Dryft team to their San Francisco Neo offices for continued collaboration (Neo-funded).
Winner Image
In-office Collaboration
-
Objective: Build an AI-assisted procurement control center that helps operations teams plan, order, and maintain parts inventory with higher confidence and lower effort.
-
Scope: A realistic inventory + order + supplier system for Voltway electric scooters, with automation and analytics layered on top of Firestore-backed operational data.
-
What makes it different: Swerve doesnβt just show dataβit turns data into decisions using agentic workflows.
A short walkthrough of the Swerve dashboard, inventory logic, and AI-guided procurement flows.
Swerve uses LangChain-powered agents to automate repetitive procurement analysis while keeping decisions grounded in real operational data.
-
Inventory Health Automation
- Detects low stock, blocked parts, and min-stock violations.
- Flags parts with high downstream impact via BOM relationships.
-
Order Risk Automation
- Tracks late-risk using expected vs actual delivery patterns.
- Highlights parts whose delays would stall high-volume models.
-
Supplier Reliability Automation
- Ranks suppliers by reliability rating, lead time, and price signals.
- Suggests fallback suppliers when risk increases.
-
Demand-Aware Reorder Suggestions
- Connects recent sales trends to projected consumption.
- Recommends reorder quantity and timing aligned to reorder intervals.
-
Slack Insight Automation
- Converts key changes (low stock, delivery slippage, supplier risk) into concise team alerts.
YesβSwerve used agents.
We integrated LangChain to orchestrate tool-using agents that can:
- retrieve live operational data
- reason across multiple collections
- generate structured recommendations
- trigger notifications
- produce procurement-ready summaries
LangChain gave us a clean, modular way to:
- define tools (Firestore reads, analytics helpers, alert builders)
- chain reasoning steps across inventory + supplier + order signals
- maintain structured outputs that fit a real ops workflow
Swerveβs procurement copilot is designed around a simple idea:
You ask a procurement question β the system routes the task β a specialist agent pulls the right data β you get an actionable answer.
Hereβs the lifecycle:
-
Engineer or ops user asks a question
- Example: βAre we at risk of running out of P301 next week?β
- Or: βWhich supplier is least reliable for motor assemblies?β
-
A coordinator model identifies intent
- It determines whether this is primarily inventory risk, order tracking, supplier reliability, or sales-driven demand.
-
The request is routed to a specialized LangChain agent
- Inventory Agent
- Orders Agent
- Supplier Agent
- Sales/Forecast Agent
- Notifications Agent (e.g., Slack summaries)
-
That agent retrieves only task-relevant context
-
Instead of loading the whole database, it queries just whatβs needed:
- part metadata, stock + min-stock,
- open orders + lead times,
- supplier reliability,
- recent sales linked to impacted models.
-
-
The agent uses tools to compute + explain
- The output is grounded in Firestore records and structured rules.
-
Swerve returns a recommendation
- Clear next steps, supporting numbers, and assumptions when needed.
This makes Swerve automation-first without being a black box.
Agents let us:
- constrain tool access by role
- keep context narrow and relevant
- isolate logic per domain
- make the system easier to extend with new workflows.
Swerve is designed for operations-grade reliability, not generic chat.
We improve accuracy through:
-
Tool-grounded answers
- Agents retrieve live, structured Firestore data rather than relying on memory.
-
Scoped context
- Each agent only loads the records required for the current task.
-
Rule + data validation
-
Reorder suggestions check against:
min_stock,blockedstatus,- lead time constraints,
- BOM dependencies.
-
-
Structured outputs
- Responses are shaped into consistent formats (risk summary β evidence β recommended next action).
-
Graceful fallback
- When data is incomplete, Swerve surfaces assumptions explicitly and suggests what to verify next (e.g., missing orders or outdated supplier ratings).
Swerve follows a least-privilege, operational-data-first approach:
-
Firestore as source of truth
- Orders, parts, sales, and supplier metrics are stored with role-based access.
-
Secure auth
- Access is gated through Firebase Authentication.
-
Isolated file handling
- Any imported datasets or attachments are stored in Firebase Storage with scoped permissions tied to user roles.
-
Minimal AI data exposure
- Agents pass only the task-relevant fields to the model (not entire collections or raw dumps).
-
Audit-friendly design
- Recommendations can be traced back to part records, orders, supplier stats, and sales documents.
- React.js
- React Router
- Tailwind CSS
- Recharts
- Lucide React
- MapLibre GL
- Python
- Flask
- Firebase Admin SDK
- LangChain β agent orchestration and tool routing
- Hugo AI β custom procurement assistant layer
- Slack Integration β automation-ready alerts and summaries
- Firebase Firestore
- Firebase Authentication
- Firebase Storage
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β OPERATIONS UI β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β’ Procurement Dashboard β
β β’ Parts + BOM Explorer β
β β’ Orders & Delivery Tracking β
β β’ Supplier Reliability & Map β
β β’ AI Assistant Panel β
βββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββ
β REACT FRONTEND β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β’ Charts, alerts, and workflow views β
β β’ Role-aware UX with Firebase Auth β
β β’ Calls Flask endpoints for analytics + AI β
βββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββ
β FLASK BACKEND β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β’ Inventory + order APIs β
β β’ Supplier analysis β
β β’ LangChain agent runtime + tool registry β
β β’ Slack notification triggers β
βββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββ
β FIREBASE DATA LAYER β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β’ Firestore: parts, orders, sales, supply β
β β’ Storage: imports, assets β
β β’ Auth: ops roles β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Overview of key metrics
- Low stock alerts
- Inventory status visualization
- Sales charts
- Supplier reliability analysis
- Recent orders table
- View scooter models and their components
- Track parts inventory for each model
- Monitor stock levels and restock urgency
- Track individual parts inventory
- View part details and specifications
- Monitor stock levels
- Track purchase orders
- Monitor delivery status
- View order history
- Interactive global map
- Visualize suppliers and warehouses
- Track shipment routes
- AI-powered procurement assistant
- Get insights on inventory status
- Analyze supply chain data
- Optimize procurement processes
- Import parts, orders, and sales data
- Automatic database updates
- AI-powered analysis after import
- AI-generated parts status updates
- Low stock alerts
- Integration with Slack for team notifications
firestore/
βββ orders/{order_id} # e.g. orders/O5001
β βββ {order_id}
β β βββ order_date: string
β β βββ expected_delivery_date: string
β β βββ actual_delivered_at: string
β β βββ part_id: string # FK β parts/{part_id}
β β βββ supplier_id: string # FK β supply/{supply_id}
β β βββ quantity_ordered: number
β β βββ status: string # "pending" | "ordered" | "delivered"
β
βββ parts/{part_id} # e.g. parts/P301
β βββ {part_id}
β β βββ part_name: string
β β βββ part_type: string # "assembly" | "component"
β β βββ location: string
β β βββ stock_level: number
β β βββ min_stock: number
β β βββ blocked: boolean
β β βββ comments: string
β β βββ weight: number | null
β β βββ successor_part: string | null
β β βββ used_in_models: string[] # e.g. ["S1_V1","S2_V1"]
β β βββ reorder_interval_days: number
β β βββ reorder_quantity: number
β β βββ bill_of_materials: array # list of maps
β β β βββ [0]
β β β β βββ Part_ID: string
β β β β βββ Part_Name: string
β β β β βββ Qty: number
β β β β βββ Notes: string
β β β βββ [1] { β¦ }
β β β βββ β¦
β β βββ requirements: string[] # e.g. ["Torque motor mounting β¦", "Run battery BMS β¦"]
β
βββ sales/{sale_id} # e.g. sales/S6000
β βββ {sale_id}
β β βββ created_at: string
β β βββ accepted_request_date: string
β β βββ requested_date: string
β β βββ model: string
β β βββ version: string
β β βββ order_type: string # "webshop" | "retail"
β β βββ quantity: number
β
βββ supply/{supply_id} # e.g. supply/SupA_P301
βββ {supply_id}
β βββ price_per_unit: number
β βββ lead_time_days: number
β βββ min_order_qty: number
β βββ reliability_rating: number
- Node.js (v16+)
- npm or yarn
- Python (v3.8+)
- Firebase account
-
Clone the repository
git clone https://github.com/your-username/voltway-procurement.git cd voltway-procurement -
Install dependencies
npm install
-
Create a
.envfile in the root directory with your Firebase configurationNEXT_PUBLIC_FIREBASE_API_KEY=your_api_key NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_auth_domain NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_storage_bucket NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id
-
Navigate to the backend directory
cd backend -
Create a virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Create a
firebase-credentials.jsonfile with your Firebase service account credentials
Frontend
npm run devThe frontend will be available at http://localhost:3000.
Backend
python app.pyThe backend API will be available at http://localhost:5000.
voltway-procurement/
βββ src/
β βββ components/ # Reusable UI components
β βββ pages/ # Page components
β βββ services/ # API and service functions
β βββ hooks/ # Custom React hooks
β βββ firebase.js # Firebase configuration
β βββ App.jsx # Main application component
βββ backend/
β βββ app.py # Flask application
β βββ routes/ # API routes
β βββ services/ # Backend services
βββ public/ # Static assets
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details. """




