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
- app.py - Original version with basic chunking
- app_improved.py - Enhanced version with better prompts
- app_full_context.py - Full paper loading with Gemini’s large context window
- 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
- Go to https://aistudio.google.com/app/apikey
- Click “Create API key”
- Choose “Create API key in new project” (or select existing project)
- Copy the API key
Step 2: Add API Key to Your Space
- Go to your Space settings: https://huggingface.co/spaces/dvdijcke/david-research-assistant/settings
- Scroll down to “Repository secrets”
- Click “New secret”
- Name:
GOOGLE_API_KEY
- Value: Paste your API key
- 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
Option 1: Using UV (Recommended)
- Install UV:
curl -LsSf https://astral.sh/uv/install.sh | sh
- Create virtual environment and install dependencies:
uv venv source .venv/bin/activate # On Windows: .venv\Scripts\activate uv pip install -e .
- Copy environment file and add your API key:
cp .env.example .env # Edit .env and add your GOOGLE_API_KEY
- Run the app:
python app.py
Option 2: Using pip
- Install requirements:
pip install -r requirements.txt
- Run the app:
python app.py
See README_UV_SETUP.md
for detailed UV setup instructions.