DeepSearch is a Python package that combines data science utilities with powerful search and LLM capabilities. It allows you to create ReAct agents that can search for information and reason through complex questions.
- ReAct Agent: Implements the Reasoning and Acting (ReAct) pattern for LLM agents
- LLM Integration: Connect to various LLM providers including DeepSeek and local models
- Search Capabilities: Integrated search functionality using the Serper API (Google search)
# Clone the repository
git https://github.com/ranchlai/DeepSearch.git
cd deepsearch
# Install the package and its dependencies
pip install -e .
from ds.search import react_agent
# Run a ReAct agent with a question
question = "小神童3号可以在平安好车主app上购买吗?"
answer = react_agent(question, max_steps=5)
print(answer)
You can run DeepSearch as a web service using Flask:
# Run the Flask app
python app.py
This will start a web service at http://localhost:800/search that accepts GET requests with a query parameter 'q'.
Example:
http://localhost:800/search?q=小神童3号可以在平安好车主app上购买吗?
The response is returned in JSON format:
{
"query": "小神童3号可以在平安好车主app上购买吗?",
"result": "根据搜索结果,没有发现小神童3号产品可以在平安好车主app上购买的直接信息..."
}
The following environment variables need to be set:
DEEPSEEK_API_KEY
: Your DeepSeek API keyJINA_AI_API_KEY
: Your Jina AI API key for search, you can get it from hereSERPER_API_KEY
[Optional]: Another option is to use Serper API key for search, you can get it from here
Apache License 2.0