Skip to content

daria425/polar-search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Polar Search - Iceberg Topic Explorer

Hackathon Submission for the Perplexity Hackathon on Devpost

Live URL

Polar Search is a unique knowledge exploration tool that organizes search results as an interactive "iceberg" visualization. Information is arranged in progressive levels of depth - from surface-level concepts to obscure knowledge - helping users dive deeper into any topic while maintaining context.

Inspiration behind the idea

Inspired by the iceberg meme format, the app structures information into an interactive tierlist, where each tier reveals a deeper, weirder, or more specialized insight — letting users explore subjects like internet mysteries, fringe science

An example iceberg for conspiracy theories

I made Polar Search because I love exploring creepy, weird, or forgotten corners of the internet like conspiracies, urban legends and lost media so I decided to use Sonar to turn this into a tool.

Key Features

  • Interactive Iceberg Visualization: Explore topics through five depth levels (surface, technical, hidden, deep, obscure)
  • Follow-up Research: Drill into any subtopic to reveal additional related information
  • Research Capsules: Generate curated collections of sources and articles for any subtopic
  • Timeline Generation: Create chronological timelines for historical topics

User Flow

%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#4a148c', 'primaryTextColor': '#fff', 'primaryBorderColor': '#6a1b9a', 'lineColor': '#7e57c2', 'secondaryColor': '#1a237e', 'tertiaryColor': '#311b92', 'textColor': '#fff' }}}%%
graph TD
    classDef default fill:#4a148c,stroke:#9575cd,color:#fff
    classDef api fill:#1a237e,stroke:#7986cb,color:#fff,stroke-width:2px
    classDef loading fill:#5e35b1,stroke:#b39ddb,color:#fff,stroke-dasharray: 5 5
    classDef view fill:#3949ab,stroke:#9fa8da,color:#fff
    classDef interaction fill:#6a1b9a,stroke:#ce93d8,color:#fff

    Start[User Opens App] --> FirstSearch[User Enters Topic]
    FirstSearch -->|API Call to Perplexity Sonar| LoadingIceberg[Loading Iceberg View]
    LoadingIceberg -->|Processing Response| IcebergView[Iceberg View Generated]

    IcebergView --> InteractionChoice{User Interaction}

    InteractionChoice -->|Click Learn More| LearnMore[Select Subtopic for Research]
    LearnMore -->|API Call to get Details| LoadingResearch[Loading Research Dialog]
    LoadingResearch --> ResearchView[Research Dialog View]

    InteractionChoice -->|Click Research Sources| ResearchSources[Select Subtopic for Sources]
    ResearchSources -->|API Call for Capsule| LoadingCapsule[Loading Research Capsule]
    LoadingCapsule --> CapsuleView[Research Capsule View]

    InteractionChoice -->|Click Discover Origin| DiscoverOrigin[Select Subtopic for Timeline]
    DiscoverOrigin -->|API Call for Timeline| LoadingTimeline[Loading Timeline Data]
    LoadingTimeline --> TimelineView[Timeline View]
    InteractionChoice -->|Enter New Topic| FirstSearch


    BackToIceberg --> InteractionChoice

    subgraph "API Calls"
    APICall1[Initial Sonar Search]:::api
    APICall2[Detailed Research]:::api
    APICall3[Research Capsule]:::api
    APICall4[Timeline Generation]:::api
    end

    class LoadingIceberg,LoadingResearch,LoadingCapsule,LoadingTimeline loading;
    class IcebergView,ResearchView,CapsuleView,TimelineView view;
    class InteractionChoice,LearnMore,ResearchSources,DiscoverOrigin interaction;
Loading

Architecture

  • Frontend: React.js & MUI
  • Backend: Python with FastAPI

Usage of Sonar API

Full implementation can be found in the sonar_search.py module

Polar Search uses the following models:

  • sonar to perform initial research and clustering on obscure or niche content.

  • sonar-reasoning-pro to retrieve information from less common sources and find interesting articles and references.

  • sonar-reasoning-pro to perform deeper research on topics and create detailed explanations

  • sonar-reasoning-pro to perform research on the origins and history of a topic

Getting Started

Prerequisites

  • Node.js (v16+) for the client
  • Python (v3.9+) for the API
  • MongoDB (optional, for storing search results)

API Setup

  1. Navigate to the API directory:
    cd api
  2. Create a virtual environment
    python -m venv .virtualenv
    source .virtualenv/bin/activate  # On Windows: .virtualenv\Scripts\activate
  3. Install dependencies
    pip install -r requirements.txt
  4. Create a .env file in the API directory by copying .env.example and add your API keys
    cp .env.example .env
  5. Start the API server using make run or uvicorn app.main:app --reload

Client Setup

  1. Open a new terminal and navigate to the client directory:
    cd client
  2. Install dependencies
    npm install
  3. Start the development server:
    npm run dev

Deployment

The API is configured for deployment to Google Cloud App Engine and the client is configured for deployment to Firebase Hosting