This guide walks you through setting up the Chase the Source development environment.
| Requirement | Version | Purpose |
|---|---|---|
| Python | 3.11+ | LangGraph requires 3.11+ |
| Docker | 20.10+ | Container deployment |
| Docker Compose | 2.0+ | Local orchestration |
| Git | Any | Version control |
You will need accounts and API keys from:
-
OpenAI - platform.openai.com
- Used for: GPT-5-mini LLM calls
- Billing: Pay-per-use
-
Tavily - tavily.com
- Used for: Web search and source retrieval
- Free tier: 1,000 searches/month
git clone <repository-url>
cd chase_sourcepython3.11 -m venv venv
source venv/bin/activate # Linux/macOS
# OR
venv\Scripts\activate # Windowspip install -r requirements.txtCopy the example environment file:
cp .env.example .envEdit .env with your API keys:
# .env
OPENAI_API_KEY=sk-your-openai-key-here
TAVILY_API_KEY=tvly-your-tavily-key-here
# Optional: Override defaults
OPENAI_MODEL=gpt-5-mini
LOG_LEVEL=INFOpython app.pyThe Gradio interface will be available at http://localhost:7860
docker build -t chase-the-source .docker run -p 7860:7860 \
-e OPENAI_API_KEY=sk-your-key \
-e TAVILY_API_KEY=tvly-your-key \
chase-the-sourceCreate a .env file with your keys, then:
docker compose upFor development with hot reload:
docker compose -f docker-compose.yml -f docker-compose.dev.yml up# Core framework
langgraph>=1.0.5
langchain>=1.2.0
langchain-openai>=1.1.3
# Web search
tavily-python>=0.7.15
# UI
gradio>=6.1.0
# Data validation
pydantic>=2.7.4,<=2.12.4
pydantic-settings>=2.0.0
# Environment management
python-dotenv>=1.2.1
# HTTP client
httpx>=0.28.1
# Development
pytest>=9.0.2
pytest-asyncio>=1.3.0
pytest-cov>=7.0.0
# Type checking (optional)
mypy>=1.19.1
# Required API Keys
OPENAI_API_KEY=sk-your-openai-api-key-here
TAVILY_API_KEY=tvly-your-tavily-api-key-here
# LLM Configuration
OPENAI_MODEL=gpt-5-mini
OPENAI_TEMPERATURE=0.0
OPENAI_MAX_TOKENS=2000
# Tavily Configuration
TAVILY_MAX_RESULTS=10
TAVILY_SEARCH_DEPTH=advanced
# Application Settings
LOG_LEVEL=INFO
GRADIO_SERVER_PORT=7860
GRADIO_SERVER_NAME=0.0.0.0FROM python:3.11-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for better caching
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Expose Gradio port
EXPOSE 7860
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD python -c "import httpx; httpx.get('http://localhost:7860/')" || exit 1
# Run the application
CMD ["python", "app.py"]version: "3.8"
services:
app:
build: .
ports:
- "7860:7860"
env_file:
- .env
environment:
- GRADIO_SERVER_NAME=0.0.0.0
restart: unless-stopped
healthcheck:
test: ["CMD", "python", "-c", "import httpx; httpx.get('http://localhost:7860/')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s# Use with: docker compose -f docker-compose.yml -f docker-compose.dev.yml up
version: "3.8"
services:
app:
build:
context: .
dockerfile: Dockerfile
volumes:
- .:/app
- /app/venv # Exclude venv from mount
environment:
- LOG_LEVEL=DEBUG
- GRADIO_WATCH=true
command: ["python", "-u", "app.py"]After setup, verify your installation:
# Check Python version
python --version # Should be 3.11+
# Verify dependencies
pip list | grep -E "langgraph|gradio|tavily"
# Test API connectivity
python -c "
from openai import OpenAI
from tavily import TavilyClient
import os
# Test OpenAI
client = OpenAI()
print('OpenAI: Connected')
# Test Tavily
tavily = TavilyClient(api_key=os.getenv('TAVILY_API_KEY'))
print('Tavily: Connected')
"| Issue | Solution |
|---|---|
ModuleNotFoundError: langgraph |
Ensure Python 3.11+ and reinstall requirements |
Invalid API key |
Check .env file has correct keys without quotes around values |
Connection refused on 7860 |
Check if another service is using the port |
Docker build fails |
Ensure Docker daemon is running |
- Check the error message against the troubleshooting table
- Verify API keys are valid by testing in the provider's playground
- Ensure all environment variables are set correctly