An intelligent chatbot application that combines the power of Claude 3 Haiku with real-time web search capabilities, built with FastAPI and React.
Claude Search Assistant is a web-based chatbot that enhances Claude's capabilities with real-time web search functionality using the SERP API. This integration allows the chatbot to provide up-to-date information while maintaining Claude's conversational abilities.
- Real-time Web Search: Integrates SERP API to fetch current information from the internet
- Intelligent Response System: Uses Claude 3.5 Haiku to determine when to use web search vs. model knowledge
- Simple Web Interface: Clean and responsive React-based chat interface
- Session Management: Maintains conversation history within sessions
- Rate Limiting: Built-in protection against excessive API usage
- Real-time Date Display: Shows current date for context awareness
- FastAPI (Python web framework)
- LangChain (For tool integration and chat management)
- Anthropic's Claude 3 Haiku
- SERP API (For web search capabilities)
- AWS Bedrock (For Claude API access)
- React
- Modern CSS with flexbox
- Real-time updates
- Python 3.8+
- Node.js and npm
- AWS account with Bedrock access
- SERP API key
- Anthropic API key
- Navigate to the backend directory:
cd backend/app
- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Create a
.env
file in the backend/app directory with the following variables:
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_key
AWS_DEFAULT_REGION=your_aws_region
SERP_API_KEY=your_serp_api_key
- Start the backend server:
uvicorn main:app --reload
- Navigate to the frontend directory:
cd frontend
- Install dependencies:
npm install
- Create a
.env
file in the frontend directory:
REACT_APP_API_URL=http://localhost:8000
- Start the development server:
npm start
-
Basic Questions
- The chatbot will use Claude's knowledge base for general questions
- Example: "What is the capital of France?"
-
Current Events
- The system will automatically use web search for time-sensitive queries
- Example: "What are the latest developments in AI technology?"
-
Real-time Information
- Perfect for getting up-to-date information
- Example: "What's the weather like in New York right now?"
-
Combined Knowledge
- The system can blend Claude's knowledge with current web data
- Example: "Compare historical and current inflation rates"
- The API is limited to 5 requests per minute per IP address
- Implement appropriate error handling in your applications
- Fork the repository
- Create your feature branch:
git checkout -b feature/YourFeature
- Commit your changes:
git commit -m 'Add YourFeature'
- Push to the branch:
git push origin feature/YourFeature
- Submit a pull request
This project is open-source and available under the MIT License.
- Add support for multiple search engines
- Implement user authentication
- Add support for file uploads and processing
- Enhance error handling and retry mechanisms
- Add support for streaming responses
- Implement conversation summarization
- Add support for multiple language inputs
Common issues and solutions:
-
API Connection Issues
- Verify your environment variables are set correctly
- Check your AWS credentials and permissions
- Ensure SERP API key is valid
-
Rate Limiting
- Implement exponential backoff in your requests
- Consider caching frequent queries
-
Web Search Not Working
- Verify SERP API key and quota
- Check network connectivity
- Review API response logs
For additional support, please open an issue in the GitHub repository.