REPL Phone Seller

Interactive phone sales system with comprehensive product database and semantic search.

Demonstrates capabilities:

  • E-commerce sales agent with product knowledge
  • Semantic search by product characteristics
  • Shopping basket management
  • Interactive REPL interface for sales
  • Rich Product Database: iPhone, Samsung, Google Pixel and others
  • Semantic Search: Search by any characteristics
  • Diagonal Search: Specialized screen size search
  • Basket Management: Full shopping cart
  • Sales Agent: Professional seller with product expertise
  • Runtime: Bun
  • Language: TypeScript
  • AI Framework: agent-swarm-kit
  • ML: TensorFlow.js for embeddings and search
  • Database: JSON product catalog
  • AI Providers: OpenAI, LMStudio, Ollama
├── data/
│ └── phones.json # Product database
├── src/
│ ├── config/
│ │ ├── openai.ts # OpenAI configuration
│ │ └── setup.ts # System setup
│ ├── logic/
│ │ ├── agent/ # Sales agent
│ │ ├── completion/ # Multiple AI providers
│ │ ├── embedding/ # Nomic embeddings
│ │ ├── storage/ # Phone and basket storage
│ │ ├── swarm/ # Root swarm
│ │ └── tools/ # Search and basket tools
│ ├── main/
│ │ └── repl.ts # REPL interface
│ └── model/ # Data models
└── logs/ # Client session logs
# Install dependencies
bun install

# Start REPL
bun run src/main/repl.ts

Create a .env file:

OPENAI_API_KEY=your_openai_api_key
LMSTUDIO_API_URL=http://localhost:1234
OLLAMA_API_URL=http://localhost:11434

The database contains detailed phone information:

{
"brand": "Apple",
"model": "iPhone 15 Pro",
"price": 999,
"diagonal": 6.1,
"storage": ["128GB", "256GB", "512GB", "1TB"],
"colors": ["Natural Titanium", "Blue", "White", "Black"],
"features": ["A17 Pro chip", "Pro camera system", "Action Button"]
}
  • "Show me iPhones with large screens"
  • "What Samsung phones are under $500?"
  • "Phone with good camera for photos"
  • "Find phones with 6.5 inch diagonal"
  • "What models are bigger than 6 inches?"
  • "Add iPhone 15 Pro to cart"
  • "What's in my cart?"
  • "How much will the whole cart cost?"
  • "Compare iPhone 15 and Samsung Galaxy S24"
  • "What's the difference between Pixel 8 and Pixel 8 Pro?"
  • Natural language understanding
  • Contextual search by characteristics
  • Intelligent recommendations
  • Product knowledge and specifications
  • Price comparisons and recommendations
  • Upselling and cross-selling
  • Smart product suggestions
  • Price optimization recommendations
  • Inventory management

Ideal for:

  • E-commerce platforms
  • Retail sales assistants
  • Product recommendation systems
  • Customer service automation
  • Inventory management

Easy to add:

  • More product categories
  • Payment processing
  • Shipping calculations
  • User accounts and history
  • Review and rating systems