How widgets work
When you ask a question, Perplexica’s classifier determines if any widgets are relevant:- Classification: The AI analyzes your query to detect widget triggers
- Parallel execution: Relevant widgets run alongside the main research
- Instant display: Widget results appear immediately in the UI
- Context for AI: Widget data is provided to the AI as additional context
Widgets run in parallel with research, so they don’t slow down your search results.
Available widgets
Weather
Current conditions and forecasts
Calculations
Mathematical expressions and equations
Stocks
Real-time stock prices and charts
Weather widget
The weather widget provides current conditions and forecasts when you ask about weather. Example queries:- “What’s the weather in New York?”
- “Will it rain tomorrow in London?”
- “Show me the forecast for Tokyo”
- Current temperature and conditions
- Humidity, precipitation, and wind data
- Hourly forecast for the next 24 hours
- 7-day daily forecast
- Weather codes for conditions (sunny, rainy, etc.)
- OpenStreetMap Nominatim: Converts location names to coordinates
- Open-Meteo: Fetches weather data and forecasts
- City names: “weather in Paris”
- City with state/country: “weather in Austin, Texas”
- Abbreviated forms: “weather in NYC” (automatically expands to New York City)
- Coordinates: The widget can also work with latitude/longitude
Calculation widget
The calculation widget solves mathematical expressions instantly using the Math.js library. Example queries:- “Calculate 15% of 2,450”
- “What is the square root of 144?”
- “Solve 3x + 5 = 20”
- “Convert 100 USD to EUR at 1.18 exchange rate”
- Basic arithmetic: addition, subtraction, multiplication, division
- Advanced math: exponents, roots, logarithms
- Trigonometry: sin, cos, tan, and their inverses
- Units and conversions
- Complex expressions with multiple operations
The AI extracts the mathematical expression from your natural language query and evaluates it. If no valid expression can be extracted, the widget won’t appear.
Stock widget
The stock widget displays real-time stock prices, charts, and financial metrics. Example queries:- “Apple stock price”
- “How is NVDA performing?”
- “Compare Microsoft and Google stock”
- “Show me Tesla stock chart”
- Price & Changes
- Charts
- Fundamentals
- Trading
- Current market price
- Daily change (absolute and percentage)
- Pre-market and post-market prices
- Previous close, open, high, low
- Market state (open, closed, pre-market, post-market)
yahoo-finance2 library, providing real-time quotes and historical data.
You can use either stock names (“Apple”, “Microsoft”) or ticker symbols (“AAPL”, “MSFT”). The widget will find the correct stock automatically.
- “Compare Nvidia, AMD, and Intel stock”
- “How do tech giants compare: Apple vs Microsoft vs Google”
Widget classification
The classifier determines which widgets to show based on your query:shouldExecute method that checks if it’s been enabled:
Widget data in AI context
Widgets provide context to the AI to improve answer quality:- Weather: Current conditions included in the AI’s context
- Calculations: Result provided so the AI can explain it
- Stocks: Price and key metrics available for the AI to reference
“The current price of Apple (AAPL) is $182.45, up 2.3% today. The stock has shown strong momentum…”
Upcoming widgets
Perplexica is actively developing additional widgets:- More specialized widgets for common queries
- Integration with additional data sources
- Custom widget support