AAN
An experimental LLM-powered agent that discovers deals and negotiates prices with sellers autonomously.
- Stars
- 7
- Language
- Python
- Updated
Autonomous AI Negotiator (AAN)
An AI-powered system that discovers deals across online marketplaces and autonomously negotiates with sellers to get the best price.
Features
- Multi-Platform Search: Aggregate listings from Dubizzle, OLX, Facebook Marketplace, Noon, and Amazon.ae
- Adaptive Negotiation: AI agents adapt to seller behavior (low anchor, bundle, fair value strategies)
- Intelligent Scoring: Weighted ranking by price, condition, location, negotiability, and recency
- Parallel Threads: Negotiate with 10+ sellers simultaneously
- Auto-Close: Automatically accept when a deal hits your target
- Outcome Learning: System learns from every negotiation
Tech Stack
Backend
- Framework: FastAPI
- Task Queue: Celery with Redis
- Database: PostgreSQL (async with SQLAlchemy)
- AI: LiteLLM (GPT-4o, Claude)
- Scraping: Playwright with stealth mode
Frontend
- Vue 3 + Vite
- React Native (Mobile)
Infrastructure
- Docker + Docker Compose
- Railway (Deployment)
Project Structure
AAN/
├── services/
│ ├── api/ # FastAPI REST API
│ │ ├── main.py # App entry point
│ │ └── routes/ # API endpoints
│ └── worker/ # Celery workers
│ ├── scrapers/ # Platform scrapers
│ ├── negotiation/ # AI negotiation agents
│ └── tasks/ # Background tasks
├── config/
│ ├── core/ # Settings
│ ├── database/ # Models & schemas
│ └── scrapers/ # Platform configs
├── tests/
│ ├── unit/ # Unit tests (31 tests)
│ └── integration/ # API tests
├── frontend/ # Vue.js landing page
└── mobile/ # React Native app
Quick Setup
Prerequisites
- Python 3.11+
- Docker & Docker Compose
- Node.js 20+ (for frontend)
Installation
- Clone the repository:
git clone https://github.com/Manavarya09/AAN.git
cd AAN
- Install Python dependencies:
pip install -e ".[dev]"
- Copy environment file:
cp .env.example .env
- Start with Docker Compose:
docker-compose up -d
Development Server
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
Frontend: http://localhost:5173
Running Tests
# Run all tests
pytest tests/ -v
# Run with coverage
pytest tests/ --cov=config --cov=services --cov-report=term-missing
Running Linting
ruff check config/ services/
mypy config/ services/ --ignore-missing-imports
API Endpoints
GET /- API infoGET /health- Health check (includes DB status)GET /docs- Swagger documentationGET /metrics- Prometheus metricsPOST /api/v1/jobs- Create negotiation jobGET /api/v1/jobs- List jobsGET /api/v1/listings- Get normalized listingsGET /api/v1/analytics- Analytics data
Contributing
- Create a feature branch
- Make changes and add tests
- Run linting and tests
- Submit a pull request
License
MIT License - see LICENSE file for details
Support
For issues and questions, please open a GitHub issue.