An interactive AI assistant that combines web search and natural language processing. This project uses Google Custom Search API to retrieve search results and AWS Bedrock’s LLaMA model to generate contextual responses. The application is built with Python and Streamlit for a seamless web-based user experience.
- Real-time Web Search: Fetches and displays search results using Google Custom Search API.
- Contextual AI Responses: Utilizes AWS Bedrock's LLaMA model to generate responses based on search results.
- Interactive Interface: Built with Streamlit for an intuitive and user-friendly chat interface.
- Python 3.7+
- Packages: Use
requirements.txt
to install the necessary packages:google-api-python-client
boto3
requests
beautifulsoup4
python-dotenv
streamlit
git clone https://github.com/yourusername/RAG_Bedrock.git
cd RAG_Bedrock
Create a .env
file in the root directory with the following content:
GOOGLE_SEARCH_API_KEY=your_google_search_api_key
GOOGLE_CSE_ID=your_google_custom_search_engine_id
AWS_REGION=your_aws_region (e.g., 'us-west-2')
AWS_ACCESS_KEY_ID=your_aws_access_key_id
AWS_SECRET_ACCESS_KEY=your_aws_secret_access_key
Install the required Python packages:
pip install -r requirements.txt
To start the Streamlit application, run:
streamlit run streamlit.py
- Open the Streamlit Application: After running the above command, a web browser window will open with the Streamlit interface.
- Enter a Query: Type your search query into the input box and click "Send."
- View Results: The application will display search results and an AI-generated response based on those results.
- Google Search Integration: Fetches search results from Google Custom Search API.
- Context Preparation: Prepares the context for the AI model based on search results.
- AI Response Generation: Uses AWS Bedrock’s LLaMA model to generate responses.
- User Interface: Provides an interactive chat interface for user input and displays responses.
- Result Display: Shows search results and AI-generated responses within the Streamlit app.