A full-stack AI-powered research assistant that orchestrates multiple specialized agents for comprehensive web research, code execution, summarization, and verification.
- Backend: FastAPI + Uvicorn (Python 3.11)
- Frontend: Flask + Vanilla JavaScript
- AI Framework: Pydantic-AI
- Tool Server: FastMCP
- Search: Tavily API
- LLM: OpenAI API
- Docker and Docker Compose
- API Keys:
-
Clone the repository
git clone <your-repo-url> cd deep_research
-
Set up environment variables
cp .env.example .env # Edit .env and add your API keys -
Run with Docker Compose
docker-compose up --build
-
Access the application
- Frontend: http://localhost:5000
- API: http://localhost:8000
- API Docs: http://localhost:8000/docs
-
Install dependencies
pip install -r requirements.txt
Optional browser support:
pip install playwright playwright install chromium
-
Run the services
# Terminal 1 - FastMCP research hub ./start_mcp.sh # Terminal 2 - Backend API uvicorn main:app --reload --port 8000 # Terminal 3 - Frontend python app.py
The default Docker setup runs four services:
postgresredismcponhttp://localhost:9000/mcpdevfor Flask + FastAPI on ports3000and8000
Start everything with:
docker-compose up --buildHealth checks:
- App API:
http://localhost:8000/health - MCP hub:
http://localhost:9000/health
The current migration target is a single research agent running on gpt-5.4 with:
- FastMCP tools for search, fetch, browse, verification, and compaction
- Reusable project skills under
skills/ - Explicit compacted research memory stored alongside conversation metadata
- Optional Playwright-backed browser access with HTTP fallback when Playwright is unavailable
- MCP-backed execution when
MCP_SERVER_URLis set; local tool fallback otherwise
Relevant paths:
api/research/- single-agent research flow and shared tool servicesmcp_servers/research_hub/- FastMCP tool serverskills/- reusable workflow skills
# Build the image
docker build -t deep-research:latest .
# Run the container
docker run -p 5000:5000 -p 8000:8000 \
-e TAVILY_API_KEY=your_key \
-e OPENAI_API_KEY=your_key \
deep-research:latest-
Install flyctl
curl -L https://fly.io/install.sh | sh -
Login and create app
fly auth login fly launch
-
Set secrets
fly secrets set TAVILY_API_KEY=your_tavily_key fly secrets set OPENAI_API_KEY=your_openai_key
-
Deploy
fly deploy
-
Create a new Web Service on Render Dashboard
-
Connect your GitHub repository
-
Configure the service:
- Environment: Docker
- Branch: main
- Docker Command: (leave default)
- Add Environment Variables:
TAVILY_API_KEYOPENAI_API_KEY
-
Deploy - Render will automatically build and deploy from your Dockerfile
The repository includes a GitHub Actions workflow that automatically builds and pushes Docker images to GitHub Container Registry (GHCR) when code is pushed to main or develop branches.
# Pull the latest image
docker pull ghcr.io/<your-username>/deep_research:latest
# Run the image
docker run -p 5000:5000 -p 8000:8000 \
-e TAVILY_API_KEY=your_key \
-e OPENAI_API_KEY=your_key \
ghcr.io/<your-username>/deep_research:latestThe workflow runs on:
- Push to
main: Builds withlatesttag (production) - Push to
develop: Builds withdeveloptag (staging) - Pull Requests: Builds for testing (no push)
deep_research/
├── api/ # Backend modules
│ ├── orchestrator/ # Main orchestration agent
│ ├── web_search/ # Web search functionality
│ ├── code_executor/ # Code execution agent
│ ├── summarizer/ # Summary generation
│ └── verification/ # Verification agent
├── static/ # Frontend assets
│ ├── css/
│ ├── js/
│ └── img/
├── templates/ # HTML templates
├── main.py # FastAPI backend
├── app.py # Flask frontend
├── Dockerfile # Docker configuration
├── docker-compose.yml # Multi-container setup
└── requirements.txt # Python dependencies
- main branch: Production deployments
- develop branch: Integration branch for features
- Feature branches: Use
feat/<feature_name>naming convention
| Variable | Description | Required |
|---|---|---|
TAVILY_API_KEY |
Tavily web search API key | Yes |
OPENAI_API_KEY |
OpenAI API key for LLM | Yes |
FLASK_ENV |
Flask environment (development/production) | No |
API_URL |
Backend API URL for frontend | No |
- Create a feature branch:
git checkout -b feat/your-feature - Make your changes and commit
- Push to your branch:
git push origin feat/your-feature - Create a Pull Request to
developbranch
[Add your license here]