A simple yet powerful Generative AI search agent built with Pydantic AI and Streamlit. This application allows users to ask questions and get up-to-date information from the web using the Tavily search API and Groq's LLama 3.1 model.
- 🔍 Real-time web search capabilities
- 🤖 Powered by Groq's LLama 3.1 8B Instant model
- 🌐 Uses Tavily search API for accurate and relevant results
- 🚀 Simple and intuitive user interface built with Streamlit
- ⚡ Fast response times
- Python 3.8+
- Groq API key
- Tavily API key
-
Clone this repository:
git clone <repository-url> cd pydantic-ai-agent-main -
Install the required dependencies:
pip install -r requirements.txt -
Set up your API keys in the
agent_utils.pyfile:os.environ["GROQ_API_KEY"] = "your_groq_api_key" TAVILY_API_KEY = "your_tavily_api_key"
-
Start the Streamlit app:
streamlit run app.py -
Open your web browser and navigate to the URL displayed in the terminal (usually http://localhost:8501)
-
Enter your query in the text input field and click "Search"
-
The agent will search the web and provide you with relevant information
app.py: Main Streamlit application fileagent_utils.py: Contains the agent configuration and search functionalityrequirements.txt: List of required Python packagesBuild_Agents_using_Pydantic_AI.ipynb: Jupyter notebook demonstrating the agent's functionalitystart_app.txt: Commands to install dependencies and start the application
- The application uses Pydantic AI to create an agent with the Groq LLama 3.1 model
- The agent is equipped with the Tavily search tool to fetch information from the web
- When a user submits a query, the application sends it to the agent
- The agent processes the query, searches the web using Tavily, and returns the results
- The results are displayed to the user in a readable format
- Pydantic AI: Framework for building AI agents
- Streamlit: Web application framework for Python
- Groq: Provider of the LLama 3.1 language model
- Tavily: Search API for AI applications
This project is licensed under the MIT License - see the LICENSE file for details.
- Pydantic AI for providing the agent framework
- Streamlit for the easy-to-use web application framework
- Groq for the powerful language model
- Tavily for the search API
