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 - Legacy full-context version
  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 GLM 5.2’s 1M-token context window
  • 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

The assistant calls GLM 5.2 through OpenRouter using the OpenAI Python client. You only need one OpenRouter API key.

Step 1: Get an OpenRouter API Key

  1. Go to https://openrouter.ai/keys
  2. Create a new key and copy it

Step 2: Add the 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: OPENROUTER_API_KEY
  5. Value: Paste your API key
  6. Click “Add secret”

The Space will automatically restart and use GLM 5.2.

To use a different model, set an optional LLM_MODEL secret to any OpenRouter model id (default: z-ai/glm-5.2).

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 OPENROUTER_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.# Trigger rebuild Tue Aug 12 02:25:19 EDT 2025