TrendPulse Dashboard

TrendPulse Dashboard is a real-time, customizable web application that empowers users to track evolving topics of interest. Leveraging the Perplexity Sonar API suite, users can define topic streams, receive recency-filtered updates, view concise AI-generated summaries with citations, and interactively ask follow-up questions—all within a dynamic dashboard interface featuring a modern, Perplexity-inspired UI.

DEMO: https://www.youtube.com/watch?v=4ev8Qoidxz4

Core Features

Topic Stream Management

  • Create and manage personalized topic streams for any subject or query
  • Customize update frequency (hourly, daily, weekly)
  • Configure detail level (brief, detailed, comprehensive) - backend dynamically adjusts max_tokens for Perplexity API based on this selection.
  • Select from multiple Perplexity models (e.g., sonar, sonar-pro, sonar-reasoning, sonar-reasoning-pro, sonar-deep-research)
  • Set recency filters for time-sensitive information
  • Topic Selection Sources:
    • Google Trends integration for real-time trending topics
    • Social media hashtag tracking (Twitter/X, Instagram)
    • Custom keyword monitoring
    • Category-based topic suggestions
    • Trending news topics by region
    • Industry-specific trend monitoring

Real-time Updates

  • Automated background updates based on configured frequency
  • AI-powered summarization with transparent source citations
  • Support for multiple Sonar models, including sonar (fast, cost-effective) and sonar-pro (deeper, more citations), with sonar-deep-research for highly detailed topic streams.
  • History of updates per topic stream
  • Optional notifications for new updates
  • Implemented <think> tag masking in Markdown rendering, allowing AI "thoughts" to be initially hidden and expandable by the user.

Interactive Features

  • Deep-dive Q&A functionality for each topic stream
    • User-selectable AI models for tailoring chat responses (e.g., sonar, sonar-pro, sonar-reasoning, sonar-reasoning-pro, sonar-deep-research) - backend uses extended timeouts for sonar-deep-research.
  • Follow-up questions with context-aware responses
  • Source citation and verification
  • Markdown-formatted content with syntax highlighting
  • Dark mode support

View Modes

  • Dashboard View: Traditional widget-based layout for topic streams. Features include title truncation for long queries with full query on hover, and refined card styling for clarity.
  • Newspaper View (In Progress):
    • Significant groundwork laid for grid-based layout inspired by traditional newspaper design, including card styling and responsive grid considerations.
    • Headline-style summaries with featured images (planned)

Sonar Models Used in TrendPulse

TrendPulse leverages a suite of Perplexity Sonar API models to provide diverse functionalities:

  • Topic Stream Summaries:

    • sonar: Used for generating concise, cost-effective summaries with real-time web search and citations. Ideal for frequent updates.
    • sonar-pro: Available for users seeking more in-depth summaries with a higher number of citations, leveraging its advanced information retrieval architecture.
    • sonar-deep-research: For comprehensive and highly detailed summaries, utilizing its exhaustive web research capabilities, extended token limits, and processing time.
  • Deep Dive / Chat (Follow-up Q&A):

    • Users can select from the following models to tailor the chat experience:
    • sonar: For quick follow-up questions that may benefit from fast, fresh web searches based on the initial summary's context.
    • sonar-pro: For more complex follow-up questions requiring deeper information retrieval and more extensive source citations from the web.
    • sonar-reasoning (Default): Excellent for multi-step reasoning, where the AI needs to "think" through a question based on the summary and potentially new search data. Provides Chain-of-Thought (CoT) responses and performs real-time web searches.
    • sonar-reasoning-pro: A premier reasoning model for highly complex follow-ups, offering enhanced CoT, more citations, and performs real-time web searches.
    • sonar-deep-research: Leverages its capability for exhaustive web research across hundreds of sources, a longer context window, and extended processing time. Ideal for in-depth exploration of topics, detailed analysis, and comprehensive answers that require synthesizing vast amounts of online information. Backend uses an extended timeout for this model.
    • This flexibility allows users to choose the best model for their specific follow-up query needs, balancing speed, depth, reasoning capability, and cost.

Technical Architecture

Frontend

  • React-based single-page application
  • TailwindCSS for responsive, utility-first styling
  • React Router for navigation
  • Context API for state management
  • Markdown rendering with syntax highlighting (including <think> tag masking)
  • Responsive design for all device sizes

Backend

  • FastAPI Python backend
  • SQLite database with SQLAlchemy ORM
  • JWT-based authentication
  • Background task scheduling (dynamic max_tokens and timeouts for Perplexity API calls)
  • Perplexity API integration
  • CORS middleware for cross-origin requests

Context Handling for Stream Updates

  • Prompting Strategy: When updating topic streams, the system uses specialized prompts that explicitly request only new information since the last update.
  • Recency Filtering: Utilizes Perplexity's search_recency_filter parameter to limit search results to the appropriate timeframe (hourly, daily, weekly).
  • Context Management:
    • Previous summaries are stored in the database with timestamps
    • When requesting updates, the system includes the timestamp of the last update in the prompt
    • The prompt instructs the model to focus exclusively on developments that occurred after the previous update
    • The system explicitly asks the model to avoid repeating information already covered in previous summaries
  • Incremental Updates:
    • Each new summary represents only the delta of information since the last check
    • If no new relevant information is available, the system returns a clear "no updates" message rather than repeating old content
    • The <think> tag feature allows the model to reason through what information is truly new without exposing this reasoning in the main content
  • Prompt Engineering: Carefully crafted system prompts include specific instructions like "Focus only on information published since [timestamp]" and "Do not repeat information from previous summaries"

Data Models

  • User authentication and management
  • Topic streams with customizable settings
  • Summaries with source citations
  • Update history tracking

API Integration

Perplexity API Features

  • Real-time web search capabilities (including exhaustive research for sonar-deep-research)
  • Recency-filtered results
  • Source citation and verification
  • Multiple model options for different use cases
  • Context-aware follow-up questions

Endpoints

  • User authentication (login/register)
  • Topic stream CRUD operations
  • Summary generation and retrieval
  • Deep-dive Q&A functionality
  • Background update scheduling
Share this project:

Updates