DeepSearcher Documentation
repository·master·Indexed 26 days ago
https://github.com/zilliztech/deep-searcherDeepSearcher is a framework for advanced search, evaluation, and reasoning using private data by combining LLMs with vector databases such as Milvus, Zilliz Cloud, and Azure AI Search. It features support for multiple LLM providers (including OpenAI, DeepSeek, and Anthropic), various embedding models, document loaders (PDF, Unstructured, Docling), and web crawlers (FireCrawl, Crawl4AI, Jina). The framework includes a CLI for data loading and querying, a FastAPI service for deployment, and an evaluation script to compare performance against naive RAG.
What's inside DeepSearcher
- DeepSearcher is a system designed for search, evaluation, and reasoning based on private data. It integrates advanced Large Language Models (LLMs) like OpenAI o1, o3-mini, DeepSeek, Grok 3, Claude 4 Sonnet, Llama 4, and QwQ with Vector Databases such as Milvus and Zilliz Cloud. It is intended for enterprise knowledge management, intelligent Q&A systems, and information retrieval.
Choose a DeepSearcher usage method
masterDeepSearcher can be integrated into your workflow using one of three primary methods:
- Python API: Best for programmatic integration and custom logic.
- Command Line Interface (CLI): Best for quick tasks and terminal-based workflows.
- Web Service Deployment: Best for serving DeepSearcher as a scalable service.
Refer to the specific guides for
quick_start.md,cli.md, ordeployment.mdto begin.Key Features of DeepSearcher
masterDeepSearcher provides the following capabilities:
- Private Data Search: Utilizes enterprise internal data securely, with optional integration of online content.
- Vector Database Management: Supports Milvus and other vector databases with data partitioning for efficient retrieval.
- Flexible Embedding Options: Compatible with multiple embedding models.
- Multiple LLM Support: Supports various models including DeepSeek and OpenAI for Q&A and content generation.
- Document Loader: Supports loading local files and (under development) web crawling.
Configure DeepSearcher components
masterDeepSearcher allows customization of several core components through its configuration system. You can configure the following components:
- LLM: Large Language Models used for query processing.
- Embedding Models: Models used for generating text embeddings for vector retrieval.
- Vector Database: The storage and retrieval system for vector embeddings.
- File Loader: Handles loading and processing of various file formats.
- Web Crawler: Gathers information from web sources.
Run DeepSearcher in a Docker container
masterRun the built
deepsearcher:latestimage as a container. This command maps port 8000, sets theOPENAI_API_KEYenvironment variable, and mounts local directories fordata,logs, and theconfig.yamlfile to ensure persistence and configuration application.docker run -p 8000:8000 \ -e OPENAI_API_KEY=your_openai_api_key \ -v $(pwd)/data:/app/data \ -v $(pwd)/logs:/app/logs \ -v $(pwd)/deepsearcher/config.yaml:/app/deepsearcher/config.yaml \ deepsearcher:latestQuick Start Demo with Python API
masterTo run a basic DeepSearcher workflow, configure your LLM and Embedding providers, load data (local files or websites), and then execute a query. Ensure you have the necessary API keys (e.g.,
OPENAI_API_KEY) set in your environment variables.Note: If using web crawling, the
FIRECRAWL_API_KEYenvironment variable is required.Configure Local LLM with Ollama
masterTo use a local LLM via Ollama, set the provider to
Ollama.- Install and run Ollama locally.
- Pull the desired model (e.g.,
ollama pull qwq). - Ensure the Ollama REST API is running (default:
http://localhost:11434).
config.set_provider_config("llm", "Ollama", {"model": "qwq"})Set up the DeepSearcher documentation environment
masterTo set up the local documentation environment using MkDocs, install the necessary dependencies and clone the repository.
- Install MkDocs and required plugins:
pip install mkdocs mkdocs-material mkdocs-jupyter pymdown-extensions- Clone the repository:
git clone https://github.com/zilliztech/deep-searcher.git cd deep-searcherpip install mkdocs mkdocs-material mkdocs-jupyter pymdown-extensions git clone https://github.com/zilliztech/deep-searcher.git cd deep-searcherConfigure Zilliz Cloud (Managed Milvus)
masterTo use the managed Zilliz Cloud service, provide your specific instance endpoint as the
uriand your API key as thetoken.config.set_provider_config("vector_db", "Milvus", { "uri": "https://your-instance-id.api.gcp-us-west1.zillizcloud.com", "token": "your_api_key" })Configure embedding models in DeepSearcher
masterDeepSearcher uses embedding models to convert text into vector representations for semantic search. You can configure the embedding provider using the
config.set_provider_configmethod, specifying the provider name and a dictionary of arguments (such as the model name).config.set_provider_config("embedding", "(EmbeddingModelName)", "(Arguments dict)")Run the DeepSearcher evaluation script
masterUse the
evaluate.pyscript to compare the performance of DeepSearcher against naive RAG using the Recall@K metric. The evaluation currently supports the2wikimultihopqadataset.You can provide a configuration YAML file to specify your LLM, embedding model, and other provider parameters. To avoid re-loading the dataset into the vector database on subsequent runs, use the
--skip_loadflag.python evaluate.py \ --dataset 2wikimultihopqa \ --config_yaml ./eval_config.yaml \ --pre_num 5 \ --output_dir ./eval_outputVerify DeepSearcher installation
masterAfter installation, you can verify that the package is correctly set up by initializing a
Configurationobject and importing thequeryfunction fromdeepsearcher.online_query.from deepsearcher.configuration import Configuration from deepsearcher.online_query import query # Initialize with default configuration config = Configuration() print("DeepSearcher installed successfully!")