Open Source Deep Research Alternative to Reason and Search on Private Data. Written in Python.

DeepSearcher combines cutting-edge LLMs (OpenAI o3, Qwen3, DeepSeek, Grok 4, Claude 4 Sonnet, Llama 4, QwQ, etc.) and Vector Databases (Milvus, Zilliz Cloud etc.) to perform search, evaluation, and reasoning based on private data, providing highly accurate answer and comprehensive report. This project is suitable for enterprise knowledge management, intelligent Q&A systems, and information retrieval scenarios.

๐ Features
- Private Data Search: Maximizes the utilization of enterprise internal data while ensuring data security. When necessary, it can integrate online content for more accurate answers.
- Vector Database Management: Supports Milvus and other vector databases, allowing data partitioning for efficient retrieval.
- Flexible Embedding Options: Compatible with multiple embedding models for optimal selection.
- Multiple LLM Support: Supports DeepSeek, OpenAI, and other large models for intelligent Q&A and content generation.
- Document Loader: Supports local file loading, with web crawling capabilities under development.
๐ Demo
๐ Quick Start
Installation
Install DeepSearcher using one of the following methods:Option 1: Using pip
Create and activate a virtual environment(Python 3.10 version is recommended).python -m venv .venv
source .venv/bin/activate
Install DeepSearcher
pip install deepsearcher
For optional dependencies, e.g., ollama:
pip install "deepsearcher[ollama]"
Option 2: Install in Development Mode
We recommend using uv for faster and more reliable installation. Follow the offical installation instructions to install it.Clone the repository and navigate to the project directory:
git clone https://github.com/zilliztech/deep-searcher.git && cd deep-searcher Synchronize and install dependencies: uv sync source .venv/bin/activate
For more detailed development setup and optional dependency installation options, see CONTRIBUTING.md.
Quick start demo
To run this quick start demo, please prepare your OPENAIAPIKEY in your environment variables. If you change the LLM in the configuration, make sure to prepare the corresponding API key.
from deepsearcher.configuration import Configuration, init_config
from deepsearcher.online_query import query
config = Configuration()
Customize your config here,
more configuration see the Configuration Details section below.
config.setproviderconfig("llm", "OpenAI", {"model": "o1-mini"})
config.setproviderconfig("embedding", "OpenAIEmbedding", {"model": "text-embedding-ada-002"})
init_config(config = config)
Load your local data
from deepsearcher.offlineloading import loadfromlocalfiles
loadfromlocalfiles(pathsordirectory=yourlocal_path)
(Optional) Load from web crawling (FIRECRAWLAPIKEY env variable required)
from deepsearcher.offlineloading import loadfrom_website
loadfromwebsite(urls=website_url)
Query
result = query("Write a report about xxx.") # Your question here
Configuration Details:
LLM Configuration
config.setproviderconfig("llm", "(LLMName)", "(Arguments dict)")
The "LLMName" can be one of the following: ["DeepSeek", "OpenAI", "XAI", "SiliconFlow", "Aliyun", "PPIO", "TogetherAI", "Gemini", "Ollama", "Novita", "Jiekou.AI"]
The "Arguments dict" is a dictionary that contains the necessary arguments for the LLM class.
Make sure you have prepared your OPENAI API KEY as an env variable More details about OpenAI models: https://platform.openai.com/docs/models Example (OpenAI)
OPENAIAPIKEY.config.setproviderconfig("llm", "OpenAI", {"model": "o1-mini"})
Make sure you have prepared your Bailian API KEY as an env variable More details about Aliyun Bailian models: https://bailian.console.aliyun.com Example (Qwen3 from Aliyun Bailian)
DASHSCOPEAPIKEY.config.setproviderconfig("llm", "Aliyun", {"model": "qwen-plus-latest"})
More details about OpenRouter models: https://openrouter.ai/qwen/qwen3-235b-a22b:free Example (Qwen3 from OpenRouter)
config.setproviderconfig("llm", "OpenAI", {"model": "qwen/qwen3-235b-a22b:free", "baseurl": "https://openrouter.ai/api/v1", "apikey": "OPENROUTERAPIKEY"})
Make sure you have prepared your DEEPSEEK API KEY as an env variable More details about DeepSeek: https://api-docs.deepseek.com/ Example (DeepSeek from official)
DEEPSEEKAPIKEY.config.setproviderconfig("llm", "DeepSeek", {"model": "deepseek-reasoner"})
Make sure you have prepared your SILICONFLOW API KEY as an env variable More details about SiliconFlow: https://docs.siliconflow.cn/quickstart Example (DeepSeek from SiliconFlow)
SILICONFLOWAPIKEY.config.setproviderconfig("llm", "SiliconFlow", {"model": "deepseek-ai/DeepSeek-R1"})
Make sure you have prepared your TOGETHER API KEY as an env variable You need to install together before running, execute: Example (DeepSeek from TogetherAI)
TOGETHERAPIKEY.
For Llama 4: config.setproviderconfig("llm", "TogetherAI", {"model": "deepseek-ai/DeepSeek-R1"})config.setproviderconfig("llm", "TogetherAI", {"model": "meta-llama/Llama-4-Scout-17B-16E-Instruct"})pip install together. More details about TogetherAI: https://www.together.ai/
Make sure you have prepared your XAI API KEY as an env variable More details about XAI Grok: https://docs.x.ai/docs/overview#featured-models Example (XAI Grok)
XAIAPIKEY.config.setproviderconfig("llm", "XAI", {"model": "grok-4-0709"})
Make sure you have prepared your ANTHROPIC API KEY as an env variable More details about Anthropic Claude: https://docs.anthropic.com/en/home Example (Claude)
ANTHROPICAPIKEY.config.setproviderconfig("llm", "Anthropic", {"model": "claude-sonnet-4-0"})
Make sure you have prepared your GEMINI API KEY as an env variable You need to install gemini before running, execute: Example (Google Gemini)
GEMINIAPIKEY.config.setproviderconfig('llm', 'Gemini', { 'model': 'gemini-2.0-flash' })pip install google-genai. More details about Gemini: https://ai.google.dev/gemini-api/docs
Make sure you have prepared your PPIO API KEY as an env variable More details about PPIO: https://ppinfra.com/docs/get-started/quickstart.html?utmsource=githubdeep-searcher Example (DeepSeek from PPIO)
PPIOAPIKEY. You can create an API Key here. config.setproviderconfig("llm", "PPIO", {"model": "deepseek/deepseek-r1-turbo"})
Make sure you have prepared your Jiekou.AI API KEY as an env variable More details about Jiekou.AI: https://docs.jiekou.ai/docs/support/quickstart?utmsource=githubdeep-searcher Example (Claude Sonnet 4.5 from Jiekou.AI)
JIEKOUAPIKEY. You can create an API Key here. config.setproviderconfig("llm", "JiekouAI", {"model": "claude-sonnet-4-5-20250929"})
Follow these instructions to set up and run a local Ollama instance: Download and install Ollama onto the available supported platforms (including Windows Subsystem for Linux). View a list of available models via the model library. Fetch available LLM models via Example: To chat directly with a model from the command line, use By default, Ollama has a REST API for running and managing models on http://localhost:11434.Example (Ollama)
ollama pull <name-of-model>ollama pull qwen3ollama run <name-of-model>.config.setproviderconfig("llm", "Ollama", {"model": "qwen3"})
Make sure you have prepared your Volcengine API KEY as an env variable More details about Volcengine: https://www.volcengine.com/docs/82379/1099455?utmsource=githubdeep-searcher Example (Volcengine)
VOLCENGINEAPIKEY. You can create an API Key here. config.setproviderconfig("llm", "Volcengine", {"model": "deepseek-r1-250120"})
Make sure you have prepared your GLM API KEY as an env variable You need to install zhipuai before running, execute: Example (GLM)
GLMAPIKEY.config.setproviderconfig("llm", "GLM", {"model": "glm-4-plus"})pip install zhipuai. More details about GLM: https://bigmodel.cn/dev/welcome
Make sure you have prepared your Amazon Bedrock API KEY as an env variable You need to install boto3 before running, execute: Example (Amazon Bedrock)
AWSACCESSKEYID and AWSSECRETACCESSKEY.config.setproviderconfig("llm", "Bedrock", {"model": "us.deepseek.r1-v1:0"})pip install boto3. More details about Amazon Bedrock: https://docs.aws.amazon.com/bedrock/
Make sure you have prepared your watsonx.ai credentials as env variables You need to install ibm-watsonx-ai before running, execute: Example (IBM watsonx.ai)
WATSONXAPIKEY, WATSONXURL, and WATSONXPROJECTID.config.setproviderconfig("llm", "watsonx", {"model": "us.deepseek.r1-v1:0"})pip install ibm-watsonx-ai. More details about IBM watsonx.ai: https://www.ibm.com/products/watsonx-ai/foundation-models
Embedding Model Configuration
config.setproviderconfig("embedding", "(EmbeddingModelName)", "(Arguments dict)")
The "EmbeddingModelName" can be one of the following: ["MilvusEmbedding", "OpenAIEmbedding", "VoyageEmbedding", "SiliconflowEmbedding", "PPIOEmbedding", "NovitaEmbedding", "JiekouAIEmbedding"]
The "Arguments dict" is a dictionary that contains the necessary arguments for the embedding model class.
Make sure you have prepared your OpenAI API KEY as an env variable More details about OpenAI models: https://platform.openai.com/docs/guides/embeddings/use-cases Example (OpenAI embedding)
OPENAIAPIKEY.config.setproviderconfig("embedding", "OpenAIEmbedding", {"model": "text-embedding-3-small"})
Make sure you have prepared your OpenAI API KEY as an env variable Example (OpenAI embedding Azure)
OPENAIAPIKEY.config.setproviderconfig("embedding", "OpenAIEmbedding", { "model": "text-embedding-ada-002", "azure_endpoint": "https://
Use the built-in embedding model in Pymilvus, you can set the model name as For Jina's embedding model, you need You need to install pymilvus model before running, execute: Example (Pymilvus built-in embedding model)
"default", "BAAI/bge-base-en-v1.5", "BAAI/bge-large-en-v1.5", "jina-embeddings-v3", etc.
See milvus_embedding.py for more details. config.setproviderconfig("embedding", "MilvusEmbedding", {"model": "BAAI/bge-base-en-v1.5"})config.setproviderconfig("embedding", "MilvusEmbedding", {"model": "jina-embeddings-v3"})JINAAIAPIKEY.pip install pymilvus.model. More details about Pymilvus: https://milvus.io/docs/embeddings.md
Make sure you have prepared your VOYAGE API KEY as an env variable You need to install voyageai before running, execute: Example (VoyageAI embedding)
VOYAGEAPIKEY.config.setproviderconfig("embedding", "VoyageEmbedding", {"model": "voyage-3"})pip install voyageai. More details about VoyageAI: https://docs.voyageai.com/embeddings/
You need to install boto3 before running, execute: Example (Amazon Bedrock embedding)
config.setproviderconfig("embedding", "BedrockEmbedding", {"model": "amazon.titan-embed-text-v2:0"})pip install boto3. More details about Amazon Bedrock: https://docs.aws.amazon.com/bedrock/
Make sure you have prepared your Novita AI API KEY as an env variable More details about Novita AI: https://novita.ai/docs/api-reference/model-apis-llm-create-embeddings?utmsource=githubdeep-searcher&utmmedium=githubreadme&utm_campaign=link Example (Novita AI embedding)
NOVITAAPIKEY.config.setproviderconfig("embedding", "NovitaEmbedding", {"model": "baai/bge-m3"})
Make sure you have prepared your Siliconflow API KEY as an env variable More details about Siliconflow: https://docs.siliconflow.cn/en/api-reference/embeddings/create-embeddings Example (Siliconflow embedding)
SILICONFLOWAPIKEY.config.setproviderconfig("embedding", "SiliconflowEmbedding", {"model": "BAAI/bge-m3"})
Make sure you have prepared your Volcengine API KEY as an env variable More details about Volcengine: https://www.volcengine.com/docs/82379/1302003 Example (Volcengine embedding)
VOLCENGINEAPIKEY.config.setproviderconfig("embedding", "VolcengineEmbedding", {"model": "doubao-embedding-text-240515"})
Make sure you have prepared your GLM API KEY as an env variable You need to install zhipuai before running, execute: Example (GLM embedding)
GLMAPIKEY.config.setproviderconfig("embedding", "GLMEmbedding", {"model": "embedding-3"})pip install zhipuai. More details about GLM: https://bigmodel.cn/dev/welcome
Make sure you have prepared your Gemini API KEY as an env variable You need to install gemini before running, execute: Example (Google Gemini embedding)
GEMINIAPIKEY.config.setproviderconfig("embedding", "GeminiEmbedding", {"model": "text-embedding-004"})pip install google-genai. More details about Gemini: https://ai.google.dev/gemini-api/docs
You need to install ollama before running, execute: Example (Ollama embedding)
config.setproviderconfig("embedding", "OllamaEmbedding", {"model": "bge-m3"})pip install ollama. More details about Ollama Python SDK: https://github.com/ollama/ollama-python
Make sure you have prepared your PPIO API KEY as an env variable More details about PPIO: https://ppinfra.com/docs/get-started/quickstart.html?utmsource=githubdeep-searcher Example (PPIO embedding)
PPIOAPIKEY.config.setproviderconfig("embedding", "PPIOEmbedding", {"model": "baai/bge-m3"})
Make sure you have prepared your Jiekou.AI API KEY as an env variable More details about Jiekou.AI: https://docs.jiekou.ai/docs/support/quickstart?utmsource=githubdeep-searcher Example (Jiekou.AI embedding)
JIEKOUAPIKEY.config.setproviderconfig("embedding", "JiekouAIEmbedding", {"model": "qwen/qwen3-embedding-8b"})
You need to install fastembed before running, execute: Example (FastEmbed embedding)
config.setproviderconfig("embedding", "FastEmbedEmbedding", {"model": "intfloat/multilingual-e5-large"})pip install fastembed. More details about fastembed: https://github.com/qdrant/fastembed
Make sure you have prepared your WatsonX credentials as env variables You need to install ibm-watsonx-ai before running, execute: Example (IBM watsonx.ai embedding)
WATSONXAPIKEY, WATSONXURL, and WATSONXPROJECTID.config.setproviderconfig("embedding", "WatsonXEmbedding", {"model": "ibm/slate-125m-english-rtrvr-v2"})config.setproviderconfig("embedding", "WatsonXEmbedding", {"model": "sentence-transformers/all-minilm-l6-v2"})pip install ibm-watsonx-ai. More details about IBM watsonx.ai: https://www.ibm.com/products/watsonx-ai/foundation-models
Vector Database Configuration
config.setproviderconfig("vector_db", "(VectorDBName)", "(Arguments dict)")
The "VectorDBName" can be one of the following: ["Milvus"] (Under development)
The "Arguments dict" is a dictionary that contains the necessary arguments for the Vector Database class.
More details about Milvus Config:Example (Milvus)
config.setproviderconfig("vector_db", "Milvus", {"uri": "./milvus.db", "token": ""})
uri as a local file, e.g. ./milvus.db, is the most convenient method, as it automatically utilizes Milvus Lite to store all data in this file.
http://localhost:19530, as your uri. You can also use any other connection parameters supported by Milvus such as host, user, password, or secure.
uri and token according to the Public Endpoint and API Key in Zilliz Cloud.
More details about Milvus Config:Example (AZURE AI Search)
config.setproviderconfig("vector_db", "AzureSearch", { "endpoint": "https://
File Loader Configuration
config.setproviderconfig("file_loader", "(FileLoaderName)", "(Arguments dict)")
The "FileLoaderName" can be one of the following: ["PDFLoader", "TextLoader", "UnstructuredLoader"]
The "Arguments dict" is a dictionary that contains the necessary arguments for the File Loader class.
You can use Unstructured in two ways:Example (Unstructured)
UNSTRUCTUREDAPIKEY and UNSTRUCTUREDAPIURLconfig.setproviderconfig("file_loader", "UnstructuredLoader", {})
pip install unstructured-ingestpip install "unstructured[all-docs]"pip install "unstructured[pdf]"
Currently supported file types: please refer to the Docling documentation: https://docling-project.github.io/docling/usage/supported_formats/#supported-output-formats You need to install docling before running, execute: Example (Docling)
config.setproviderconfig("file_loader", "DoclingLoader", {})pip install docling. More details about Docling: https://docling-project.github.io/docling/
Web Crawler Configuration
config.setproviderconfig("web_crawler", "(WebCrawlerName)", "(Arguments dict)")
The "WebCrawlerName" can be one of the following: ["FireCrawlCrawler", "Crawl4AICrawler", "JinaCrawler"]
The "Arguments dict" is a dictionary that contains the necessary arguments for the Web Crawler class.
Make sure you have prepared your FireCrawl API KEY as an env variable More details about FireCrawl: https://docs.firecrawl.dev/introduction Example (FireCrawl)
FIRECRAWLAPIKEY.config.setproviderconfig("web_crawler", "FireCrawlCrawler", {})
Make sure you have run You need to install crawl4ai before running, execute: Example (Crawl4AI)
crawl4ai-setup in your environment.config.setproviderconfig("webcrawler", "Crawl4AICrawler", {"browserconfig": {"headless": True, "verbose": True}})pip install crawl4ai. More details about Crawl4AI: https://docs.crawl4ai.com/
Make sure you have prepared your Jina Reader API KEY as an env variable More details about Jina Reader: https://jina.ai/reader/ Example (Jina Reader)
JINAAPITOKEN or JINAAIAPIKEY.config.setproviderconfig("web_crawler", "JinaCrawler", {})
Currently supported file types: please refer to the Docling documentation: https://docling-project.github.io/docling/usage/supported_formats/#supported-output-formats You need to install docling before running, execute: Example (Docling)
config.setproviderconfig("web_crawler", "DoclingCrawler", {})pip install docling. More details about Docling: https://docling-project.github.io/docling/
Python CLI Mode
Load
deepsearcher load "yourlocalpathorurl"
load into a specific collection
deepsearcher load "yourlocalpathorurl" --collectionname "yourcollectionname" --collectiondesc "yourcollectiondescription"
Example loading from local file:
deepsearcher load "/path/to/your/local/file.pdf"
or more files at once
deepsearcher load "/path/to/your/local/file1.pdf" "/path/to/your/local/file2.md"
Example loading from url (Set FIRECRAWLAPIKEY in your environment variables, see FireCrawl for more details):
deepsearcher load "https://www.wikiwand.com/en/articles/DeepSeek"
Query
deepsearcher query "Write a report about xxx."
More help information
deepsearcher --help For more help information about a specific subcommand, you can use deepsearcher [subcommand] --help. deepsearcher load --help deepsearcher query --help
Deployment
Configure modules
You can configure all arguments by modifying config.yaml to set up your system with default modules. For example, set your OPENAIAPIKEY in the llm section of the YAML file.
Start service
The main script will run a FastAPI service with default addresslocalhost:8000.
$ python main.py
Access via browser
You can open url http://localhost:8000/docs in browser to access the web service. Click on the button "Try it out", it allows you to fill the parameters and directly interact with the API.
โ Q&A
Q1: Why I failed to parse LLM output format / How to select the LLM?
A1: Small LLMs struggle to follow the prompt to generate a desired response, which usually cause the format parsing problem. A better practice is to use large reasoning models e.g. deepseek-r1 671b, OpenAI o-series, Claude 4 sonnet, etc. as your LLM.
Q2: OSError: We couldn't connect to 'https://huggingface.co' to load this file, couldn't find it in the cached files and it looks like GPTCache/paraphrase-albert-small-v2 is not the path to a directory containing a file named config.json. Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.
A2: This is mainly due to abnormal access to huggingface, which may be a network or permission problem. You can try the following two methods:
- If there is a network problem, set up a proxy, try adding the following environment variable.
export HF_ENDPOINT=https://hf-mirror.com - If there is a permission problem, set up a personal token, try adding the following environment variable.
export HUGGINGFACEHUB_TOKEN=xxxx
Q3: DeepSearcher doesn't run in Jupyter notebook.
A3: Install nest_asyncio and then put this code block in front of your jupyter notebook.
pip install nest_asyncio
import nest_asyncio
nest_asyncio.apply()
๐ง Module Support
๐น Embedding Models
- Open-source embedding models
- OpenAI (
OPENAIAPI_KEYenv variable required) - VoyageAI (
VOYAGEAPI_KEYenv variable required) - Amazon Bedrock (
AWSACCESSKEYIDandAWSSECRETACCESS_KEYenv variable required) - FastEmbed
- PPIO (
PPIOAPI_KEYenv variable required) - Novita AI (
NOVITAAPIKEYenv variable required) - IBM watsonx.ai (
WATSONXAPIKEY,WATSONXURL,WATSONXPROJECT_IDenv variables required) - Jiekou.AI (
JIEKOUAPI_KEYenv variable required)
๐น LLM Support
- OpenAI (
OPENAIAPI_KEYenv variable required) - DeepSeek (
DEEPSEEKAPI_KEYenv variable required) - XAI Grok (
XAIAPI_KEYenv variable required) - Anthropic Claude (
ANTHROPICAPI_KEYenv variable required) - SiliconFlow Inference Service (
SILICONFLOWAPI_KEYenv variable required) - PPIO (
PPIOAPI_KEYenv variable required) - TogetherAI Inference Service (
TOGETHERAPI_KEYenv variable required) - Google Gemini (
GEMINIAPI_KEYenv variable required) - SambaNova Cloud Inference Service (
SAMBANOVAAPI_KEYenv variable required) - Ollama
- Novita AI (
NOVITAAPIKEYenv variable required) - IBM watsonx.ai (
WATSONXAPIKEY,WATSONXURL,WATSONXPROJECT_IDenv variable required) - Jiekou.AI (
JIEKOUAPI_KEYenv variable required)
๐น Document Loader
- Local File
UNSTRUCTUREDAPIKEY and UNSTRUCTUREDURL env variables required)
- Web Crawler
FIRECRAWLAPI_KEY env variable required)
- Jina Reader (JINAAPI_TOKEN env variable required)
- Crawl4AI (You should run command crawl4ai-setup for the first time)
๐น Vector Database Support
- Milvus and Zilliz Cloud (fully managed Milvus)
- Qdrant
๐ Evaluation
See the Evaluation directory for more details.๐ Future Plans
- Enhance web crawling functionality
- Support more vector databases (e.g., FAISS...)
- Add support for additional large models
- Provide RESTful API interface (DONE)