Skip to content

Sbcoit/DOHackathon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

ShadowBid - Multi-Agent Negotiation Platform

A dark, minimalistic eBay-style negotiation platform with a hybrid AI agent architecture for automated multi-listing negotiations.

Architecture

  • Frontend: Next.js 14 with TypeScript, Tailwind CSS, Framer Motion
  • Backend: FastAPI (Python) with SQLite database
  • AI Agents:
    • Gradient AI Agent: Reasoning and decision-making (via DigitalOcean Gradient AI Platform)
    • Repo Agent (Groq-powered): Action execution and orchestration
    • Gemini Sellers: AI-powered sellers in the mini eBay clone

Features

  • 🔍 Search for items across multiple listings
  • 🤖 Multi-agent negotiation system
  • 💬 Organized conversation logs per listing
  • 🧠 Agent reasoning visualization
  • ✅ Approve/Reject workflow
  • 🎨 Dark, minimalistic UI with distinctive typography
  • ⚡ Real-time negotiation updates

Setup

Prerequisites

  • Python 3.9+
  • Node.js 18+
  • API Keys:
    • DigitalOcean Gradient AI Platform (endpoint + access key)
    • Groq API key
    • Google Gemini API key

Backend Setup

  1. Navigate to the project root:
cd /path/to/DOHackathon
  1. Create a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Create .env file:
cp .env.example .env
  1. Edit .env with your API keys:
GRADIENT_AGENT_ENDPOINT=https://<your-agent-name>.agents.do-ai.run/api/v1/
GRADIENT_AGENT_ACCESS_KEY=<your-access-key>
GROQ_API_KEY=<your-groq-api-key>
GEMINI_API_KEY=<your-gemini-api-key>
DATABASE_URL=sqlite:///./db/database.db
  1. Initialize the database:
mkdir -p backend/db
python -c "from backend.models.database import init_db; from backend.config import settings; init_db(settings.database_url)"
  1. Run the backend (from project root):
cd /path/to/DOHackathon
uvicorn backend.main:app --reload --port 8000

Frontend Setup

  1. Navigate to frontend directory:
cd frontend
  1. Install dependencies:
npm install
  1. Create .env.local file:
NEXT_PUBLIC_API_URL=http://localhost:8000
  1. Run the development server:
npm run dev
  1. Open http://localhost:3000

Usage

  1. Search for Items: Enter a search query (e.g., "iPhone 15", "MacBook Pro", "AirPods Pro")
  2. Select Listings: Click on listings you want agents to negotiate
  3. Start Negotiation: Click "Send Agents to Negotiate"
  4. Monitor Progress: Watch real-time conversation logs and agent reasoning
  5. Review Best Deal: When negotiation completes, review the selected best deal
  6. Approve/Reject: Approve the deal or reject it

Demo Items

The platform comes with demo listings for:

  • iPhone 15 Pro Max 256GB
  • MacBook Pro 14-inch M3
  • AirPods Pro (2nd Generation)

Each item has 2-3 listings with different seller personalities (friendly, flexible, stubborn).

Project Structure

/
├── backend/
│   ├── agents/
│   │   ├── gradient_agent.py    # Gradient AI agent integration
│   │   └── repo_agent.py        # Groq-powered execution agent
│   ├── api/
│   │   ├── main.py              # Main platform API routes
│   │   └── mini_ebay.py         # Mini eBay clone routes
│   ├── models/
│   │   ├── database.py          # SQLAlchemy models
│   │   └── schemas.py           # Pydantic schemas
│   ├── services/
│   │   ├── negotiation.py       # Negotiation orchestration
│   │   ├── conversation.py      # Conversation management
│   │   └── approval.py          # Approval workflow
│   ├── db/
│   │   └── database.db          # SQLite database
│   └── main.py                  # FastAPI app
├── frontend/
│   ├── app/
│   │   ├── layout.tsx
│   │   ├── page.tsx
│   │   └── globals.css
│   ├── components/
│   │   ├── SearchBar.tsx
│   │   ├── ListingsPanel.tsx
│   │   ├── ConversationPanel.tsx
│   │   ├── ReasoningPanel.tsx
│   │   └── ApprovalModal.tsx
│   └── lib/
│       └── api.ts               # API client
└── requirements.txt

API Endpoints

Main Platform

  • POST /api/search - Search for items
  • POST /api/negotiate/start - Start negotiation
  • GET /api/negotiations/{id} - Get negotiation status
  • POST /api/negotiations/{id}/approve - Approve/reject deal

Mini eBay Clone

  • GET /api/mini-ebay/listings/search - Search listings
  • GET /api/mini-ebay/listings/{id} - Get listing details
  • POST /api/mini-ebay/listings/{id}/offer - Submit offer to seller
  • GET /api/mini-ebay/listings/{id}/conversation - Get conversation history

Development Notes

  • The negotiation loop runs asynchronously in the background
  • Frontend polls for negotiation updates every 2 seconds
  • All agent reasoning and decisions are logged to the database
  • Sellers have different personalities that affect their negotiation behavior

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors