Merge pull request #2 from synth-mania/gitignore

This commit is contained in:
NimbleAINinja 2024-11-22 04:48:53 -05:00 committed by GitHub
commit 8457fc9d32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 30 additions and 20 deletions

5
.gitignore vendored Normal file
View file

@ -0,0 +1,5 @@
__pycache__
venv
logs
modelfile
research_session_*

View file

@ -40,20 +40,23 @@ The key distinction is that this isn't just a chatbot - it's an automated resear
1. Clone the repository: 1. Clone the repository:
```sh
git clone https://github.com/TheBlewish/Automated-AI-Web-Researcher-Ollama git clone https://github.com/TheBlewish/Automated-AI-Web-Researcher-Ollama
cd Automated-AI-Web-Researcher-Ollama cd Automated-AI-Web-Researcher-Ollama
```
2. Create and activate a virtual environment: 2. Create and activate a virtual environment:
```sh
python -m venv venv python -m venv venv
source venv/bin/activate # On Windows, use venv\Scripts\activate source venv/bin/activate # On Windows, use venv\Scripts\activate
```
3. Install dependencies: 3. Install dependencies:
```sh
pip install -r requirements.txt pip install -r requirements.txt
```
4. Install and Configure Ollama: 4. Install and Configure Ollama:
- Install Ollama following instructions at https://ollama.ai - Install Ollama following instructions at https://ollama.ai
@ -62,16 +65,19 @@ pip install -r requirements.txt
Create a file named `modelfile` with these exact contents: Create a file named `modelfile` with these exact contents:
```
FROM your-model-name FROM your-model-name
PARAMETER num_ctx 38000 PARAMETER num_ctx 38000
```
Replace "your-model-name" with your chosen model (e.g., phi3:3.8b-mini-128k-instruct). Replace "your-model-name" with your chosen model (e.g., phi3:3.8b-mini-128k-instruct).
Then create the model: Then create the model:
```sh
ollama create research-phi3 -f modelfile ollama create research-phi3 -f modelfile
```
Note: This specific configuration is necessary as recent Ollama versions have reduced context windows on models like phi3:3.8b-mini-128k-instruct despite the name suggesting high context which is why the modelfile step is necessary due to the high amount of information being used during the research process. Note: This specific configuration is necessary as recent Ollama versions have reduced context windows on models like phi3:3.8b-mini-128k-instruct despite the name suggesting high context which is why the modelfile step is necessary due to the high amount of information being used during the research process.
@ -79,24 +85,26 @@ Note: This specific configuration is necessary as recent Ollama versions have re
1. Start Ollama: 1. Start Ollama:
```sh
ollama serve ollama serve
```
2. Run the researcher: 2. Run the researcher:
```sh
python Web-LLM.py python Web-LLM.py
```
3. Start a research session: 3. Start a research session:
- Type @ followed by your research query - Type `@` followed by your research query
- Press CTRL+D to submit - Press CTRL+D to submit
- Example: "@What year is global population projected to start declining?" - Example: `@What year is global population projected to start declining?`
4. During research you can use the following commands by typing the letter associated with each and submitting with CTRL+D: 4. During research you can use the following commands by typing the letter associated with each and submitting with CTRL+D:
- Use 's' to show status. - Use `s` to show status.
- Use 'f' to show current focus. - Use `f` to show current focus.
- Use 'p' to pause and assess research progress, which will give you an assessment from the LLM after reviewing the entire research content whether it can answer your query or not with the content it has so far collected, then it waits for you to input one of two commands, 'c' to continue with the research or 'q' to terminate it which will result in a summary like if you terminated it without using the pause feature. - Use `p` to pause and assess research progress, which will give you an assessment from the LLM after reviewing the entire research content whether it can answer your query or not with the content it has so far collected, then it waits for you to input one of two commands, `c` to continue with the research or `q` to terminate it which will result in a summary like if you terminated it without using the pause feature.
- Use 'q' to quit research. - Use `q` to quit research.
5. After research completes: 5. After research completes:
- Wait for the summary to be generated, and review the LLM's findings. - Wait for the summary to be generated, and review the LLM's findings.
@ -130,7 +138,7 @@ This project is licensed under the MIT License - see the [LICENSE] file for deta
- DuckDuckGo for their search API - DuckDuckGo for their search API
## Personal Note ## Personal Note
This tool represents an attempt to bridge the gap between simple LLM interactions and genuine research capabilities. By structuring the research process and maintaining documentation, it aims to provide more thorough and verifiable results than traditional LLM conversations. It also represents an attempt to improve on my previous project 'Web-LLM-Assistant-Llamacpp-Ollama' which simply gave LLM's the ability to search and scrape websites to answer questions. This new program, unlike it's predecessor I feel thos program takes that capability and uses it in a novel and actually very useful way, I feel that it is the most advanced and useful way I could conceive of building on my previous program, as a very new proggrammer this being my second ever program I feel very good about the result, I hope that it hits the mark! This tool represents an attempt to bridge the gap between simple LLM interactions and genuine research capabilities. By structuring the research process and maintaining documentation, it aims to provide more thorough and verifiable results than traditional LLM conversations. It also represents an attempt to improve on my previous project 'Web-LLM-Assistant-Llamacpp-Ollama' which simply gave LLM's the ability to search and scrape websites to answer questions. This new program, unlike it's predecessor I feel thos program takes that capability and uses it in a novel and actually very useful way, I feel that it is the most advanced and useful way I could conceive of building on my previous program, as a very new programmer this being my second ever program I feel very good about the result, I hope that it hits the mark!
Given how much I have now been using it myself, unlike the previous program which felt more like a novelty then an actual tool, this is actually quite useful and unique, but I am quite biased! Given how much I have now been using it myself, unlike the previous program which felt more like a novelty then an actual tool, this is actually quite useful and unique, but I am quite biased!
Please enjoy! and feel free to submit any suggestions for improvements, so that we can make this automated AI researcher even more capable. Please enjoy! and feel free to submit any suggestions for improvements, so that we can make this automated AI researcher even more capable.

View file

@ -61,16 +61,13 @@ def print_header():
print(Fore.YELLOW + """ print(Fore.YELLOW + """
Welcome to the Advanced Research Assistant! Welcome to the Advanced Research Assistant!
Commands: Usage:
- For web search: start message with '/' - Start your research query with '@'
Example: "/latest news on AI advancements"
- For research mode: start message with '@'
Example: "@analyze the impact of AI on healthcare" Example: "@analyze the impact of AI on healthcare"
Press CTRL+D (Linux/Mac) or CTRL+Z (Windows) to submit input. Press CTRL+D (Linux/Mac) or CTRL+Z (Windows) to submit input.
""" + Style.RESET_ALL) """ + Style.RESET_ALL)
def get_multiline_input() -> str: def get_multiline_input() -> str:
"""Get multiline input using raw terminal mode for reliable CTRL+D handling""" """Get multiline input using raw terminal mode for reliable CTRL+D handling"""
print(f"{Fore.GREEN}📝 Enter your message (Press CTRL+D to submit):{Style.RESET_ALL}") print(f"{Fore.GREEN}📝 Enter your message (Press CTRL+D to submit):{Style.RESET_ALL}")

View file

@ -86,7 +86,7 @@ class LLMWrapper:
'top_p': kwargs.get('top_p', self.llm_config.get('top_p', 0.9)), 'top_p': kwargs.get('top_p', self.llm_config.get('top_p', 0.9)),
'stop': kwargs.get('stop', self.llm_config.get('stop', [])), 'stop': kwargs.get('stop', self.llm_config.get('stop', [])),
'num_predict': kwargs.get('max_tokens', self.llm_config.get('max_tokens', 55000)), 'num_predict': kwargs.get('max_tokens', self.llm_config.get('max_tokens', 55000)),
'context_length': self.llm_config.get('n_ctx', 55000) 'num_ctx': self.llm_config.get('n_ctx', 55000)
} }
} }
response = requests.post(url, json=data, stream=True) response = requests.post(url, json=data, stream=True)