在私有数据上进行智能搜索和分析的工具DeepSearcher

项目简介

DeepSearcher 结合推理LLMs(OpenAI o1、o3-mini、DeepSeek、Grok 3、Claude 3.7 Sonnet、QwQ 等)和向量数据库(Milvus、Zilliz Cloud 等)以对私有数据进行搜索、评估和推理,提供高度准确的答案和全面报告。此项目适用于企业知识管理、智能问答系统和信息检索场景。



🚀 特点

  • 私有数据搜索:最大化利用企业内部数据的同时确保数据安全。必要时,可集成在线内容以提供更准确的答案。
  • 向量数据库管理:支持 Milvus 和其他向量数据库,允许数据分区以提高检索效率。
  • 灵活的嵌入选项:兼容多种嵌入模型,以实现最佳选择。
  • 多种支持:支持 DeepSeek、OpenAI 和其他大型模型进行智能问答和内容生成。
  • 文档加载器:支持本地文件加载,正在开发网页爬取功能。


🎉 示例

快速开始

安装

使用 pip 安装 DeepSearcher:

# Clone the repositorygit clone https://github.com/zilliztech/deep-searcher.git
# MAKE SURE the python version is greater than or equal to 3.10# Recommended: Create a Python virtual environmentcd deep-searcherpython3 -m venv .venvsource .venv/bin/activate
# Install dependenciespip install -e .

准备您的 OPENAI_API_KEY 到环境变量中。如果您更改配置中的LLM,请确保准备相应的 API 密钥。


快速开始演示

from deepsearcher.configuration import Configuration, init_configfrom deepsearcher.online_query import query
config = Configuration()
# Customize your config here,# more configuration see the Configuration Details section below.config.set_provider_config("llm""OpenAI", {"model""o1-mini"})config.set_provider_config("embedding""OpenAIEmbedding", {"model""text-embedding-ada-002"})init_config(config = config)
# Load your local datafrom deepsearcher.offline_loading import load_from_local_filesload_from_local_files(paths_or_directory=your_local_path)
# (Optional) Load from web crawling (`FIRECRAWL_API_KEY` env variable required)from deepsearcher.offline_loading import load_from_websiteload_from_website(urls=website_url)
# Queryresult = query("Write a report about xxx."# Your question here


配置详情:

LLM 配置

config.set_provider_config("llm""(LLMName)""(Arguments dict)")

“LLMName” 可以是以下之一:[“DeepSeek”, “OpenAI”, “XAI”, “SiliconFlow”, “PPIO”, “TogetherAI”, “Gemini”, “Ollama”]

“Arguments dict” 是一个字典,包含 LLM 类所需的参数。

嵌入模型配置

config.set_provider_config("embedding""(EmbeddingModelName)""(Arguments dict)")

“EmbeddingModelName” 可以是以下之一:[“MilvusEmbedding”, “OpenAIEmbedding”, “VoyageEmbedding”, “SiliconflowEmbedding”]

“参数字典”是一个包含嵌入模型类所需参数的字典。


向量数据库配置

“VectorDBName” 可以是以下之一:[“Milvus”](开发中)

“Arguments dict” 是一个包含向量数据库类所需参数的字典。

文件加载器配置

config.set_provider_config("file_loader""(FileLoaderName)""(Arguments dict)")

网络爬虫配置

config.set_provider_config("web_crawler""(WebCrawlerName)""(Arguments dict)")

“WebCrawlerName” 可以是以下之一:[“FireCrawlCrawler”, “Crawl4AICrawler”, “JinaCrawler”]

“Arguments dict” 是一个包含 Web Crawler 类所需参数的字典。


Python 命令行界面模式

加载

deepsearcher load "your_local_path_or_url"# load into a specific collectiondeepsearcher load "your_local_path_or_url" --collection_name "your_collection_name" --collection_desc "your_collection_description"

示例:从本地文件加载

deepsearcher load "/path/to/your/local/file.pdf"# or more files at oncedeepsearcher load "/path/to/your/local/file1.pdf" "/path/to/your/local/file2.md"

 查询

deepsearcher query "Write a report about xxx."

更多帮助信息

deepsearcher --help

若要获取有关特定子命令的更多帮助信息,可以使用 deepsearcher [subcommand] --help 。

deepsearcher load --helpdeepsearcher query --help

部署

配置模块
您可以通过修改 config.yaml 来配置所有参数,以使用默认模块设置您的系统。例如,在 YAML 文件的 llm 部分设置您的 OPENAI_API_KEY 。


启动服务

主脚本将以默认地址 localhost:8000 运行 FastAPI 服务。

$ python main.py

通过浏览器访问

您可以在浏览器中打开 url http://localhost:8000/docs 以访问该网络服务。点击“试一试”按钮,允许您填写参数并直接与 API 交互。



项目链接

https://github.com/zilliztech/deep-searcher

扫码加入技术交流群,备注开发语言-城市-昵称

(文:GitHubStore)

欢迎分享

发表评论