David Van Dijcke Research Assistant

David Van Dijcke - Econometric Research Assistant

An AI-powered assistant specializing in David Van Dijcke’s econometric research. David is an econometrician on the 2025-26 job market who develops novel methods for functional and high-dimensional data.

Available Versions

  1. app.py - Original version with basic chunking
  2. app_improved.py - Enhanced version with better prompts
  3. app_full_context.py - Full paper loading with Gemini’s large context window
  4. app_optimized.py - Smart retrieval with section extraction and caching

Features

  • Econometric Methods Focus: Detailed information about David’s methodological contributions
  • Job Market Paper (R3D): Regression Discontinuity Design with Distribution-Valued Outcomes
  • Technical Expertise: Functional data analysis, optimal transport, and geometric measure theory
  • Policy Applications: How David applies econometric tools to answer questions with big data
  • Research Portfolio: Information on FDR, DISCO, RTO, and other papers

New Improvements

  • Full Paper Loading: Reads complete PDFs instead of just first few pages
  • Large Context Window: Leverages Gemini 2.0 Flash’s 1M+ token context
  • Smart Retrieval: Query-type based retrieval (technical, overview, application)
  • Section Extraction: Intelligent parsing of paper sections
  • Response Caching: Instant responses for repeated queries
  • Hierarchical Search: Both section-level and chunk-level retrieval

Getting the Best Performance

For high quality, accurate responses at very low cost, use Google’s Gemini 2.5 Flash:

Step 1: Get a Google AI API Key

  1. Go to https://aistudio.google.com/app/apikey
  2. Click “Create API key”
  3. Choose “Create API key in new project” (or select existing project)
  4. Copy the API key

Step 2: Add API Key to Your Space

  1. Go to your Space settings: https://huggingface.co/spaces/dvdijcke/david-research-assistant/settings
  2. Scroll down to “Repository secrets”
  3. Click “New secret”
  4. Name: GOOGLE_API_KEY
  5. Value: Paste your API key
  6. Click “Add secret”

The Space will automatically restart and use Gemini 2.5 Flash for much more accurate responses!

Performance comparison:

  • With Google API: Gemini 2.5 Flash - High accuracy, extremely low cost
  • Without API: Limited mode - Lower quality responses

Note: Gemini is much cheaper than OpenAI (~$0.001-0.005 per conversation) while still providing excellent accuracy.

Deployment

This space is designed to run on Hugging Face Spaces with CPU inference.

Local Development

  1. Install UV:
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
  2. Create virtual environment and install dependencies:
    uv venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
    uv pip install -e .
    
  3. Copy environment file and add your API key:
    cp .env.example .env
    # Edit .env and add your GOOGLE_API_KEY
    
  4. Run the app:
    python app.py
    

Option 2: Using pip

  1. Install requirements:
    pip install -r requirements.txt
    
  2. Run the app:
    python app.py
    

See README_UV_SETUP.md for detailed UV setup instructions.