Content
# Slate Auto Analytics API
FastAPI and React application for analyzing Slate Auto's electric pickup truck using LLM agents and vector databases. This tool provides insights on customer feedback, market reception, and competitor analysis.
## Features
- **User Researcher Agent**: Analyzes Reddit and Google Reviews for customer feedback and pain points
- **Market Analyst Agent**: Assesses market reception using Perplexity Deep Research data
- **Competitor Analyst Agent**: Compares Slate Auto to competitors using both data sources
- **Strategic Advisor Agent**: Provides actionable recommendations and implementation timelines
- **Orchestrator Agent**: Routes queries to appropriate agent(s) and aggregates responses
- **Comprehensive Report Generation**: Creates full analysis with strategic recommendations
- **Modern Chat Interface**: Clean React frontend with real-time chat capabilities
## System Requirements
- Python 3.10+
- Node.js 16+
- npm or yarn
- OpenAI API key
- Pinecone API key (with two existing indexes: 'reddit-reviews' and 'perplexity-research')
## Setup Instructions
### Backend Setup
1. Create a virtual environment:
```bash
python -m venv venv
```
2. Activate the virtual environment:
- On macOS/Linux:
```bash
source venv/bin/activate
```
- On Windows:
```bash
venv\Scripts\activate
```
3. Install backend dependencies:
```bash
pip install -r requirements.txt
```
4. Set up environment variables:
- Copy `.env-example` to `.env`
- Add your OpenAI and Pinecone API keys:
```
OPENAI_API_KEY=your-openai-key
PINECONE_API_KEY=your-pinecone-key
```
### Pinecone Setup
The application requires two Pinecone indexes with embeddings:
1. `reddit-reviews`: Contains Reddit posts and Google Reviews
2. `perplexity-research`: Contains Perplexity Deep Research data
To initialize these indexes with sample data (for testing):
```bash
python import_data.py
```
Note: This will create the indexes if they don't exist and populate them with sample data.
### Running the Backend
Start the FastAPI server:
```bash
python app.py
```
The API will be available at `http://localhost:8000`
### Frontend Setup
1. Navigate to the frontend directory:
```bash
cd frontend
```
2. Install frontend dependencies:
```bash
npm install
```
3. Create a `.env` file in the frontend directory:
```
REACT_APP_API_URL=http://localhost:8000
```
4. Start the frontend development server:
```bash
npm start
```
The frontend will be available at `http://localhost:3000`
## Using the Application
### Basic Queries
Ask specific questions about:
- Customer feedback and pain points
- Market trends and opportunities
- Competitor analysis and differentiation
### Generating Comprehensive Reports
You can generate comprehensive reports with actionable recommendations in two ways:
1. Click the "Generate Report" button in the UI
2. Ask questions like "Give me a report with recommendations" or "What strategic actions should Slate Auto take?"
These reports include:
- Customer feedback analysis
- Market trend analysis
- Competitor analysis
- Executive summary
- Prioritized action items
- Implementation timeline
## API Endpoints
- `GET /`: Health check endpoint
- `POST /chat`: Submit queries for analysis
- Request Body:
```json
{
"query": "What are the pain points for Slate Auto's truck?",
"history": [], // Optional chat history
"generate_report": false // Set to true to explicitly request a full report
}
```
- Response:
```json
{
"response": "Based on analysis of customer feedback..."
}
```
## Project Structure
```
slate-auto-analytics/
├── app.py # FastAPI backend
├── import_data.py # Script to initialize Pinecone
├── requirements.txt # Backend dependencies
├── .env-example # Example environment variables
├── README.md # This file
└── frontend/ # React frontend
├── package.json # Frontend dependencies
├── public/ # Static assets
└── src/ # Frontend source code
├── components/ # React components
├── api/ # API clients
└── App.tsx # Main application
```
Connection Info
You Might Also Like
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
markitdown
Python tool for converting files and office documents to Markdown.
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
rust-docs-mcp
An MCP server for accessing Rust crate documentation and insights.
mcp-todoist
An MCP server connecting Claude with Todoist for task management.
facebook-mcp-server
Automate Facebook Page management with MCP server using Graph API.