Inspiration
During my internship at the Institute of Chartered Accountants of Zimbabwe, I watched procurement teams lose days to email chains and spreadsheets. A laptop order for the engineering team could sit in someone's inbox for a week before anyone even started checking budget. Everyone knew the process was broken. Nobody had time to fix it because they were too busy running it manually.
The real cost wasn't just time. It was money. Organizations lose 5 to 10% of annual procurement spend to inefficiencies, maverick buying, and delayed approvals. In Zimbabwe alone, that's millions of dollars flowing through broken processes every year.
The Qwen Cloud hackathon was the excuse I needed to build what that internship made obvious: an AI agent that runs procurement end to end, not one that just answers questions about it.
What it does
Tell Procurely "I need 10 laptops for the engineering team under $15K" and it does the work a procurement officer would do manually:
- Checks the request against company policy
- Searches the catalog and outside suppliers for options
- Drafts a purchase requisition with a full audit trail
- Routes it for approval based on the amount
- Generates the purchase order
- Emails the vendor
- Negotiates with the vendor using market research
- Research suppliers and add them if not in database
Architecture
The system is built on three layers:
- Frontend: React 19, Vite, ReactFlow for the workflow designer
- Backend: Express.js with streaming SSE for real-time agent responses
- AI Core: 11 Qwen Cloud models, each optimized for a specific job
How we built it
- Frontend: React 19, Vite, Tailwind CSS, shadcn/ui, ReactFlow for the workflow designer
- Backend: Express.js, streaming responses over SSE with tool-calling loops
Qwen Cloud built-in tools
Procurely uses Qwen Cloud's native tool-calling capabilities, not just text generation, but real-world actions the agent can take:
| Built-in tool | What it does |
|---|---|
web_search |
Searches the web for vendor and pricing information |
web_search_image |
Finds product images for catalog matching |
text-embedding-v4 |
Embeds documents for retrieval |
qwen3-rerank |
Reranks search results for precision |
enable_search |
Turns on search grounding for a given turn |
The agent doesn't just generate text. It searches the web, finds product images, embeds documents, and reranks results using Qwen's built-in capabilities, all within a single conversation turn.
Models used
qwen3.7-plus: main agent with 30+ procurement toolsqwen3.5-plus: web search, image search, vision OCR, vendor negotiationqwen3.6-flash: specialist sub-agents (risk, bid, compliance)qwen3.5-omni-flash: speech-to-text for voice procurementtext-embedding-v4: document and query vectorizationqwen3-rerank: cross-attention reranking for RAG precision
Infrastructure
- Vector search: Zvec (by Alibaba Cloud), HNSW-indexed in-process vector store for sub-second semantic search
- Database: Firebase Firestore for real-time sync
- Email: Resend with React Email templates for POs, approvals, and RFQs
- Hosting: Alibaba Cloud Simple Application Server with Docker Compose and Nginx reverse proxy
Challenges we ran into
Multi-model orchestration was harder than expected. Running 11 models in one pipeline meant every request had to route to the right model without burning tokens on the wrong one. That took real architecture, not just an if/else chain. We built a phase-based tool restriction system that programmatically limits which tools the model can access at each stage of the procurement flow.
The workflow designer was the harder problem. Drawing nodes on a canvas is easy. Making each node execute real procurement logic, actual approvals, actual routing, actual condition evaluation, is not. We rebuilt the execution engine twice before it held up. The first version couldn't handle multi-level approval chains. The second couldn't evaluate conditions against real requisition data.
Email nearly took us down. Resend needed DNS records verified through Cloudflare, and DKIM, SPF, and DMARC all had to line up before a single email would deliver. We spent a full day debugging why emails went to spam.
Streaming agent responses over SSE while handling tool calls mid-stream meant the connection could break at the exact moment the agent needed to act. We had to implement a custom NDJSON protocol with tool start and tool result events to keep the UI in sync.
Web search latency was a surprise. Qwen's web search API takes 50+ seconds per query. We tested every model variant, flash, plus, max, and found that only the larger models reliably support the web_search tool in the Responses API. We ended up with a hybrid approach: flash for fast tasks, plus for web search, max for complex reasoning.
Accomplishments that we're proud of
We shipped an agent that runs a real procurement decision from request to purchase order, live, on infrastructure we deployed ourselves. Not a demo that only works for the happy path.
The policy enforcement system is something we're particularly proud of. Knowledge base policies are injected into the system prompt as mandatory rules. The agent refuses non-compliant requests and cites the specific policy clause by name. No other procurement tool does this.
The RAG pipeline with Zvec and qwen3-rerank gives us sub-second semantic search over uploaded documents. Users can upload their procurement policies, and the agent automatically references them when answering questions.
What we learned
Multi-model orchestration is a scheduling problem as much as an AI problem. A visual workflow tool is only as good as the execution engine hiding behind it. Email deliverability, DKIM, SPF, DMARC, is genuinely harder to get right than any part of the AI.
The real gap isn't between "no AI" and "AI demo." It's between "AI demo" and "AI that runs a business process end to end." That gap is bigger than it looks, and it's the one worth closing.
What's next for Procurely
- Deeper policy awareness in the risk, bid, and compliance sub-agents
- Multi-org, multi-currency procurement so Procurely can run for teams beyond a single company
- Reducing latency between responses is a core priority. We're exploring context caching and prompt optimization
- Invoice OCR using Qwen's vision capabilities for automated invoice processing
- Supplier portal for vendors to submit bids and track RFQ status
Built With
- qwen-cloud: 11 AI models for chat, search, embeddings, reranking, voice, and vision
- react: Frontend UI
- firebase: Auth and Firestore
- resend: Transactional email
- alibaba-cloud: Hosting
- nginx: Reverse proxy
- cloudflare: DNS and SSL
Log in or sign up for Devpost to join the conversation.