π Procurement AI Assistant
π Firebase Studio Enterprise Vibe Coding Hackathon Winner 2025
Part of Google Cloud Sweden Region Launch
Empowering retail buyers with AI-powered semantic search for intelligent procurement decisions.
π― Overview
Procurement AI Assistant transforms how retail buyers make purchasing decisions by providing instant, intelligent insights through natural language search. Instead of waiting days for engineering teams to provide data, buyers can now ask questions like "Show me sustainable dresses under $50 with reliable suppliers" and get actionable results in seconds.
β¨ Key Features
- π£οΈ Natural Language Search - Query using plain English
- β‘ Instant Results - Sub-3-second response times
- π Smart Analytics - Supplier reliability, profit margins, return rates
- π― Dual Purpose - Serves both procurement and marketing teams
- π Vector Search - Powered by advanced semantic understanding
ποΈ Architecture
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Frontend β β Backend API β β Vector DB β
β (Firebase/ β β β β β
Streamlit) βββββΊβ (Cloud Run) βββββΊβ (Qdrant) β
β β β Superlinked β β β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
Tech Stack
- Backend: Python 3.11, Superlinked Framework, FastAPI
- Frontend: Next.js + TypeScript (Production) | Streamlit (Local Development)
- AI/ML: OpenAI GPT-4, Sentence Transformers, Vector Search
- Database: Qdrant Vector Database
- Infrastructure: Google Cloud Run, Firebase Hosting
- Data: Product catalog with enriched supplier metrics (Google Analytics 4 BigQuery dataset)
π Prerequisites
- Python 3.11+
- Node.js 18+ (for production frontend)
- Streamlit (for local development)
- Google Cloud Platform account
- OpenAI API key
- Qdrant Cloud account (optional, uses in-memory by default)
π οΈ Installation
Backend Setup
-
Clone the repository
git clone https://github.com/yourusername/procurement-ai-assistant.git cd procurement-ai-assistant -
Install dependencies
pip install -r requirements.txt # or with uv (recommended) uv sync -
Configure environment variables
cp .env.example .env # Edit .env with your API keys and configuration -
Start the server
# Development make start-superlinked-server # Or directly uv run python -m superlinked.server
Quick Start with Streamlit (Local Development)
For rapid local development and testing:
-
Start the backend (follow steps 1-4 above)
-
Run Streamlit frontend
streamlit run st_app/app.py -
Access the app
- Streamlit UI:
http://localhost:8501 - Backend API:
http://localhost:8080
- Streamlit UI:
Production Frontend Setup (Next.js)
-
Navigate to frontend directory
cd frontend -
Install dependencies
npm install -
Configure environment
cp .env.local.example .env.local # Add your backend API endpoint -
Start development server
npm run dev
π Deployment
Deploy Backend to Google Cloud Run
-
Enable required APIs
gcloud services enable run.googleapis.com cloudbuild.googleapis.com -
Deploy using the provided script
chmod +x deploy.sh ./deploy.shOr manually:
gcloud run deploy procurement-api \ --source . \ --platform managed \ --region europe-north2 \ --allow-unauthenticated \ --memory 8Gi \ --cpu 4 \ --set-env-vars="ENVIRONMENT=production"
Deploy Frontend to Firebase
-
Install Firebase CLI
npm install -g firebase-tools -
Initialize and deploy
firebase init hosting npm run build firebase deploy
π Usage Examples
Basic Search Queries
# Cost-optimized products
curl -X POST "https://your-api-url/api/v1/search/procurement_query" \
-H "Content-Type: application/json" \
-d '{"natural_query": "products with cost less than 5 dollars", "limit": 5}'
# High-margin, reliable suppliers
curl -X POST "https://your-api-url/api/v1/search/procurement_query" \
-H "Content-Type: application/json" \
-d '{"natural_query": "dresses with low cost and high revenue", "limit": 10}'
π§ Configuration
Environment Variables
| Variable | Description | Default |
|---|---|---|
OPENAI_API_KEY |
OpenAI API key for natural language processing | Required |
QDRANT_URL |
Qdrant vector database URL | localhost:6333 |
QDRANT_API_KEY |
Qdrant API key | Optional |
DATA_PATH |
Path to product CSV data | ./data/csv/products_enriched.csv |
USE_QDRANT_VECTOR_DB |
Use Qdrant vs in-memory database | false |
CHUNK_SIZE |
Data processing chunk size | 10 |
Data Schema
The system expects CSV data with the following columns:
product_id,name,category,brand,department,cost,retail_price,profit_margin_percent,
total_orders,return_rate_percent,supplier_reliability_score,avg_sale_price,
total_revenue,daily_sales_rate,days_since_creation,total_items_sold
π§ͺ Testing
Backend Tests
# Load test data
make load-data
# Test basic search
make test-search
# Test category-specific search
make test-category-search
Streamlit Development
# Quick test with Streamlit interface
streamlit run streamlit_app.py
π€ Contributing
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
- Superlinked for the semantic search framework
- Google Cloud for hosting infrastructure
- Codento for organizing the hackathon
Built with β€οΈ by Amir
Transform your procurement process from reactive to predictive with AI-powered intelligence.