An AI-powered research assistant that combines natural language processing with real-time web scraping to provide comprehensive, research-backed answers to your questions.
- Natural Language Queries - Ask questions in plain English
- Intelligent Search Detection - Automatically determines when web search is needed
- Real-Time Web Scraping - Fetches current information via BrightData SERP API
- Self-Hosted LLM - Uses Nosana's decentralized GPU infrastructure for AI inference
- Beautiful Response Formatting - Renders markdown with tables, links, and rich formatting
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ React Frontend │────▶│ FastAPI Backend │────▶│ Nosana LLM │
│ (Vite + TS) │ │ (Python) │ │ (Ollama API) │
└─────────────────┘ └────────┬─────────┘ └─────────────────┘
│
▼
┌─────────────────┐
│ BrightData │
│ (Web Search) │
└─────────────────┘
- FastAPI - Python web framework
- httpx - Async HTTP client
- Pydantic - Data validation
- React 19 - UI framework
- TypeScript - Type safety
- Vite - Build tool
- react-markdown - Markdown rendering with GFM support
- Nosana - Decentralized GPU compute for LLM inference
- BrightData - Web scraping and SERP API
- Python 3.10+
- Node.js 18+
- Nosana endpoint URL
- BrightData API token
-
Clone the repository
git clone <repository-url> cd deep_research_agent
-
Install all dependencies
make install
Or install separately:
# Backend cd services/backend && pip3 install -r requirements.txt # Frontend cd services/frontend && npm install
-
Configure environment variables
Create a
.envfile inservices/backend/:NOSANA_OLLAMA_URL=your-nosana-endpoint-here NOSANA_MODEL=gpt-oss:20b BRIGHTDATA_API_TOKEN=your-brightdata-token-here PORT=8000
Start both services:
make devOr run them separately:
Backend (runs on http://localhost:8000):
make dev-backendFrontend (runs on http://localhost:5173):
make dev-frontend| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Health check - returns API status |
/health |
GET | Health check endpoint |
/api/query |
POST | Submit a query for research |
POST /api/query
{
"query": "What are the latest developments in AI?"
}{
"answer": "Based on my research, here are the latest developments..."
}- Query Analysis - The LLM determines if the question requires real-time web data
- Search Query Extraction - Extracts optimal search terms from the user's question
- Web Scraping - BrightData fetches Google search results in real-time
- Answer Generation - The LLM synthesizes search results into a comprehensive answer
deep_research_agent/
├── services/
│ ├── backend/
│ │ ├── main.py # FastAPI application entry point
│ │ ├── agent.py # WebSearchAgent orchestration logic
│ │ ├── llm.py # Nosana LLM client (OpenAI-compatible)
│ │ ├── scraper.py # BrightData web scraping client
│ │ ├── requirements.txt # Python dependencies
│ │ └── .env.example # Environment template
│ └── frontend/
│ ├── src/
│ │ ├── App.tsx # Main React component
│ │ └── App.css # Styling with markdown support
│ ├── package.json # Node dependencies
│ └── vite.config.ts # Vite configuration
├── Makefile # Development commands
└── README.md # This file
| Variable | Description | Required |
|---|---|---|
NOSANA_OLLAMA_URL |
Nosana GPU endpoint URL | Yes |
NOSANA_MODEL |
Model name (default: gpt-oss:20b) |
No |
BRIGHTDATA_API_TOKEN |
BrightData API authentication token | Yes |
PORT |
Backend server port (default: 8000) | No |
ISC