How raghavaalajangi/pricepilot-ai works
PricePilot AI is a pricing decision-support application: users select a product and market, inspect sales KPIs and price-demand/profit estimates, then request a grounded AI recommendation with reviewer checks. The graph follows the documented frontend-to-REST workflow through pricing services, data/model layers, and the sequential agent pipeline. The README describes CSV/Postgres data sources, caching, guardrails, and streaming; their precise internal wiring is not fully present in the sampled source, so uncertain edges are omitted.
Main entry points: routes.py REST routes · agent_analysis.py Agent analysis service · pricing.py Pricing services · Dashboard.tsx Product dashboard
Components 20
Dashboard UI
- Product dashboard
frontend/components/Dashboard.tsx - Agent panel
frontend/components/AgentPanel.tsx - Typed API client
frontend/lib/api.ts - Pricing visualizations
frontend/components/ElasticitySection.tsx
Backend API
- REST routes
backend/app/api/routes.py - FastAPI application
backend/app/main.py - Validated API schemas
backend/app/schemas.py
Pricing Analysis
- Pricing services
backend/app/services/pricing.py
Agent Analysis
- Agent analysis service
backend/app/services/agent_analysis.py - Analyst strategist reviewer
backend/app/agents/graph.py - Agent prompts
backend/app/agents/prompts.py - Structured LLM client
backend/app/agents/llm_client.py - Output guardrails
backend/app/guardrails.py
Data And Models
- Sales data source
backend/app/data_source.py - Sales dataset
- Elasticity estimator
backend/app/ml/elasticity.py - Trained model weights
backend/app/ml/elasticity.py - TTL result cache
backend/app/cache.py
Other components
- Pricing team
- OpenAI chat model
Connections 23
- Pricing team → Product dashboard: selects product
- Product dashboard → Typed API client: requests data
- Agent panel → Typed API client: streams analysis
- Typed API client → REST routes: REST requests
- REST routes → Pricing services: calls pricing
- Pricing services → Sales data source: reads sales
- Sales data source → Sales dataset: loads rows
- Pricing services → Elasticity estimator: fits or loads
- Elasticity estimator → Trained model weights: loads bundles
- Pricing services → REST routes: returns results
- REST routes → Agent analysis service: starts analysis
- Agent analysis service → Pricing services: builds analysis payload
- Agent analysis service → TTL result cache: reads and writes
- Agent analysis service → Analyst strategist reviewer: runs workflow
- Analyst strategist reviewer → Agent prompts: uses prompts
- Analyst strategist reviewer → Structured LLM client: requests structured output
- Structured LLM client → OpenAI chat model: invokes model
- Agent analysis service → Output guardrails: checks output
- Agent analysis service → REST routes: returns or streams
- REST routes → Validated API schemas: validates payloads
- REST routes → FastAPI application: registered by
- Product dashboard → Pricing visualizations: renders results
- Agent panel → Pricing team: shows recommendation