An intelligent AI research assistant powered by DeepSeek and LangGraph that performs multi-step web research with automatic reflection and iteration.
- 🔍 Intelligent Query Generation: Automatically generates optimized search queries based on your research topic
- 🌐 Web Research: Uses Tavily Search API to gather information from multiple sources
- 🤔 Reflection & Iteration: Identifies knowledge gaps and performs follow-up research automatically
- 📊 Real-time Streaming: Watch the research process unfold in real-time
- 🔗 Source Citations: All answers include proper citations with links to sources
- 🎯 Configurable Depth: Choose low, medium, or high effort research modes
This project uses:
- Backend: LangGraph for orchestrating the multi-agent research workflow, DeepSeek for LLM capabilities, Tavily for web search
- Frontend: React 19 with TypeScript, TailwindCSS, and the LangGraph SDK for real-time streaming
- Infrastructure: In-memory state management (PostgreSQL/Redis optional for production)
See ARCHITECTURE.md for detailed workflow documentation.
- Python 3.11+
- Node.js 18+
- uv (Python package manager) - Installation guide
- DeepSeek API Key - Get it here
- Tavily API Key - Get it here
New to this project? Start with QUICKSTART.md for a 5-minute setup guide!
curl -LsSf https://astral.sh/uv/install.sh | sh# Clone the repository
git clone <repo-url>
cd reasearch-chatbotcd backend
# Create virtual environment with uv
uv venv
# Activate the virtual environment
source .venv/bin/activate # On macOS/Linux
# or
.venv\Scripts\activate # On Windows
# Install dependencies
uv pip install -e .
# Create .env file with your API keys
cat > .env << EOF
DEEPSEEK_API_KEY=your_deepseek_api_key_here
TAVILY_API_KEY=your_tavily_api_key_here
LANGSMITH_API_KEY=optional_langsmith_key_for_debugging
EOFImportant: Replace the placeholder values with your actual API keys!
cd ../frontend
# Install dependencies
npm installOption A: Using Make (Easiest)
# From project root
make devOption B: Manual (Two Terminals)
Terminal 1 (Backend):
cd backend
source .venv/bin/activate
langgraph devTerminal 2 (Frontend):
cd frontend
npm run dev- Frontend: http://localhost:5173
- Backend API: http://localhost:2024
- Visit https://platform.deepseek.com/
- Sign up or log in
- Navigate to API Keys section
- Create a new API key
- Copy and paste it into your
.envfile
- Visit https://tavily.com/
- Sign up for a free account
- Go to your dashboard
- Copy your API key
- Paste it into your
.envfile
LangSmith is useful for debugging and monitoring your agent:
- Visit https://smith.langchain.com/
- Sign up or log in
- Create an API key
- Add it to your
.envfile
If you prefer using standard Python tools:
# Backend setup
cd backend
python3 -m venv .venv
source .venv/bin/activate # On macOS/Linux
pip install -e .
# Create .env file (same as above)
# Then run: langgraph dev
# Frontend setup (in new terminal)
cd frontend
npm install
npm run dev# Start both frontend and backend
make dev
# Start only frontend
make dev-frontend
# Start only backend
make dev-backend
# Run tests (backend)
cd backend && pytest
# Lint code
cd backend && ruff check .
cd frontend && npm run lint- Open the application in your browser
- Enter your research question in Chinese or English
- Select the research effort level:
- Low: 1 initial query, max 1 research loop
- Medium: 3 initial queries, max 3 research loops
- High: 5 initial queries, max 10 research loops
- Select the DeepSeek model to use (default: deepseek-chat)
- Click "发送" to start the research
- Watch the agent work through its research process in real-time
- Review the final answer with citations
reasearch-chatbot/
├── backend/
│ ├── src/agent/
│ │ ├── graph.py # Main LangGraph workflow
│ │ ├── state.py # State definitions
│ │ ├── prompts.py # AI prompts (Chinese)
│ │ ├── tools_and_schemas.py # Pydantic schemas
│ │ ├── configuration.py # Agent configuration
│ │ └── app.py # FastAPI app
│ ├── examples/
│ │ └── cli_research.py # CLI example
│ ├── pyproject.toml # Python dependencies
│ └── langgraph.json # LangGraph configuration
├── frontend/
│ ├── src/
│ │ ├── App.tsx # Main React app
│ │ └── components/ # React components
│ ├── package.json # Node dependencies
│ └── vite.config.ts # Vite configuration
├── Makefile # Development commands
└── README.md # This file
# Check what's using the port
lsof -i :2024 # Backend
lsof -i :5173 # Frontend
# Kill the process if needed
kill -9 <PID># Make sure your virtual environment is activated
source backend/.venv/bin/activate
# Reinstall dependencies
cd backend
uv pip install -e .- Verify your API keys are correct in the
.envfile - Make sure there are no extra spaces or quotes around the keys
- Check that the
.envfile is in thebackend/directory
- Ensure backend is running on port 2024
- Check
frontend/src/App.tsxline 25-27 for the correct API URL - In development, it should point to
http://localhost:2024
- Make sure to activate the virtual environment before running backend commands
- If you see import errors, try reinstalling:
uv pip install -e .in the backend directory - Check Python version: requires 3.11 or higher
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
- Built with LangGraph
- Powered by DeepSeek AI
- Search provided by Tavily
- UI components from shadcn/ui
