Disclaimer: This implementation is solely done for fun and is not intended to be a competitive or productive implementation alternatives for Hugging Face or OpenAI Deep Researchers.
A good amount of code was reworked from these notebooks, integrated with Flask and other search options: https://github.com/mshumer/OpenDeepResearcher
Deep Researcher imitates the OpenAI deep researcher by searching and sending search results to LLM. It is important to set up the .env file.
- SerpAPI: You can get your SerpAPI key from SerpAPI.
- Jina: You can get your Jina key from Jina AI.
- Google Custom Search: You can get your Google Custom Search key from Google Custom Search.
As SerpAPI and Jina run out of credits quite quickly, the application has a fallback mechanism:
- SerpAPI: Primary search API.
- Jina: Primary web scraping API.
- Google Custom Search: Secondary search API.
- Beautiful Soup: Third option when all the credits ran out: DIY search and web scraping tool.
This project is a Flask application with separated frontend and backend (API) blueprints.
To set up the project, follow these steps:
- Python 3.11 or higher
- Poetry (for dependency management)
curl -sSL https://install.python-poetry.org | python3 -m https://github.com/mariasukhareva/llm-api-frontend.git
Navigate to the project directory and install the dependencies using Poetry:
cd deep-reasoning
poetry installCreate a .env file in the project root and add the necessary environment variables:
in deep-reasoning/app/frontend/.env
touch deep-reasoning/app/frontend/.env
add your api key in the env files:
LLM_API_KEY="YOUR_API_KEY"
You can also add your API key in the frontend You can get the API key here
python run.py
Once the application is running, you can access it at http://127.0.0.1:5000/.
if everything is configure correctly, you should be able to see the list of models from LLM api in the drop down box
If for some reason you do not see it, try to reload the page first.
If reloading did not help, try to restart the python script:
python run.py
If you clear the Deep Search tab, you should see a different window. Note that it does not allow multi-turn dialogues for now, so each query will trigger a new deep search.
You can also add your API key in the frontend from OpenAI or any compatible API
To run the tests, use the following command:
poetry run pytest
