CodeRED: Orion — Bringing Zero-UI Automation to the Deskless Economy
About the Project
Over $80\%$ of the global workforce does not sit at a desk. These independent electricians, mobile mechanics, HVAC technicians, and local logistics operators run the physical world, yet $99\%$ of enterprise AI software is built for knowledge workers sitting behind laptops.
The inspiration for OrionSync came from a glaring market gap: the "deskless" economy is experiencing extreme app-fatigue. Micro-businesses rely entirely on messy WhatsApp threads, paper receipts, and voice memos to manage operations. We realized that asking them to log into another specialized SaaS dashboard or download a new app was a losing battle.
So, we decided to bring high-end AI orchestration to the interfaces they already use. OrionSync is an AI project manager and dispatcher that lives entirely within standard SMS and WhatsApp. It is a "Zero-UI" operations center.
What We Learned
Building for a Zero-UI environment completely shifts the design paradigm. We learned that:
- Latency is the enemy of trust: When an interface is purely conversational, users expect near-instant responses. A 10-second delay on a webhook can feel like an eternity to a worker in the field.
- Unstructured input is the default: Deskless workers don't speak in clean JSON schemas. They send fragmented voice notes with heavy background noise. The real value is in the system's ability to extract structured intent from chaotic inputs.
How We Built It
We engineered a robust, service-oriented architecture designed to handle unpredictable field inputs without breaking.
The Core Architecture Stack
- The Interface (Ingress/Egress): We utilized Twilio's Sandbox for WhatsApp as our primary gateway, setting up webhooks to ingest incoming text and media.
- The Brain (Extraction): We integrated the Groq API for its ultra-low latency.
- Whisper (via Groq): Used to instantly transcribe noisy field audio into text.
Llama 3.1 70B (via Groq): Leveraged for strict JSON Schema extraction. This component parses the transcribed text to identify specific intents (e.g.,
dispatch_unit,order_parts) and extracts critical entities like client names, monetary values, and locations using Pydantic models.The Orchestrator (Backend): The core logic is built on Python with FastAPI.
Decoupled Processing: To avoid Twilio's strict 15-second timeout, we used FastAPI's
BackgroundTasksto instantly acknowledge webhook payloads (202 Accepted) while processing the heavy AI extraction asynchronously.Adapter Pattern: All external services (Twilio, Groq, Stripe) are wrapped in isolated adapters. This allows the core business logic (in
services/jobs.py) to remain clean, testable, and insulated from third-party API failures.State & Persistence: We utilized a PostgreSQL database (Supabase) connected via SQLAlchemy 2.0 with the
asyncpgdriver to ensure high-concurrency database calls never block the main event loop.Action Execution: Depending on the extracted intent, the orchestrator triggers external APIs. For example, it integrates with the Stripe Checkout API to generate direct payment links on the fly, which are then formatted and sent back to the worker via Twilio.
The Challenges We Faced
- Webhook Timeouts: The biggest technical hurdle was managing Twilio's aggressive timeout policies while waiting for LLM inference and API calls to complete. We overcame this by implementing an asynchronous handoff mechanism, immediately returning a blank XML response to Twilio while executing the core logic in a background worker thread.
- Strict Data Formatting: Getting the LLM to consistently return valid, structured data instead of conversational text was difficult. We solved this by transitioning to Groq's JSON Schema structured outputs, forcing the model to strictly adhere to our Pydantic definitions.
- Authentication and Media Handling: Downloading media (like voice notes) from Twilio securely required proper basic authentication and managing redirect loops, which required careful implementation in our API adapter.
Built With
- artificial-intelligence
- asyncpg
- backend
- fastapi
- github-actions
- groq
- json-schema
- large-language-models
- llama-3.1
- machine-learning
- ngrok
- postgresql
- pydantic
- pytest
- python
- sqlalchemy
- stripe
- supabase
- twilio
- uvicorn
- webhooks
- whatsapp-api
- whisper
Log in or sign up for Devpost to join the conversation.