|
1 |
| -# PerplexiCart – AI Powered Value Aligned Shopping Assistant |
2 |
| - |
3 |
| -<p> |
4 |
| - <img src="https://ucarecdn.com/064a61a4-86a3-42e1-a52e-4dd8cbba3adc/perplexicart.jpg" width="40%" /> |
5 |
| - <img src="https://ucarecdn.com/6489c8df-4e6c-48eb-91fd-e4b9b75e7528/perplexicart1.jpg" width="50%" /> |
6 |
| -</p> |
7 |
| - |
8 |
| -**Description** |
9 |
| -PerplexiCart is an AI-powered shopping assistant that helps users make *informed* and *value-aligned* purchasing decisions. Powered by the **Perplexity Sonar API**, it analyzes products across the web and delivers structured insights, including prioritized recommendations, pros/cons, trade-off analysis, and user sentiment — all tailored to the user’s stated preferences (e.g. “Eco-Friendly”, “Made in India”, “Durability”, etc.) and context. |
10 |
| - |
11 |
| -**Key Features & Use Cases** |
12 |
| -- Intelligent product recommendations (beyond simple spec comparison) |
13 |
| -- Priority-based value alignment (Best Value, Eco-Friendly, Ethical, Durability, Made in India) |
14 |
| -- Contextual personalization (e.g. skin type, usage patterns, region) |
15 |
| -- Structured research output: |
16 |
| - - Research summary |
17 |
| - - Top product recommendations |
18 |
| - - Value alignment & reasoning |
19 |
| - - Pros / Cons |
20 |
| - - Key specifications |
21 |
| - - User sentiment & community insights (Reddit, Quora, etc.) |
22 |
| - - Trade-off analysis |
23 |
| - - General buying tips |
24 |
| - |
25 |
| -**🔗 Live Demo** |
26 |
| -https://perplexicart.vercel.app/ |
27 |
| - |
28 |
| -**📂 GitHub Repository** |
29 |
| -https://github.com/fizakhan90/perplexicart |
30 |
| - |
31 |
| -**How the Sonar API Is Used** |
32 |
| -PerplexiCart integrates the **Perplexity Sonar API** as its core intelligence engine: |
33 |
| - |
34 |
| -- **Dynamic prompt engineering** — Prompts are customized based on the user’s search query, selected priority, and optional context. |
35 |
| -- **Structured JSON responses** — We enforce a strict JSON schema via the `response_format` parameter to ensure consistent structured output. |
36 |
| -- **Live web research** — The API is instructed to search e-commerce platforms, forums (Reddit, Quora), review blogs, and sustainability reports. |
37 |
| -- **Semantic analysis** — Extracts product alignment, pros/cons, user sentiment, and cites relevant sources for transparency. |
38 |
| -- **Frontend delivery** — The FastAPI backend parses the structured response and serves it to the Next.js frontend for a clean, user-friendly display. |
| 1 | +--- |
| 2 | +title: PerplexiCart | AI-Powered Value-Aligned Shopping Assistant |
| 3 | +description: An AI shopping assistant that uses Perplexity Sonar to deliver structured research, value-aligned recommendations, and transparent citations across the web |
| 4 | +sidebar_position: 24 |
| 5 | +keywords: [PerplexiCart, shopping, e-commerce, recommendations, value alignment, Sonar, Perplexity, Next.js, FastAPI] |
| 6 | +--- |
39 | 7 |
|
| 8 | +**PerplexiCart** helps users make informed, value-aligned purchasing decisions. Powered by the **Perplexity Sonar API**, it analyzes products across the web and returns structured insights with prioritized recommendations, pros/cons, trade‑off analysis, and user sentiment — tailored to preferences like Eco‑Friendly, Durability, Ethical, and region‑specific needs. |
| 9 | + |
| 10 | +<iframe |
| 11 | + className="w-full aspect-video rounded-xl" |
| 12 | + src="https://www.youtube.com/embed/5qzbRas0rxc" |
| 13 | + title="YouTube video player" |
| 14 | + frameBorder="0" |
| 15 | + allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" |
| 16 | + allowFullScreen |
| 17 | +></iframe> |
| 18 | + |
| 19 | +## Features |
| 20 | + |
| 21 | +* **Intelligent Product Recommendations** beyond simple spec comparison |
| 22 | +* **Priority-Based Value Alignment** (Best Value, Eco‑Friendly, Ethical, Durability, Made in India) |
| 23 | +* **Contextual Personalization** (skin type, usage patterns, region, etc.) |
| 24 | +* **Structured Research Output** with: |
| 25 | + - Research summary and top recommendations |
| 26 | + - Value alignment with reasoning |
| 27 | + - Pros/Cons and key specifications |
| 28 | + - User sentiment and community insights (Reddit, Quora) |
| 29 | + - Trade‑off analysis and buying tips |
| 30 | +* **Transparent Sources** with citations for verification |
| 31 | + |
| 32 | +## Prerequisites |
| 33 | + |
| 34 | +* Node.js 18+ and npm/yarn |
| 35 | +* Python 3.10+ and pip |
| 36 | +* Perplexity API key |
| 37 | + |
| 38 | +## Installation |
| 39 | + |
| 40 | +```bash |
| 41 | +# Clone the repository |
| 42 | +git clone https://github.com/fizakhan90/perplexicart.git |
| 43 | +cd perplexicart |
| 44 | + |
| 45 | +# Backend (FastAPI) setup |
| 46 | +cd backend |
| 47 | +python -m venv .venv |
| 48 | +source .venv/bin/activate # Windows: .venv\Scripts\activate |
| 49 | +pip install -r requirements.txt |
| 50 | + |
| 51 | +# Frontend (Next.js) setup |
| 52 | +cd ../frontend |
| 53 | +npm install |
| 54 | +``` |
| 55 | + |
| 56 | +## Configuration |
| 57 | + |
| 58 | +Create a `.env` file in the backend directory: |
| 59 | +```ini |
| 60 | +PERPLEXITY_API_KEY=your_perplexity_api_key |
| 61 | +``` |
| 62 | + |
| 63 | +(Optional) Add any app‑specific settings as needed (cache, region defaults, etc.). |
| 64 | + |
| 65 | +## Usage |
| 66 | + |
| 67 | +1. **Start Backend (FastAPI)**: |
| 68 | + ```bash |
| 69 | + cd backend |
| 70 | + uvicorn main:app --reload # adapt module:app if your entrypoint differs |
| 71 | + ``` |
| 72 | + |
| 73 | +2. **Start Frontend (Next.js)**: |
| 74 | + ```bash |
| 75 | + cd frontend |
| 76 | + npm run dev |
| 77 | + ``` |
| 78 | + |
| 79 | +3. **Open the App**: Visit `http://localhost:3000` and search for a product. Select your priority (e.g., Eco‑Friendly) and add optional context (skin type, region). |
| 80 | + |
| 81 | +## Code Explanation |
| 82 | + |
| 83 | +* **Backend (FastAPI)**: Orchestrates Sonar calls with dynamic prompt engineering based on query, selected priority, and context |
| 84 | +* **Structured Outputs**: Enforces a strict JSON schema via `response_format` to ensure consistent UI rendering |
| 85 | +* **Live Web Research**: Directs Sonar to search e‑commerce platforms, forums, review blogs, and sustainability reports |
| 86 | +* **Semantic Analysis**: Extracts value alignment, pros/cons, sentiment, and cites sources for transparency |
| 87 | +* **Frontend (Next.js/React)**: Presents a clear, user‑friendly view of recommendations, trade‑offs, and citations |
| 88 | + |
| 89 | +## How the Sonar API Is Used |
| 90 | + |
| 91 | +PerplexiCart leverages the **Perplexity Sonar API** as its intelligence core, dynamically generating customized prompts based on user inputs like search queries, priorities and context. The API performs comprehensive web research across e-commerce sites, forums, and review platforms, with responses structured in a consistent JSON format. Through semantic analysis, it extracts key product insights including alignment with user priorities, pros/cons, and sentiment - all backed by cited sources. The FastAPI backend processes these structured responses before serving them to the Next.js frontend for a polished user experience. |
| 92 | + |
| 93 | +## Links |
| 94 | + |
| 95 | +- **Live Demo**: https://perplexicart.vercel.app/ |
| 96 | +- **GitHub Repository**: https://github.com/fizakhan90/perplexicart |
0 commit comments