Inspiration

I often found myself spending hours sifting through academic papers and web articles to gather concise, reliable information—only to lose track of my sources. I wanted a tool that could not only answer complex research questions but also show its reasoning, cite every fact, and suggest further reading. That spark led me to build DeepDive Scholar, an AI-powered research companion that brings transparency and efficiency to the research process.

What I Built

Flask + Gradio frontend: A simple, responsive UI where users enter a topic, adjust creativity (temperature), and provide optional context.

Perplexity Sonar integration: Real-Time Search for authoritative sources and Sonar Reasoning Pro for structured answers with inline citations and chain-of-thought.

Advanced features:

Adjustable depth (# of further-reading links) and temperature sliders

Exportable Markdown reports

User feedback loop with ratings and comments

In-memory caching to reduce redundant API calls

Clear, modular code: Organized into api.py, utils.py, cache.py, and routes.py under an app/ package, with environment-configured API keys and robust error handling.

Challenges & Learnings

Citation parsing: Extracting inline citation markers and converting them into clickable links required careful regex work in utils.extract_references.

UI/UX balance: Shifting from cluttered inputs to a clean 30/70 split and replacing non-existent Gradio components (like gr.Card) taught me the importance of testing early and often.

Transparency: Capturing the AI’s chain-of-thought in ... tags and presenting it in a collapsible section was key to building user trust.

Performance: Implementing a TTL cache (cachetools.TTLCache) cut down on rate-limit issues and dramatically improved responsiveness.

Built with Languages & Frameworks: Python 3.10+, Flask, Gradio

APIs & Services: Perplexity Sonar Real-Time Search & Sonar Reasoning Pro

Libraries: requests, python-dotenv, cachetools

UI/UX: Gradio Blocks, custom CSS

Data Storage: JSON file for feedback persistence

Deployment (optional): Docker, Hugging Face Spaces / Vercel

Built With

  • flask
  • gradio
  • perplexity
  • python
  • real-time
  • reasoning
  • search
  • sonar
Share this project:

Updates