├── requirements.txt ├── app.py └── README.md /requirements.txt: -------------------------------------------------------------------------------- 1 | phidata 2 | streamlit 3 | groq -------------------------------------------------------------------------------- /app.py: -------------------------------------------------------------------------------- 1 | import streamlit as st 2 | from phi.assistant import Assistant 3 | from phi.tools.hackernews import HackerNews 4 | from phi.llm.groq import GroqChat 5 | 6 | # Set up the Streamlit app 7 | st.title("Multi-Agent AI Researcher 🔍🤖") 8 | st.caption("This app allows you to research top stories and users on HackerNews and generate insightful content.") 9 | 10 | # Get Groq API key from user 11 | groq_api_key = st.text_input("Groq API Key", type="password") 12 | 13 | if groq_api_key: 14 | # Create instances of the Assistant 15 | story_researcher = Assistant( 16 | name="HackerNews Story Researcher", 17 | role="Researches and analyzes top HackerNews stories, providing detailed insights and trends.", 18 | tools=[HackerNews()], 19 | ) 20 | 21 | user_researcher = Assistant( 22 | name="HackerNews User Researcher", 23 | role="Analyzes HackerNews user profiles, their contributions, and impact on the community.", 24 | tools=[HackerNews()], 25 | ) 26 | 27 | hn_assistant = Assistant( 28 | name="HackerNews Insights Team", 29 | team=[story_researcher, user_researcher], 30 | llm=GroqChat( 31 | model="deepseek-r1-distill-llama-70b", 32 | max_tokens=2048, 33 | temperature=0.7, 34 | api_key=groq_api_key 35 | ), 36 | system_prompt=( 37 | "You are an expert HackerNews analyst team. Your goal is to provide in-depth insights, " 38 | "trend analysis, and valuable information based on HackerNews data. When responding:" 39 | "\n1. Always provide context and explain the significance of your findings." 40 | "\n2. Use data to support your insights whenever possible." 41 | "\n3. Highlight emerging trends or patterns you observe." 42 | "\n4. Consider the broader implications of the information for the tech industry or society." 43 | "\n5. When appropriate, suggest follow-up questions or areas for further exploration." 44 | ) 45 | ) 46 | 47 | # Input field for the research query 48 | query = st.text_area("Enter your research query", height=100) 49 | 50 | if st.button("Generate Insights"): 51 | if query: 52 | with st.spinner("Analyzing HackerNews data..."): 53 | # Get the response from the assistant 54 | response = hn_assistant.run(query, stream=True) 55 | 56 | # Display the response 57 | st.markdown("## Insights") 58 | st.write(response) 59 | else: 60 | st.warning("Please enter a research query.") 61 | else: 62 | st.warning("Please enter your Groq API key to proceed.") -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Multi-Agent AI Researcher Powered by DeepSeek-R1 LLM Model 🔍🤖 2 | 3 | ## Overview 4 | The **Multi-Agent AI Researcher** is a Streamlit application that leverages **GroqChat** and **HackerNews tools** to provide in-depth research and analysis of HackerNews stories and user profiles. Designed for researchers, analysts, and enthusiasts, this app offers a collaborative AI-driven team that generates insights, trends, and content based on HackerNews data. 5 | 6 | --- 7 | 8 | ## Key Features 9 | - **Multi-Agent Collaboration**: Includes specialized AI assistants for story and user analysis. 10 | - **GroqChat Integration**: Powered by the **deepseek-r1-distill-llama-70b** model for detailed, insightful responses. 11 | - **HackerNews Tools**: Analyzes HackerNews stories, profiles, and trends. 12 | - **Customizable System Prompt**: Ensures responses are detailed, insightful, and actionable. 13 | - **Streamlit Interface**: Simple, user-friendly design for seamless interaction. 14 | 15 | --- 16 | 17 | ## Installation 18 | 19 | ### Prerequisites 20 | Ensure Python 3.8 or higher is installed. 21 | 22 | ### Steps 23 | 1. Clone the repository: 24 | ```bash 25 | git clone https://github.com/your-username/multi-agent-researcher.git 26 | cd multi-agent-researcher 27 | ``` 28 | 29 | 2. Install dependencies: 30 | ```bash 31 | pip install phi streamlit 32 | ``` 33 | 34 | 3. Set up your Groq API key: 35 | - Enter the key in the app's input field after launching. 36 | 37 | --- 38 | 39 | ## Usage 40 | 41 | 1. **Run the Application**: 42 | ```bash 43 | streamlit run app.py 44 | ``` 45 | 46 | 2. **Interface**: 47 | - Enter your **Groq API Key**. 48 | - Input your research query related to HackerNews stories or users. 49 | - Click **Generate Insights** to receive a detailed response. 50 | 51 | --- 52 | 53 | ## Technical Details 54 | 55 | ### AI Assistants 56 | - **HackerNews Story Researcher**: 57 | - Analyzes top stories on HackerNews. 58 | - Provides trends, context, and significance of stories. 59 | - **HackerNews User Researcher**: 60 | - Examines user profiles, contributions, and influence within the community. 61 | - **HackerNews Insights Team**: 62 | - A collaborative assistant leveraging **GroqChat** for combined story and user analysis. 63 | 64 | ### System Prompt Highlights 65 | The system prompt ensures: 66 | - Responses are context-rich and data-supported. 67 | - Insights are framed in the broader context of technology and society. 68 | - Suggestions for further exploration are provided. 69 | 70 | ### Example Workflow 71 | 1. **Query**: "What are the emerging trends in AI from HackerNews stories?" 72 | 2. **Response**: 73 | - Analysis of top stories tagged with AI. 74 | - Insights into the frequency and themes of AI-related discussions. 75 | - Broader implications for the tech industry. 76 | 77 | --- 78 | 79 | ## Screenshots 80 | - **Homepage**: Input fields for API key and research query. 81 | - **Insights**: Detailed responses displayed in markdown. 82 | 83 | --- 84 | 85 | ## Future Enhancements 86 | - Add visualization tools to display trends (charts, graphs). 87 | - Expand tool capabilities to include other data sources like Reddit or Medium. 88 | - Enable multi-query sessions with saved history. 89 | 90 | --- 91 | 92 | ## License 93 | This project is licensed under the **MIT License**. 94 | 95 | --- 96 | 97 | ## Contact 98 | For queries or contributions, feel free to reach out: 99 | - **Author**: Siddharth Kharche 100 | - **Email**: siddukharche04@gmail.com 101 | - **GitHub**: [siddharth-Kharche](https://github.com/siddharth-Kharche) 102 | --------------------------------------------------------------------------------