CyranoB commited on
Commit
48dbc73
·
1 Parent(s): 8404796

Mock readme

Browse files
Files changed (1) hide show
  1. README.md +58 -2
README.md CHANGED
@@ -1,2 +1,58 @@
1
- # search_agent
2
- Simple search agent
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Simple Search Agent
2
+
3
+ This is a simple search agent that accepts a question as input, searches the web for relevant information, and then uses the search results to generate an answer using a large language model (LLM).
4
+
5
+ ## How It Works
6
+
7
+ 1. The user asks the agent a question.
8
+ 2. The agent performs a web search using the question as the query.
9
+ 3. The agent extracts the most relevant snippets and information from the top search results.
10
+ 4. The extracted web results are passed as context to a large language model.
11
+ 5. The LLM uses the web search context to generate a final answer to the original question.
12
+ 6. The agent returns the generated answer to the user.
13
+
14
+ ## Setup and Installation
15
+
16
+ 1. Clone this repo
17
+ 2. Install the required dependencies:
18
+ ```
19
+ pip install -r requirements.txt
20
+ ```
21
+ 3. Set up API keys:
22
+ - You will need API keys for the web search API and LLM API.
23
+ - Add your API keys to the `config.py` file.
24
+ 4. Run the agent:
25
+ ```
26
+ python agent.py
27
+ ```
28
+
29
+ ## Usage
30
+
31
+ To use the agent, simply run the `agent.py` script and enter your question when prompted. The agent will return a generated answer based on web search results.
32
+
33
+ Example:
34
+ ```
35
+ $ python agent.py
36
+ Enter a question: What is the capital of France?
37
+
38
+ Based on the information from web searches, the capital of France is Paris. Paris is the largest city in France and has been the country's capital since the 12th century. It is located in north-central France along the Seine River. As the capital, Paris is the seat of France's national government. Key landmarks include the Eiffel Tower, the Louvre museum, and the Notre-Dame cathedral. Paris is also a major global city known for its art, fashion, cuisine and culture.
39
+ ```
40
+
41
+ ## Configuration
42
+
43
+ - `config.py`: Contains configuration settings for the agent, including API keys.
44
+ - `agent.py`: The main agent script that accepts user input, performs web searches, and generates answers.
45
+ - `search.py`: Handles making web search requests and extracting relevant snippets from the results.
46
+ - `llm.py`: Interfaces with the language model API to generate answer text based on the web search information.
47
+
48
+ ## Dependencies
49
+
50
+ - `requests`: For making HTTP requests to web search and LLM APIs
51
+ - `openai`: For interfacing with the OpenAI language model API
52
+ - `googlesearch-python`: For performing Google web searches
53
+
54
+ ## License
55
+
56
+ This project is licensed under the MIT License. See the `LICENSE` file for details.
57
+
58
+ Let me know if you have any other questions! The key components are using a web search API to find relevant information, extracting the key snippets from the search results, passing that as context to a large language model, and having the LLM generate a natural language answer based on the web search context.