samspeaks5 commited on
Commit
15434c9
·
verified ·
1 Parent(s): d445f2a

initial commit

Browse files
Files changed (1) hide show
  1. README.md +156 -145
README.md CHANGED
@@ -1,146 +1,157 @@
1
- # Web Research Agent
2
-
3
- A powerful AI research assistant built with CrewAI that conducts comprehensive web research on any topic, providing factual, cited responses through a multi-agent approach.
4
-
5
- ## Overview
6
-
7
- This application uses specialized AI agents working together to:
8
- 1. Refine search queries for optimal results
9
- 2. Search the web across multiple search engines
10
- 3. Analyze and verify content
11
- 4. Produce well-structured, factual responses with proper citations
12
-
13
- ## Setup Instructions
14
-
15
- ### Prerequisites
16
-
17
- - Python 3.9+ (recommended: Python 3.11)
18
- - API keys for:
19
- - OpenAI (required)
20
- - Brave Search (recommended)
21
- - Tavily Search (optional)
22
-
23
- ### Installation
24
-
25
- 1. Clone the repository and navigate to the project directory:
26
- ```bash
27
- git clone https://github.com/yourusername/web-research-agent.git
28
- cd web-research-agent
29
- ```
30
-
31
- 2. Install required dependencies:
32
- ```bash
33
- pip install -r requirements.txt
34
- ```
35
-
36
- 3. Create a `.env` file in the root directory with your API keys:
37
- ```
38
- OPENAI_API_KEY=your_openai_api_key
39
- BRAVE_API_KEY=your_brave_api_key
40
- TAVILY_API_KEY=your_tavily_api_key
41
- VERBOSE=False # Set to True for detailed logging
42
- ```
43
-
44
- ### Running the Application
45
-
46
- Start the web interface:
47
- ```bash
48
- python app.py
49
- ```
50
-
51
- The application will be available at http://localhost:7860
52
-
53
- ## Common Issues & Troubleshooting
54
-
55
- ### Pydantic/CrewAI Compatibility Issues
56
-
57
- If you encounter errors like:
58
- ```
59
- AttributeError: 'property' object has no attribute 'model_fields'
60
- ```
61
-
62
- Try the following fixes:
63
-
64
- 1. Update to the latest CrewAI version:
65
- ```bash
66
- pip install -U crewai crewai-tools
67
- ```
68
-
69
- 2. If issues persist, temporarily modify the `tools/rate_limited_tool.py` file to fix compatibility with Pydantic.
70
-
71
- ### Search API Rate Limits
72
-
73
- - Brave Search API has a free tier limit of 1 request per minute and 2,000 requests per month
74
- - The application implements rate limiting to prevent API throttling
75
- - Research queries may take several minutes to complete due to these limitations
76
-
77
- ### Gradio Interface Issues
78
-
79
- If the interface fails to load or throws errors:
80
-
81
- 1. Try installing a specific Gradio version:
82
- ```bash
83
- pip install gradio==4.26.0
84
- ```
85
-
86
- 2. Clear your browser cache to remove cached JavaScript files
87
-
88
- 3. Run the headless test script as an alternative:
89
- ```bash
90
- python test.py "Your research question"
91
- ```
92
-
93
- ## Advanced Usage
94
-
95
- ### Command Line Operation
96
-
97
- Test the research engine without the web interface:
98
- ```
99
- python test.py "Your research query here"
100
- ```
101
-
102
- ### Environment Variables
103
-
104
- - `OPENAI_API_KEY`: Required for language model access
105
- - `BRAVE_API_KEY`: Recommended for web search functionality
106
- - `TAVILY_API_KEY`: Optional alternative search engine
107
- - `VERBOSE`: Set to True/False to control logging detail
108
-
109
- ## Deployment
110
-
111
- This project can be deployed to Hugging Face Spaces for web access.
112
-
113
- ### Hugging Face Spaces Deployment
114
-
115
- 1. **Create a new Space on Hugging Face**
116
- - Go to [Hugging Face Spaces](https://huggingface.co/spaces)
117
- - Click "Create new Space"
118
- - Choose a name and select "Gradio" as the SDK
119
- - Set visibility as needed
120
-
121
- 2. **Configure Environment Variables**
122
- - In Space settings, add required API keys as secrets
123
-
124
- 3. **Deploy Code**
125
- ```bash
126
- git clone https://huggingface.co/spaces/your-username/your-space-name
127
- cd your-space-name
128
- cp -r /path/to/web-research-agent/* .
129
- git add .
130
- git commit -m "Initial deployment"
131
- git push
132
- ```
133
-
134
- ### Security Notes
135
-
136
- - Never commit your `.env` file or expose API keys
137
- - Use repository secrets in Hugging Face Spaces
138
- - Keep sensitive deployments private
139
-
140
- ## Development Structure
141
-
142
- - `app.py`: Web interface and session management
143
- - `research_engine.py`: Core research orchestration logic
144
- - `agents.py`: Agent definitions and configurations
145
- - `tools/`: Search and analysis tools
 
 
 
 
 
 
 
 
 
 
 
146
  - `test.py`: Command-line testing utility
 
1
+ ---
2
+ title: Web Research Agent
3
+ emoji: 🔍
4
+ colorFrom: blue
5
+ colorTo: indigo
6
+ sdk: gradio
7
+ sdk_version: "3.50.0"
8
+ app_file: app.py
9
+ pinned: false
10
+ ---
11
+
12
+ # Web Research Agent
13
+
14
+ A powerful AI research assistant built with CrewAI that conducts comprehensive web research on any topic, providing factual, cited responses through a multi-agent approach.
15
+
16
+ ## Overview
17
+
18
+ This application uses specialized AI agents working together to:
19
+ 1. Refine search queries for optimal results
20
+ 2. Search the web across multiple search engines
21
+ 3. Analyze and verify content
22
+ 4. Produce well-structured, factual responses with proper citations
23
+
24
+ ## Setup Instructions
25
+
26
+ ### Prerequisites
27
+
28
+ - Python 3.9+ (recommended: Python 3.11)
29
+ - API keys for:
30
+ - OpenAI (required)
31
+ - Brave Search (recommended)
32
+ - Tavily Search (optional)
33
+
34
+ ### Installation
35
+
36
+ 1. Clone the repository and navigate to the project directory:
37
+ ```bash
38
+ git clone https://github.com/yourusername/web-research-agent.git
39
+ cd web-research-agent
40
+ ```
41
+
42
+ 2. Install required dependencies:
43
+ ```bash
44
+ pip install -r requirements.txt
45
+ ```
46
+
47
+ 3. Create a `.env` file in the root directory with your API keys:
48
+ ```
49
+ OPENAI_API_KEY=your_openai_api_key
50
+ BRAVE_API_KEY=your_brave_api_key
51
+ TAVILY_API_KEY=your_tavily_api_key
52
+ VERBOSE=False # Set to True for detailed logging
53
+ ```
54
+
55
+ ### Running the Application
56
+
57
+ Start the web interface:
58
+ ```bash
59
+ python app.py
60
+ ```
61
+
62
+ The application will be available at http://localhost:7860
63
+
64
+ ## Common Issues & Troubleshooting
65
+
66
+ ### Pydantic/CrewAI Compatibility Issues
67
+
68
+ If you encounter errors like:
69
+ ```
70
+ AttributeError: 'property' object has no attribute 'model_fields'
71
+ ```
72
+
73
+ Try the following fixes:
74
+
75
+ 1. Update to the latest CrewAI version:
76
+ ```bash
77
+ pip install -U crewai crewai-tools
78
+ ```
79
+
80
+ 2. If issues persist, temporarily modify the `tools/rate_limited_tool.py` file to fix compatibility with Pydantic.
81
+
82
+ ### Search API Rate Limits
83
+
84
+ - Brave Search API has a free tier limit of 1 request per minute and 2,000 requests per month
85
+ - The application implements rate limiting to prevent API throttling
86
+ - Research queries may take several minutes to complete due to these limitations
87
+
88
+ ### Gradio Interface Issues
89
+
90
+ If the interface fails to load or throws errors:
91
+
92
+ 1. Try installing a specific Gradio version:
93
+ ```bash
94
+ pip install gradio==4.26.0
95
+ ```
96
+
97
+ 2. Clear your browser cache to remove cached JavaScript files
98
+
99
+ 3. Run the headless test script as an alternative:
100
+ ```bash
101
+ python test.py "Your research question"
102
+ ```
103
+
104
+ ## Advanced Usage
105
+
106
+ ### Command Line Operation
107
+
108
+ Test the research engine without the web interface:
109
+ ```
110
+ python test.py "Your research query here"
111
+ ```
112
+
113
+ ### Environment Variables
114
+
115
+ - `OPENAI_API_KEY`: Required for language model access
116
+ - `BRAVE_API_KEY`: Recommended for web search functionality
117
+ - `TAVILY_API_KEY`: Optional alternative search engine
118
+ - `VERBOSE`: Set to True/False to control logging detail
119
+
120
+ ## Deployment
121
+
122
+ This project can be deployed to Hugging Face Spaces for web access.
123
+
124
+ ### Hugging Face Spaces Deployment
125
+
126
+ 1. **Create a new Space on Hugging Face**
127
+ - Go to [Hugging Face Spaces](https://huggingface.co/spaces)
128
+ - Click "Create new Space"
129
+ - Choose a name and select "Gradio" as the SDK
130
+ - Set visibility as needed
131
+
132
+ 2. **Configure Environment Variables**
133
+ - In Space settings, add required API keys as secrets
134
+
135
+ 3. **Deploy Code**
136
+ ```bash
137
+ git clone https://huggingface.co/spaces/your-username/your-space-name
138
+ cd your-space-name
139
+ cp -r /path/to/web-research-agent/* .
140
+ git add .
141
+ git commit -m "Initial deployment"
142
+ git push
143
+ ```
144
+
145
+ ### Security Notes
146
+
147
+ - Never commit your `.env` file or expose API keys
148
+ - Use repository secrets in Hugging Face Spaces
149
+ - Keep sensitive deployments private
150
+
151
+ ## Development Structure
152
+
153
+ - `app.py`: Web interface and session management
154
+ - `research_engine.py`: Core research orchestration logic
155
+ - `agents.py`: Agent definitions and configurations
156
+ - `tools/`: Search and analysis tools
157
  - `test.py`: Command-line testing utility