Inspiration

Procurement managers in the construction and manufacturing sectors spend a significant portion of their day manually calling vendors to check for stock and pricing. It is a repetitive, low-value task that creates bottlenecks.

What it does

PartsHunter is a dashboard that automates vendor phone calls. - Input: The user enters a part name, quantity, and a vendor's phone number into the web interface. - Action: The system deploys a voice AI agent to call the vendor immediately. - Negotiation: The agent follows a specific script to verify stock, negotiate for a lower price, and ask about delivery logistics. Output: Once the call ends, the application automatically transcribes the conversation and extracts key data fields (Unit Price, In Stock status, Delivery Date) into a structured table for the user to review.

How we built it

We built PartsHunter as a full-stack web application: Backend: We used FastAPI (Python) to manage the logic. It handles the API requests to the voice provider and processes the JSON data returned from the calls. AI Voice Layer: We integrated Retell AI for the telephony infrastructure and 11Labs for realistic voice synthesis. We utilized OpenAI's LLMs for the conversational logic and data extraction. Frontend: The dashboard is built with Next.js (React), using Tailwind CSS and Shadcn UI for the component library. State Management: We used local storage to persist call history on the client side without needing a heavy database for the prototype.

Challenges we ran into

Asynchronous Data Handling: Our biggest issue was the "race condition" between the call ending and the transcript generating. The frontend would often try to fetch data before the backend had finished processing the audio, causing 500 errors. We fixed this by implementing a wait-and-retry logic in the Python backend. TypeScript Strictness: Integrating the dynamic JSON response from the Python backend into the strict typing of the Next.js frontend required complex type definitions and careful error handling to prevent the UI from crashing on missing fields. Prompt Engineering: Tweak the system prompt to stop the AI from hallucinating that it had authorized a payment. We had to add strict guardrails to ensure it only asked for prices and never confirmed purchases.

Accomplishments that we're proud of

End-to-End Latency: We achieved a very low latency response time during the calls, making the AI sound responsive rather than laggy. Structured Data Extraction: Successfully converting a messy, unstructured phone conversation into clean JSON data (e.g., turning "Yeah, we got 'em for five bucks" into {"price": 5.00}) was a major win. Seamless UI/UX: The transition from clicking "Launch" to seeing the "Connected" status and then the final results works smoothly without page reloads.

What we learned

Voice AI nuances: We learned that voice agents require very different prompting strategies than text chatbots; they need shorter, punchier sentences to sound natural. FastAPI & Async: We gained a deeper understanding of Python's asyncio and how to manage long-running external API calls within a standard HTTP request/response cycle. Error Handling: We learned the importance of robust error handling when dealing with third-party APIs that might timeout or return unexpected formats.

What's next for PartsHunter

Parallel Calling: Currently, the system handles one call at a time. The next step is allowing users to upload a CSV of 50 vendors and having the AI call them all simultaneously.

Database Integration: Moving from Local Storage to a proper database (like PostgreSQL) to allow multiple users to share a team dashboard.

Payment Integration: Adding a secure "authorize" feature where the AI can send a Stripe payment link via SMS if the vendor agrees to a target price.

Built With

  • 11labs-llm-openai-gpt-4o-apis-rest
  • fastapi
  • frontend-next.js
  • lucide-icons-styling-tailwind-css
  • shadcn-ui-backend-python
  • typescript
  • uvicorn-voice/telco-retell-ai
  • websockets
Share this project:

Updates